[efi] Allow use of EFI configuration tables

EFI passes in copies of SMBIOS and other system configuration tables
via the EFI system table.  Allow configuration tables to be requested
using a mechanism similar to the current method for requesting EFI
protocols.
This commit is contained in:
Michael Brown
2008-12-04 04:04:54 +00:00
parent 3a799e99ca
commit 045a22764a
2 changed files with 78 additions and 4 deletions

View File

@@ -43,6 +43,7 @@
/** An EFI protocol used by gPXE */
struct efi_protocol {
/** GUID */
union {
/** EFI protocol GUID */
EFI_GUID guid;
@@ -70,6 +71,38 @@ struct efi_protocol {
(_ptr) : (_ptr) ) ), \
}
/** An EFI configuration table used by gPXE */
struct efi_config_table {
/** GUID */
union {
/** EFI configuration table GUID */
EFI_GUID guid;
/** UUID structure understood by gPXE */
union uuid uuid;
} u;
/** Variable containing pointer to configuration table */
void **table;
/** Table is required for operation */
int required;
};
/** Declare an EFI configuration table used by gPXE */
#define __efi_config_table \
__table ( struct efi_config_table, efi_config_tables, 01 )
/** Declare an EFI configuration table to be used by gPXE
*
* @v _table EFI configuration table name
* @v _ptr Pointer to configuration table
* @v _required Table is required for operation
*/
#define EFI_USE_TABLE( _table, _ptr, _required ) \
struct efi_config_table __ ## _table __efi_config_table = { \
.u.guid = _table ## _GUID, \
.table = ( ( void ** ) ( void * ) (_ptr) ), \
.required = (_required), \
}
/** Convert a gPXE status code to an EFI status code
*
* FIXME: actually perform some kind of conversion. gPXE error codes