mirror of
https://github.com/limine-bootloader/limine
synced 2024-12-03 21:52:39 +03:00
return to firmware instead of halting in uefi mode
This commit is contained in:
parent
4c1782357a
commit
2c679dcec3
@ -1,6 +1,10 @@
|
||||
#include <lib/print.h>
|
||||
#include <lib/real.h>
|
||||
#include <lib/trace.h>
|
||||
#include <lib/blib.h>
|
||||
#include <lib/readline.h>
|
||||
#include <lib/gterm.h>
|
||||
#include <mm/pmm.h>
|
||||
|
||||
__attribute__((noreturn)) void panic(const char *fmt, ...) {
|
||||
asm volatile ("cli" ::: "memory");
|
||||
@ -18,8 +22,16 @@ __attribute__((noreturn)) void panic(const char *fmt, ...) {
|
||||
print_stacktrace(NULL);
|
||||
|
||||
#if defined (bios)
|
||||
print("System halted.");
|
||||
rm_hcf();
|
||||
#elif defined (uefi)
|
||||
for (;;) asm ("hlt");
|
||||
print("Press any key to return to firmware.");
|
||||
getchar();
|
||||
gterm_clear(true);
|
||||
|
||||
// release all uefi memory and return to firmware
|
||||
pmm_release_uefi_mem();
|
||||
uefi_call_wrapper(gBS->Exit, 4, efi_image_handle, EFI_ABORTED, 0, NULL);
|
||||
__builtin_unreachable();
|
||||
#endif
|
||||
}
|
||||
|
@ -73,5 +73,5 @@ void print_stacktrace(size_t *base_ptr) {
|
||||
break;
|
||||
base_ptr = (void*)old_bp;
|
||||
}
|
||||
print("End of trace.\n");
|
||||
print("End of trace. ");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user