Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/xen/pv.c
Show First 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | xen_pvh_parse_symtab(void) | ||||
if ((ksymtab == 0 || kstrtab == 0) && isxen()) | if ((ksymtab == 0 || kstrtab == 0) && isxen()) | ||||
xc_printf( | xc_printf( | ||||
"Unable to load ELF symtab: could not find symtab or strtab\n"); | "Unable to load ELF symtab: could not find symtab or strtab\n"); | ||||
} | } | ||||
#endif | #endif | ||||
static void | static void | ||||
fixup_console(caddr_t kmdp) | fixup_console(void) | ||||
{ | { | ||||
struct xen_platform_op op = { | struct xen_platform_op op = { | ||||
.cmd = XENPF_get_dom0_console, | .cmd = XENPF_get_dom0_console, | ||||
}; | }; | ||||
xenpf_dom0_console_t *console = &op.u.dom0_console; | xenpf_dom0_console_t *console = &op.u.dom0_console; | ||||
union { | union { | ||||
struct efi_fb efi; | struct efi_fb efi; | ||||
struct vbe_fb vbe; | struct vbe_fb vbe; | ||||
} *fb = NULL; | } *fb = NULL; | ||||
int size; | int size; | ||||
caddr_t kmdp; | |||||
kmdp = preload_search_by_type("elf kernel"); | |||||
if (kmdp == NULL) | |||||
kmdp = preload_search_by_type("elf64 kernel"); | |||||
if (kmdp == NULL) { | |||||
xc_printf("Unable to find kernel metadata\n"); | |||||
return; | |||||
} | |||||
size = HYPERVISOR_platform_op(&op); | size = HYPERVISOR_platform_op(&op); | ||||
if (size < 0) { | if (size < 0) { | ||||
xc_printf("Failed to get dom0 video console info: %d\n", size); | xc_printf("Failed to get video console info: %d\n", size); | ||||
return; | return; | ||||
} | } | ||||
switch (console->video_type) { | switch (console->video_type) { | ||||
case XEN_VGATYPE_VESA_LFB: | case XEN_VGATYPE_VESA_LFB: | ||||
fb = (__typeof__ (fb))preload_search_info(kmdp, | fb = (__typeof__ (fb))preload_search_info(kmdp, | ||||
MODINFO_METADATA | MODINFOMD_VBE_FB); | MODINFO_METADATA | MODINFOMD_VBE_FB); | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | if (envp != NULL) | ||||
envp += off; | envp += off; | ||||
xen_pvh_set_env(envp, reject_option); | xen_pvh_set_env(envp, reject_option); | ||||
if (MD_FETCH(kmdp, MODINFOMD_EFI_MAP, void *) != NULL) | if (MD_FETCH(kmdp, MODINFOMD_EFI_MAP, void *) != NULL) | ||||
strlcpy(bootmethod, "UEFI", sizeof(bootmethod)); | strlcpy(bootmethod, "UEFI", sizeof(bootmethod)); | ||||
else | else | ||||
strlcpy(bootmethod, "BIOS", sizeof(bootmethod)); | strlcpy(bootmethod, "BIOS", sizeof(bootmethod)); | ||||
fixup_console(kmdp); | fixup_console(); | ||||
} else { | } else { | ||||
/* Parse the extra boot information given by Xen */ | /* Parse the extra boot information given by Xen */ | ||||
if (start_info->cmdline_paddr != 0) | if (start_info->cmdline_paddr != 0) | ||||
boot_parse_cmdline_delim( | boot_parse_cmdline_delim( | ||||
(char *)(start_info->cmdline_paddr + KERNBASE), | (char *)(start_info->cmdline_paddr + KERNBASE), | ||||
", \t\n"); | ", \t\n"); | ||||
kmdp = NULL; | kmdp = NULL; | ||||
strlcpy(bootmethod, "PVH", sizeof(bootmethod)); | strlcpy(bootmethod, "PVH", sizeof(bootmethod)); | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |