summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown2014-05-19 21:23:31 +0200
committerMichael Brown2014-05-19 21:23:31 +0200
commit95cff6a4d87a83093d3c685d7743f3c13a44a177 (patch)
tree47cbbfccd1038309433fc4f168b11b46a95f3758 /src/include/ipxe
parent[nfs] Rewrite NFS URI handling (diff)
downloadipxe-95cff6a4d87a83093d3c685d7743f3c13a44a177.tar.gz
ipxe-95cff6a4d87a83093d3c685d7743f3c13a44a177.tar.xz
ipxe-95cff6a4d87a83093d3c685d7743f3c13a44a177.zip
[efi] Allow for optional protocols
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/efi/efi.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h
index a98b5588..05576f9d 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 */