From 045a22764afd75a0b887c7da6828d683c303ebb4 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 4 Dec 2008 04:04:54 +0000 Subject: [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. --- src/include/gpxe/efi/efi.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/include') diff --git a/src/include/gpxe/efi/efi.h b/src/include/gpxe/efi/efi.h index 8c9f789a6..b46d5ca52 100644 --- a/src/include/gpxe/efi/efi.h +++ b/src/include/gpxe/efi/efi.h @@ -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 -- cgit v1.2.3-55-g7522