From fa5b91af5183acb969b0ae4821f6c99ca34fdfc9 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sat, 22 Feb 2020 14:27:53 -0800 Subject: [PATCH] Add create_event to boot services --- include/uefi/boot_services.h | 3 ++- include/uefi/types.h | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/uefi/boot_services.h b/include/uefi/boot_services.h index 441d158..42c1226 100644 --- a/include/uefi/boot_services.h +++ b/include/uefi/boot_services.h @@ -14,6 +14,7 @@ namespace uefi { namespace bs_impl { using allocate_pages = status (*)(allocate_type, memory_type, uint64_t, uintptr_t*); + using create_event = status (*)(evt, tpl, event_notify, void*, event*); using locate_protocol = status (*)(const guid *, void *, void **); } @@ -34,7 +35,7 @@ struct boot_services { void *free_pool; // Event & Timer Services - void *create_event; + bs_impl::create_event create_event; void *set_timer; void *wait_for_event; void *signal_event; diff --git a/include/uefi/types.h b/include/uefi/types.h index 015db34..bc13710 100644 --- a/include/uefi/types.h +++ b/include/uefi/types.h @@ -12,6 +12,7 @@ namespace uefi { using handle = void *; +using event = void *; constexpr uint64_t error_bit = 0x8000000000000000ull; constexpr uint64_t make_error(uint64_t e) { return e|error_bit; } @@ -57,6 +58,28 @@ enum class allocate_type : uint32_t address }; +enum class evt : uint32_t +{ + notify_wait = 0x00000100, + notify_signal = 0x00000200, + + signal_exit_boot_services = 0x00000201, + signal_virtual_address_change = 0x60000201, + + runtime = 0x40000000, + timer = 0x80000000 +}; + +enum class tpl : uint64_t +{ + application = 4, + callback = 8, + notify = 16, + high_level = 31 +}; + +using event_notify = status (*)(event, void*); + } // namespace uefi #endif