mirror of
https://github.com/ipxe/ipxe
synced 2025-12-25 00:17:57 +03:00
[Settings] Expose SMBIOS via settings API
In particular, expose the system UUID as a setting ("smbios/uuid").
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user