Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/bootinfo.c
Show First 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) | ||||
size_t efisz; | size_t efisz; | ||||
UINTN efi_mapkey; | UINTN efi_mapkey; | ||||
UINTN dsz, pages, retry, sz; | UINTN dsz, pages, retry, sz; | ||||
UINT32 mmver; | UINT32 mmver; | ||||
struct efi_map_header *efihdr; | struct efi_map_header *efihdr; | ||||
bool do_vmap; | bool do_vmap; | ||||
#if defined(__amd64__) || defined(__aarch64__) | #if defined(__amd64__) || defined(__aarch64__) | ||||
static void | |||||
bi_load_efifb(struct preloaded_file *kfp) | |||||
{ | |||||
struct efi_fb efifb; | struct efi_fb efifb; | ||||
efifb.fb_addr = gfx_state.tg_fb.fb_addr; | efifb.fb_addr = gfx_state.tg_fb.fb_addr; | ||||
efifb.fb_size = gfx_state.tg_fb.fb_size; | efifb.fb_size = gfx_state.tg_fb.fb_size; | ||||
efifb.fb_height = gfx_state.tg_fb.fb_height; | efifb.fb_height = gfx_state.tg_fb.fb_height; | ||||
efifb.fb_width = gfx_state.tg_fb.fb_width; | efifb.fb_width = gfx_state.tg_fb.fb_width; | ||||
efifb.fb_stride = gfx_state.tg_fb.fb_stride; | efifb.fb_stride = gfx_state.tg_fb.fb_stride; | ||||
efifb.fb_mask_red = gfx_state.tg_fb.fb_mask_red; | efifb.fb_mask_red = gfx_state.tg_fb.fb_mask_red; | ||||
efifb.fb_mask_green = gfx_state.tg_fb.fb_mask_green; | efifb.fb_mask_green = gfx_state.tg_fb.fb_mask_green; | ||||
efifb.fb_mask_blue = gfx_state.tg_fb.fb_mask_blue; | efifb.fb_mask_blue = gfx_state.tg_fb.fb_mask_blue; | ||||
efifb.fb_mask_reserved = gfx_state.tg_fb.fb_mask_reserved; | efifb.fb_mask_reserved = gfx_state.tg_fb.fb_mask_reserved; | ||||
printf("EFI framebuffer information:\n"); | printf("EFI framebuffer information:\n"); | ||||
printf("addr, size 0x%jx, 0x%jx\n", efifb.fb_addr, efifb.fb_size); | printf("addr, size 0x%jx, 0x%jx\n", efifb.fb_addr, efifb.fb_size); | ||||
printf("dimensions %d x %d\n", efifb.fb_width, efifb.fb_height); | printf("dimensions %d x %d\n", efifb.fb_width, efifb.fb_height); | ||||
printf("stride %d\n", efifb.fb_stride); | printf("stride %d\n", efifb.fb_stride); | ||||
printf("masks 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", | printf("masks 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", | ||||
efifb.fb_mask_red, efifb.fb_mask_green, efifb.fb_mask_blue, | efifb.fb_mask_red, efifb.fb_mask_green, efifb.fb_mask_blue, | ||||
efifb.fb_mask_reserved); | efifb.fb_mask_reserved); | ||||
if (efifb.fb_addr != 0) | if (efifb.fb_addr != 0) | ||||
file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb); | file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb); | ||||
} | |||||
#endif | |||||
static int | |||||
bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) | |||||
{ | |||||
EFI_MEMORY_DESCRIPTOR *mm; | |||||
EFI_PHYSICAL_ADDRESS addr = 0; | |||||
EFI_STATUS status; | |||||
const char *efi_novmap; | |||||
size_t efisz; | |||||
UINTN efi_mapkey; | |||||
UINTN dsz, pages, retry, sz; | |||||
UINT32 mmver; | |||||
struct efi_map_header *efihdr; | |||||
bool do_vmap; | |||||
#if defined(__amd64__) || defined(__aarch64__) | |||||
bi_load_efifb(kfp); | |||||
#endif | #endif | ||||
do_vmap = true; | do_vmap = true; | ||||
efi_novmap = getenv("efi_disable_vmap"); | efi_novmap = getenv("efi_disable_vmap"); | ||||
if (efi_novmap != NULL) | if (efi_novmap != NULL) | ||||
do_vmap = strcasecmp(efi_novmap, "YES") != 0; | do_vmap = strcasecmp(efi_novmap, "YES") != 0; | ||||
efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; | efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; | ||||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |