diff options
| author | Ada Christine <adachristine18@gmail.com> | 2024-02-13 01:04:02 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2024-02-13 01:04:02 +0000 |
| commit | 96ff1a24a7474b91c44a3dcd6f3abf3ec0542191 (patch) | |
| tree | f79dc76febe07d23d1ee6caf9a0b93bfcb85919d /kjarna/efi/start.c | |
| parent | 3f9278b48ff4bc0d2cf1604034b3bba548572f04 (diff) | |
reorganize a bit
Diffstat (limited to 'kjarna/efi/start.c')
| -rw-r--r-- | kjarna/efi/start.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/kjarna/efi/start.c b/kjarna/efi/start.c new file mode 100644 index 0000000..4a10541 --- /dev/null +++ b/kjarna/efi/start.c @@ -0,0 +1,29 @@ +#include <efi/types.h> +#include <efi/error.h> +#include <efi/media.h> +#include <efi/tables.h> + +#include "../kjarna.h" +#include "kjarna_efi.h" + +struct efi_context const *efi_context; +EFI_STATUS efi_errno = EFI_SUCCESS; + +EFI_STATUS _exit(EFI_STATUS status) +{ + return gBS->Exit(efi_context->handle, status, 0, nullptr); +} + +EFI_STATUS _start(EFI_HANDLE handle, EFI_SYSTEM_TABLE *system_table) +{ + struct efi_context app_context = { handle, system_table }; + efi_context = &app_context; + + if (main(0, nullptr) != 0) + { + efi_errno = EFI_ABORTED; + } + + return _exit(efi_errno); +} + |
