diff options
author | Marvin Borner | 2019-11-24 23:34:32 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-24 23:34:32 +0100 |
commit | bb57b124d1bb385d41747f50be7dd4f3625539c1 (patch) | |
tree | fe461afad63df40571784565e8d435cba8c8e59c /src/kernel/smbios | |
parent | f9c50b9ff23e9a3e8db5826fef7a6e7ebb8af21d (diff) |
Major coding style reformatting -> Kernighan & Ritchie
This project now (hopefully) uses the same style recommended by Kernighan and Ritchie and used in the Linux Kernel
Diffstat (limited to 'src/kernel/smbios')
-rw-r--r-- | src/kernel/smbios/smbios.c | 26 | ||||
-rw-r--r-- | src/kernel/smbios/smbios.h | 17 |
2 files changed, 23 insertions, 20 deletions
diff --git a/src/kernel/smbios/smbios.c b/src/kernel/smbios/smbios.c index 0275f48..95ea70c 100644 --- a/src/kernel/smbios/smbios.c +++ b/src/kernel/smbios/smbios.c @@ -4,33 +4,18 @@ #include <kernel/io/io.h> #include <kernel/smbios/smbios.h> -struct smbios_entry { - int8_t signature[4]; - uint8_t checksum; - uint8_t length; - uint8_t major_version; - uint8_t minor_version; - uint8_t max_structure_size; - int8_t entry_point_revision; - int8_t formatted_area[5]; - int8_t entry_point_signature[5]; - uint8_t checksum2; - uint16_t table_length; - uint32_t table_address; - uint16_t number_of_structures; - uint8_t bcd_revision; -}; - struct smbios_entry *smbios = 0; -size_t smbios_table_len(struct smbios_header *header) { +size_t smbios_table_len(struct smbios_header *header) +{ size_t i; const char *strtab = (char *) header + header->length; for (i = 1; strtab[i - 1] != '\0' || strtab[i] != '\0'; i++); return header->length + i + 1; } -struct smbios_entry *get_smbios() { +struct smbios_entry *get_smbios() +{ if (smbios != 0) return smbios; char *mem = (char *) 0xF0000; @@ -59,7 +44,8 @@ struct smbios_entry *get_smbios() { return smbios; } -void smbios_table(struct smbios_header *header) { +void smbios_table(struct smbios_header *header) +{ serial_write("\n\n"); struct smbios_0 *table = (struct smbios_0 *) (header + sizeof(struct smbios_header)); serial_write(table->bios_version); diff --git a/src/kernel/smbios/smbios.h b/src/kernel/smbios/smbios.h index 384119c..4814a17 100644 --- a/src/kernel/smbios/smbios.h +++ b/src/kernel/smbios/smbios.h @@ -7,6 +7,23 @@ struct smbios_header { uint16_t handle; }; +struct smbios_entry { + int8_t signature[4]; + uint8_t checksum; + uint8_t length; + uint8_t major_version; + uint8_t minor_version; + uint8_t max_structure_size; + int8_t entry_point_revision; + int8_t formatted_area[5]; + int8_t entry_point_signature[5]; + uint8_t checksum2; + uint16_t table_length; + uint32_t table_address; + uint16_t number_of_structures; + uint8_t bcd_revision; +}; + struct smbios_0 { char *vendor; char *bios_version; |