summaryrefslogtreecommitdiff
path: root/core/sboot.c
diff options
context:
space:
mode:
authorIan M. <ian@aptel.org>2026-09-11 05:40:51 +0000
committerIan M. <ian@aptel.org>2026-09-11 05:40:51 +0000
commit9bf419b4e0516ac23c3e49af0a10cb79ac1fd063 (patch)
tree2cf48d860bae74a613864134d391e041033c3c81 /core/sboot.c
parentd1ae146b1fcecdd6ae688cedf523a5be0d7980c5 (diff)
core: Get platform memory map and exit boot services
Signed-off-by: Ian M. <ian@aptel.org>
Diffstat (limited to 'core/sboot.c')
-rw-r--r--core/sboot.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/sboot.c b/core/sboot.c
index 604c768..53366a0 100644
--- a/core/sboot.c
+++ b/core/sboot.c
@@ -7,11 +7,13 @@
#include <efilib.h>
#include <sboot/sboot.h>
#include <sboot/config.h>
+#include <sboot/memmap.h>
#include <sboot/fwi.h>
#include <sboot/file.h>
/* Private globals */
static UINT8 *KernelBin = NULL;
+static PLATFORM_MEMMAP MemMap;
/* Globals */
EFI_FILE_HANDLE gBootVolume;
@@ -50,5 +52,22 @@ efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
Hcf();
}
+ Status = SBootGetMemmap(&MemMap);
+ if (EFI_ERROR(Status)) {
+ Hcf();
+ }
+
+ /* Get out of here! */
+ Status = uefi_call_wrapper(
+ gBS->ExitBootServices,
+ 2,
+ ImageHandle,
+ MemMap.MapKey
+ );
+
+ if (EFI_ERROR(Status)) {
+ Hcf();
+ }
+
for (;;);
}