[PATCH v2 20/21] efi/libstub: import type definitions for creating and signalling events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We will use the EFI event handling infrastructure in a future patch to
register a notification function that executes at the very end of
ExitBootServices() to disable DMA on all PCI bridges in the system.

So import the missing macros and typedefs from the UEFI spec.

Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
---
 include/linux/efi.h | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/include/linux/efi.h b/include/linux/efi.h
index f97f48a3dc81..81bd1e8c201f 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -270,6 +270,23 @@ typedef struct {
 	u32 create_event_ex;
 } __packed efi_boot_services_32_t;
 
+typedef unsigned long efi_tpl_t;
+
+#define TPL_APPLICATION				4
+#define TPL_CALLBACK				8
+#define TPL_NOTIFY				16
+#define TPL_HIGH_LEVEL				31
+
+typedef void *efi_event_t;
+typedef void (__efiapi *efi_event_notify_t)(efi_event_t, void *);
+
+#define EVT_TIMER				0x80000000
+#define EVT_RUNTIME				0x40000000
+#define EVT_NOTIFY_WAIT				0x00000100
+#define EVT_NOTIFY_SIGNAL			0x00000200
+#define EVT_SIGNAL_EXIT_BOOT_SERVICES		0x00000201
+#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE	0x60000202
+
 /*
  * EFI Boot Services table
  */
@@ -288,10 +305,12 @@ typedef union {
 		efi_status_t (__efiapi *allocate_pool)(int, unsigned long,
 						       void **);
 		efi_status_t (__efiapi *free_pool)(void *);
-		void *create_event;
+		efi_status_t (__efiapi *create_event)(u32 type, efi_tpl_t,
+						      efi_event_notify_t,
+						      void *, efi_event_t *);
 		void *set_timer;
 		void *wait_for_event;
-		void *signal_event;
+		efi_status_t (__efiapi *signal_event)(efi_event_t);
 		void *close_event;
 		void *check_event;
 		void *install_protocol_interface;
-- 
2.17.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux