9 0x54a97f1c, 0x4828, 0x4bb0, { 0xaa, 0xa6, 0x95, 0x84, 0x5e, 0x2d, 0xb2, 0xee }
12static EFI_SYSTEM_TABLE*
gST = 0;
40 "efi",
"mapping runtime memory, %ld pages starting at 0x%lx with PAT %x",
55 logw(
"efi",
"No EFI system table provided by bootloader, runtime services not available");
64 logi(
"efi",
"firmware version %d by %ls",
gST->FirmwareRevision,
gST->FirmwareVendor);
66 uint64_t maxStorageSize, remainingStorageSize, maxVarSize;
67 EFI_STATUS status =
gST->RuntimeServices->QueryVariableInfo(0x7, &maxStorageSize, &remainingStorageSize, &maxVarSize);
69 if(status == EFI_SUCCESS) {
70 logi(
"efi",
"firmware reports maximum variable size of %B, with %B of %B available", maxVarSize, remainingStorageSize, maxStorageSize);
73 loge(
"efi",
"Could not query variable info: %d", status);
86 if(status != EFI_SUCCESS) {
87 loge(
"efi",
"Could not log to EFI: %d", status);
void init_acpi_efi(EFI_SYSTEM_TABLE *efiST)
void init_efi(struct LoaderStruct *loaderStruct)
static EFI_SYSTEM_TABLE * gST
struct vm_table * efi_setup_mapping(struct LoaderStruct *loaderStruct)
static EFI_GUID gVendorLFOSGuid
void efi_append_log(char *msg)
size_t strlen(const char *str)
uint64_t flags
Flags for the memory region. See MEMORY_REGION_ defines.
#define MEMORY_REGION_WT
supports write-through
ptr_t firmware_info
Firmware info data, e.g. EFI_SYSTEM_TABLE on UEFI.
#define MEMORY_REGION_WB
supports write-back
#define MEMORY_REGION_WP
Supports write-protected.
size_t num_pages
Number of pages, where page size is 4096 bytes.
#define MEMORY_REGION_FIRMWARE
memory is in use by the firmware
#define MEMORY_REGION_WC
supports write-combine
uint64_t num_mem_desc
Number of memory descriptors.
ptr_t start_address
Start of the region as physical address.
Main interface between loader and kernel.
Describes a single memory region.
#define logd(component, fmt,...)
#define logw(component, fmt,...)
#define logi(component, fmt,...)
#define loge(component, fmt,...)
struct vm_table * vm_current_context(void)
void vm_context_map(struct vm_table *pml4, ptr_t virtual, ptr_t physical, uint8_t pat)
void vm_context_activate(struct vm_table *context)
struct vm_table * vm_context_new(void)
A paging table, when this is a PML4 it may also be called context.