Splitting out UEFI bootloader code from kernel
Now the bootloader should be responsible for all initial setup, loading the kernel, and then handing off to the kernel with proper data in place.
This commit is contained in:
20
src/boot/utility.h
Normal file
20
src/boot/utility.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <efi.h>
|
||||
#include <efilib.h>
|
||||
#include "console.h"
|
||||
|
||||
#define UNUSED __attribute__((unused))
|
||||
|
||||
const CHAR16 *util_error_message(EFI_STATUS status);
|
||||
|
||||
#define CHECK_EFI_STATUS_OR_RETURN(s, msg, ...) \
|
||||
if (EFI_ERROR((s))) { \
|
||||
Print(L"EFI_ERROR: " msg L": %s\n", ## __VA_ARGS__, util_error_message(s)); \
|
||||
return (s); \
|
||||
}
|
||||
|
||||
#define CHECK_EFI_STATUS_OR_FAIL(s) \
|
||||
if (EFI_ERROR((s))) { \
|
||||
con_status_fail(util_error_message(s)); \
|
||||
while (1) __asm__("hlt"); \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user