summaryrefslogtreecommitdiffhomepage
path: root/Private/EFIKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-31 09:42:54 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-31 09:42:54 +0100
commitfc55f0d69d24fb4908cbd811681f2c3fac53614d (patch)
treeba09a2cdbb225df7ba1a9ec5a12bcbb90b673ead /Private/EFIKit
parent7bed9287589293bd9d712d152539591dee0b28c0 (diff)
kernel: add GKit, improve AMD64 HAL.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/EFIKit')
-rw-r--r--Private/EFIKit/EFILib.hxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Private/EFIKit/EFILib.hxx b/Private/EFIKit/EFILib.hxx
index 3f441a76..147b4fe2 100644
--- a/Private/EFIKit/EFILib.hxx
+++ b/Private/EFIKit/EFILib.hxx
@@ -12,17 +12,14 @@
#include <EFIKit/EFI.hxx>
-#include "NewKit/Defines.hpp"
-
inline EfiSystemTable* ST = nullptr;
inline EfiBootServices* BS = nullptr;
namespace EFI {
/**
@brief Stop Execution of program.
-@param SystemTable EFI System Table.
*/
-inline Void Stop(EfiSystemTable* SystemTable) noexcept {
+inline Void Stop() noexcept {
while (true) {
rt_cli();
rt_halt();
@@ -35,11 +32,15 @@ Bascially frees everything we have in the EFI side.
*/
inline void ExitBootServices(EfiSystemTable* SystemTable, UInt64 MapKey,
EfiHandlePtr ImageHandle) noexcept {
+ if (!SystemTable) return;
+
SystemTable->BootServices->ExitBootServices(ImageHandle, MapKey);
}
} // namespace EFI
inline void KeInitEFI(EfiSystemTable* SystemTable) noexcept {
+ if (!SystemTable) return;
+
ST = SystemTable;
BS = ST->BootServices;
}
@@ -54,7 +55,7 @@ inline void KeRuntimeStop(const EfiCharType* File,
ST->ConOut->OutputString(ST->ConOut, Reason);
ST->ConOut->OutputString(ST->ConOut, L" ***\r\n");
- EFI::Stop(ST);
+ EFI::Stop();
}
#ifdef __BOOTLOADER__