Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/vmbus/hyperv.c
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | if (!hyperv_identify()) { | ||||
if (vm_guest == VM_GUEST_HV) | if (vm_guest == VM_GUEST_HV) | ||||
vm_guest = VM_GUEST_VM; | vm_guest = VM_GUEST_VM; | ||||
return; | return; | ||||
} | } | ||||
/* Set guest id */ | /* Set guest id */ | ||||
wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); | wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); | ||||
} | |||||
SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, | |||||
NULL); | |||||
static void | |||||
hyperv_tc_init(void *arg __unused) | |||||
{ | |||||
if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { | if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { | ||||
/* Register Hyper-V timecounter */ | /* | ||||
* Register Hyper-V timecounter. This should be done as early | |||||
* as possible to let DELAY() work, since the 8254 PIT is not | |||||
* reliably emulated or even available. | |||||
*/ | |||||
tc_init(&hyperv_timecounter); | tc_init(&hyperv_timecounter); | ||||
/* | /* | ||||
* Install 64 bits timecounter method for other modules | * Install 64 bits timecounter method for other modules | ||||
* to use. | * to use. | ||||
*/ | */ | ||||
hyperv_tc64 = hyperv_tc64_rdmsr; | hyperv_tc64 = hyperv_tc64_rdmsr; | ||||
} | } | ||||
} | } | ||||
SYSINIT(hyperv_tc_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, hyperv_tc_init, NULL); | SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, | ||||
NULL); | |||||
static void | static void | ||||
hypercall_memfree(void) | hypercall_memfree(void) | ||||
{ | { | ||||
kmem_free((vm_offset_t)hypercall_context.hc_addr, PAGE_SIZE); | kmem_free((vm_offset_t)hypercall_context.hc_addr, PAGE_SIZE); | ||||
hypercall_context.hc_addr = NULL; | hypercall_context.hc_addr = NULL; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |