From b325e720527e41a32244605b13cd804c993a8032 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 2 May 2024 15:36:48 -0400 Subject: [PATCH] uefi-macros: Call set_image_handle from the entry macro --- uefi-macros/CHANGELOG.md | 3 +++ uefi-macros/src/lib.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/uefi-macros/CHANGELOG.md b/uefi-macros/CHANGELOG.md index b56ff7fce..a2e56ccd4 100644 --- a/uefi-macros/CHANGELOG.md +++ b/uefi-macros/CHANGELOG.md @@ -1,5 +1,8 @@ # uefi-macros - [Unreleased] +## Changed +- The `entry` macro now sets the global system table pointer with `uefi::set_system_table`. + ## Removed - Removed the `cstr8` and `cstr16` macros. Use the declarative macros of the same names exported by the `uefi` crate as a replacement. diff --git a/uefi-macros/src/lib.rs b/uefi-macros/src/lib.rs index 9f5b67da8..09a67716e 100644 --- a/uefi-macros/src/lib.rs +++ b/uefi-macros/src/lib.rs @@ -204,6 +204,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream { parse_quote! { unsafe { #system_table_ident.boot_services().set_image_handle(#image_handle_ident); + ::uefi::table::set_system_table(#system_table_ident.as_ptr().cast()); } }, );