diff options
| author | Michael Brown | 2008-03-28 16:35:06 +0100 |
|---|---|---|
| committer | Michael Brown | 2008-03-28 16:35:06 +0100 |
| commit | feade5da6e0fd233b845d40c7a0a696ad1e35cc4 (patch) | |
| tree | 9070941b33b0ef636f5602c67d2218779880dea9 /src/arch/i386/include | |
| parent | [DHCP] Add support for ProxyDHCP requests (diff) | |
| download | ipxe-feade5da6e0fd233b845d40c7a0a696ad1e35cc4.tar.gz ipxe-feade5da6e0fd233b845d40c7a0a696ad1e35cc4.tar.xz ipxe-feade5da6e0fd233b845d40c7a0a696ad1e35cc4.zip | |
[Settings] Expose SMBIOS via settings API
In particular, expose the system UUID as a setting ("smbios/uuid").
Diffstat (limited to 'src/arch/i386/include')
| -rw-r--r-- | src/arch/i386/include/bits/errfile.h | 1 | ||||
| -rw-r--r-- | src/arch/i386/include/bits/uuid.h | 10 | ||||
| -rw-r--r-- | src/arch/i386/include/smbios.h | 23 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/arch/i386/include/bits/errfile.h b/src/arch/i386/include/bits/errfile.h index 0f1402148..678be0457 100644 --- a/src/arch/i386/include/bits/errfile.h +++ b/src/arch/i386/include/bits/errfile.h @@ -12,6 +12,7 @@ #define ERRFILE_smbios ( ERRFILE_ARCH | ERRFILE_CORE | 0x00030000 ) #define ERRFILE_biosint ( ERRFILE_ARCH | ERRFILE_CORE | 0x00040000 ) #define ERRFILE_int13 ( ERRFILE_ARCH | ERRFILE_CORE | 0x00050000 ) +#define ERRFILE_smbios_settings ( ERRFILE_ARCH | ERRFILE_CORE | 0x00060000 ) #define ERRFILE_bootsector ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_bzimage ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00010000 ) diff --git a/src/arch/i386/include/bits/uuid.h b/src/arch/i386/include/bits/uuid.h deleted file mode 100644 index 0cbd320a9..000000000 --- a/src/arch/i386/include/bits/uuid.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _I386_UUID_H -#define _I386_UUID_H - -#include <smbios.h> - -static inline int get_uuid ( union uuid *uuid ) { - return smbios_get_uuid ( uuid ); -} - -#endif /* _I386_UUID_H */ diff --git a/src/arch/i386/include/smbios.h b/src/arch/i386/include/smbios.h index 821eda17e..f2736dc3a 100644 --- a/src/arch/i386/include/smbios.h +++ b/src/arch/i386/include/smbios.h @@ -13,11 +13,21 @@ struct smbios_header { /** Type */ uint8_t type; /** Length */ - uint8_t length; + uint8_t len; /** Handle */ uint16_t handle; } __attribute__ (( packed )); +/** SMBIOS structure descriptor */ +struct smbios_structure { + /** Copy of SMBIOS structure header */ + struct smbios_header header; + /** Offset of structure within SMBIOS */ + size_t offset; + /** Length of strings section */ + size_t strings_len; +}; + /** SMBIOS system information structure */ struct smbios_system_information { /** SMBIOS structure header */ @@ -39,13 +49,12 @@ struct smbios_system_information { /** SMBIOS system information structure type */ #define SMBIOS_TYPE_SYSTEM_INFORMATION 1 -struct smbios_strings; extern int find_smbios_structure ( unsigned int type, - void *structure, size_t length, - struct smbios_strings *strings ); -extern int find_smbios_string ( struct smbios_strings *strings, + struct smbios_structure *structure ); +extern int read_smbios_structure ( struct smbios_structure *structure, + void *data, size_t len ); +extern int read_smbios_string ( struct smbios_structure *structure, unsigned int index, - char *buffer, size_t length ); -extern int smbios_get_uuid ( union uuid *uuid ); + void *data, size_t len ); #endif /* _SMBIOS_H */ |
