diff options
author | Michael Brown <mcb30@ipxe.org> | 2014-05-19 20:23:31 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2014-05-19 20:23:31 +0100 |
commit | 95cff6a4d87a83093d3c685d7743f3c13a44a177 (patch) | |
tree | 47cbbfccd1038309433fc4f168b11b46a95f3758 /src/include/ipxe/efi/efi.h | |
parent | f4e069bf2e2fcdca417ae7e384efb1fa0ad87343 (diff) | |
download | ipxe-95cff6a4d87a83093d3c685d7743f3c13a44a177.tar.gz |
[efi] Allow for optional protocols
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi/efi.h')
-rw-r--r-- | src/include/ipxe/efi/efi.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h index a98b5588d..05576f9da 100644 --- a/src/include/ipxe/efi/efi.h +++ b/src/include/ipxe/efi/efi.h @@ -59,6 +59,8 @@ struct efi_protocol { EFI_GUID guid; /** Variable containing pointer to protocol structure */ void **protocol; + /** Protocol is required */ + int required; }; /** EFI protocol table */ @@ -78,6 +80,21 @@ struct efi_protocol { .protocol = ( ( void ** ) ( void * ) \ ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \ (_ptr) : (_ptr) ) ), \ + .required = 1, \ + } + +/** Declare an EFI protocol to be requested by iPXE + * + * @v _protocol EFI protocol name + * @v _ptr Pointer to protocol instance + */ +#define EFI_REQUEST_PROTOCOL( _protocol, _ptr ) \ + struct efi_protocol __ ## _protocol __efi_protocol = { \ + .guid = _protocol ## _GUID, \ + .protocol = ( ( void ** ) ( void * ) \ + ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \ + (_ptr) : (_ptr) ) ), \ + .required = 0, \ } /** An EFI configuration table used by iPXE */ |