aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe/efi/efi_hii.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-04-07 23:03:05 +0100
committerMichael Brown <mcb30@ipxe.org>2011-04-07 23:15:07 +0100
commit1c67e2026150fde7895b18238bd502430b1277f9 (patch)
tree2c05c8f23cb67ce65c5bca60f1c8e2699fea1a18 /src/include/ipxe/efi/efi_hii.h
parentaf5e74990cb1d5967bb9d51dde964010b0172e1f (diff)
downloadipxe-1c67e2026150fde7895b18238bd502430b1277f9.zip
ipxe-1c67e2026150fde7895b18238bd502430b1277f9.tar.gz
ipxe-1c67e2026150fde7895b18238bd502430b1277f9.tar.bz2
[efi] Add support for HII
Some EFI platforms expect us to provide an HII interface to display information about the driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi/efi_hii.h')
-rw-r--r--src/include/ipxe/efi/efi_hii.h140
1 files changed, 140 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_hii.h b/src/include/ipxe/efi/efi_hii.h
new file mode 100644
index 0000000..1a98750
--- /dev/null
+++ b/src/include/ipxe/efi/efi_hii.h
@@ -0,0 +1,140 @@
+#ifndef _IPXE_EFI_HII_H
+#define _IPXE_EFI_HII_H
+
+/** @file
+ *
+ * EFI human interface infrastructure
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h>
+#include <ipxe/efi/Guid/MdeModuleHii.h>
+
+/**
+ * Define an EFI IFR form set type
+ *
+ * @v num_class_guids Number of class GUIDs
+ * @ret type Form set type
+ */
+#define EFI_IFR_FORM_SET_TYPE( num_class_guids ) \
+ struct { \
+ EFI_IFR_FORM_SET FormSet; \
+ EFI_GUID ClassGuid[num_class_guids]; \
+ } __attribute__ (( packed ))
+
+/**
+ * Define an EFI IFR form set
+ *
+ * @v guid GUID
+ * @v title Title string
+ * @v help Help string
+ * @v type Form set type (as returned by EFI_IFR_FORM_SET_TYPE())
+ * @ret ifr Form set
+ *
+ * This definition opens a new scope, which must be closed by an
+ * EFI_IFR_END().
+ */
+#define EFI_IFR_FORM_SET( guid, title, help, type, ... ) { \
+ .FormSet = { \
+ .Header = { \
+ .OpCode = EFI_IFR_FORM_SET_OP, \
+ .Length = sizeof ( type ), \
+ .Scope = 1, \
+ }, \
+ .Guid = guid, \
+ .FormSetTitle = title, \
+ .Help = help, \
+ .Flags = ( sizeof ( ( ( type * ) NULL )->ClassGuid ) / \
+ sizeof ( ( ( type * ) NULL )->ClassGuid[0] ) ), \
+ }, \
+ .ClassGuid = { \
+ __VA_ARGS__ \
+ }, \
+ }
+
+/**
+ * Define an EFI IFR GUID class
+ *
+ * @v class Class
+ * @ret ifr GUID class
+ */
+#define EFI_IFR_GUID_CLASS( class ) { \
+ .Header = { \
+ .OpCode = EFI_IFR_GUID_OP, \
+ .Length = sizeof ( EFI_IFR_GUID_CLASS ), \
+ }, \
+ .Guid = EFI_IFR_TIANO_GUID, \
+ .ExtendOpCode = EFI_IFR_EXTEND_OP_CLASS, \
+ .Class = class, \
+ }
+
+/**
+ * Define an EFI IFR GUID subclass
+ *
+ * @v subclass Subclass
+ * @ret ifr GUID subclass
+ */
+#define EFI_IFR_GUID_SUBCLASS( subclass ) { \
+ .Header = { \
+ .OpCode = EFI_IFR_GUID_OP, \
+ .Length = sizeof ( EFI_IFR_GUID_SUBCLASS ), \
+ }, \
+ .Guid = EFI_IFR_TIANO_GUID, \
+ .ExtendOpCode = EFI_IFR_EXTEND_OP_SUBCLASS, \
+ .SubClass = subclass, \
+ }
+
+/**
+ * Define an EFI IFR form
+ *
+ * @v formid Form ID
+ * @v title Title string
+ * @ret ifr Form
+ *
+ * This definition opens a new scope, which must be closed by an
+ * EFI_IFR_END().
+ */
+#define EFI_IFR_FORM( formid, title ) { \
+ .Header = { \
+ .OpCode = EFI_IFR_FORM_OP, \
+ .Length = sizeof ( EFI_IFR_FORM ), \
+ .Scope = 1, \
+ }, \
+ .FormId = formid, \
+ .FormTitle = title, \
+ }
+
+/**
+ * Define an EFI IFR text widget
+ *
+ * @v prompt Prompt string
+ * @v help Help string
+ * @v text Text string
+ * @ret ifr Text widget
+ */
+#define EFI_IFR_TEXT( prompt, help, text ) { \
+ .Header = { \
+ .OpCode = EFI_IFR_TEXT_OP, \
+ .Length = sizeof ( EFI_IFR_TEXT ), \
+ }, \
+ .Statement = { \
+ .Prompt = prompt, \
+ .Help = help, \
+ }, \
+ .TextTwo = text, \
+ }
+
+/**
+ * Define an EFI IFR end marker
+ *
+ * @ret ifr End marker
+ */
+#define EFI_IFR_END() { \
+ .Header = { \
+ .OpCode = EFI_IFR_END_OP, \
+ .Length = sizeof ( EFI_IFR_END ), \
+ }, \
+ }
+
+#endif /* _IPXE_EFI_HII_H */