Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/xen/pv.c
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
extern u_int64_t hammer_time(u_int64_t, u_int64_t); | extern u_int64_t hammer_time(u_int64_t, u_int64_t); | ||||
/* Xen initial function */ | /* Xen initial function */ | ||||
uint64_t hammer_time_xen(vm_paddr_t); | uint64_t hammer_time_xen(vm_paddr_t); | ||||
#define MAX_E820_ENTRIES 128 | #define MAX_E820_ENTRIES 128 | ||||
/*--------------------------- Forward Declarations ---------------------------*/ | /*--------------------------- Forward Declarations ---------------------------*/ | ||||
static caddr_t xen_pvh_parse_preload_data(uint64_t); | static caddr_t xen_pvh_parse_preload_data(uint64_t); | ||||
static void xen_pvh_parse_memmap(caddr_t, vm_paddr_t *, int *); | static void xen_pvh_parse_memmap(caddr_t); | ||||
/*---------------------------- Extern Declarations ---------------------------*/ | /*---------------------------- Extern Declarations ---------------------------*/ | ||||
/* | /* | ||||
* Placed by the linker at the end of the bss section, which is the last | * Placed by the linker at the end of the bss section, which is the last | ||||
* section loaded by Xen before loading the symtab and strtab. | * section loaded by Xen before loading the symtab and strtab. | ||||
*/ | */ | ||||
extern uint32_t end; | extern uint32_t end; | ||||
▲ Show 20 Lines • Show All 281 Lines • ▼ Show 20 Lines | |||||
#ifdef DDB | #ifdef DDB | ||||
xen_pvh_parse_symtab(); | xen_pvh_parse_symtab(); | ||||
#endif | #endif | ||||
return (kmdp); | return (kmdp); | ||||
} | } | ||||
static void | static void | ||||
xen_pvh_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) | xen_pvh_parse_memmap(caddr_t kmdp) | ||||
{ | { | ||||
struct xen_memory_map memmap; | struct xen_memory_map memmap; | ||||
u_int32_t size; | u_int32_t size; | ||||
int rc; | int rc; | ||||
/* Fetch the E820 map from Xen */ | /* Fetch the E820 map from Xen */ | ||||
memmap.nr_entries = MAX_E820_ENTRIES; | memmap.nr_entries = MAX_E820_ENTRIES; | ||||
set_xen_guest_handle(memmap.buffer, xen_smap); | set_xen_guest_handle(memmap.buffer, xen_smap); | ||||
rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); | rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); | ||||
if (rc) { | if (rc) { | ||||
xc_printf("ERROR: unable to fetch Xen E820 memory map: %d\n", | xc_printf("ERROR: unable to fetch Xen E820 memory map: %d\n", | ||||
rc); | rc); | ||||
HYPERVISOR_shutdown(SHUTDOWN_crash); | HYPERVISOR_shutdown(SHUTDOWN_crash); | ||||
} | } | ||||
size = memmap.nr_entries * sizeof(xen_smap[0]); | size = memmap.nr_entries * sizeof(xen_smap[0]); | ||||
bios_add_smap_entries(xen_smap, size, physmap, physmap_idx); | bios_add_smap_entries(xen_smap, size); | ||||
} | } |