summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/FirmwareKit/EFI/API.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-24 03:02:43 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-24 03:02:43 +0100
commit83d870e58457a1d335a1d9b9966a6a1887cc297b (patch)
tree72888f88c7728c82f3f6df1f4f70591de15eab36 /dev/kernel/FirmwareKit/EFI/API.h
parentab37adbacf0f33845804c788b39680cd754752a8 (diff)
feat! breaking changes on kernel sources.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/FirmwareKit/EFI/API.h')
-rw-r--r--dev/kernel/FirmwareKit/EFI/API.h88
1 files changed, 0 insertions, 88 deletions
diff --git a/dev/kernel/FirmwareKit/EFI/API.h b/dev/kernel/FirmwareKit/EFI/API.h
deleted file mode 100644
index 24fceb2b..00000000
--- a/dev/kernel/FirmwareKit/EFI/API.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ========================================
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
-
-======================================== */
-
-#ifndef __EFI_API__
-#define __EFI_API__
-
-#include <FirmwareKit/EFI/EFI.h>
-#include <FirmwareKit/Handover.h>
-#include <KernelKit/MSDOS.h>
-#include <KernelKit/PE.h>
-
-#ifdef __BOOTZ__
-// forward decl.
-class BootTextWriter;
-
-#define __BOOTKIT_NO_INCLUDE__ 1
-
-#include <BootKit/BootKit.h>
-#include <modules/CoreGfx/CoreGfx.h>
-#endif // ifdef __BOOTZ__
-
-inline EfiSystemTable* ST = nullptr;
-inline EfiBootServices* BS = nullptr;
-
-EXTERN_C void rt_cli();
-EXTERN_C void rt_halt();
-
-namespace Boot {
-/// @brief Halt and clear interrut flag on x86.
-/// @return
-inline Void Stop() noexcept {
- while (YES) {
- rt_cli();
- rt_halt();
- }
-}
-
-/**
-@brief Exit EFI API to let the OS load correctly.
-Bascially frees everything we have in the EFI side.
-*/
-inline Void ExitBootServices(UInt64 MapKey, EfiHandlePtr ImageHandle) noexcept {
- if (!ST) return;
-
- ST->BootServices->ExitBootServices(ImageHandle, MapKey);
-}
-
-inline UInt32 Platform() noexcept {
- return kPeMachineAMD64;
-}
-
-/***
- * @brief Throw an error, stop execution as well.
- * @param ErrorCode error code to be print.
- * @param Reason reason to be print.
- */
-inline void ThrowError(const EfiCharType* ErrorCode, const EfiCharType* Reason) noexcept {
- ST->ConOut->OutputString(ST->ConOut, L"\r*** STOP ***\r");
-
- ST->ConOut->OutputString(ST->ConOut, L"*** ERROR: ");
- ST->ConOut->OutputString(ST->ConOut, ErrorCode);
-
- ST->ConOut->OutputString(ST->ConOut, L" ***\r *** REASON: ");
- ST->ConOut->OutputString(ST->ConOut, Reason);
-
- ST->ConOut->OutputString(ST->ConOut, L" ***\r");
-
- Boot::Stop();
-}
-} // namespace Boot
-
-inline void fw_init_efi(EfiSystemTable* SystemTable) noexcept {
- if (!SystemTable) return;
-
- ST = SystemTable;
- BS = ST->BootServices;
-}
-
-#ifdef __BOOTZ__
-
-#include <BootKit/Platform.h>
-
-#endif // ifdef __BOOTZ__
-
-#endif /* ifndef __EFI_API__ */