Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/vmbus/hv_connection.c
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | hv_vmbus_on_events(int cpu) | ||||
int rel_id; | int rel_id; | ||||
int maxdword; | int maxdword; | ||||
hv_vmbus_synic_event_flags *event; | hv_vmbus_synic_event_flags *event; | ||||
/* int maxdword = PAGE_SIZE >> 3; */ | /* int maxdword = PAGE_SIZE >> 3; */ | ||||
KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " | KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " | ||||
"cpu out of range!")); | "cpu out of range!")); | ||||
page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu]; | |||||
event = (hv_vmbus_synic_event_flags *) | |||||
page_addr + HV_VMBUS_MESSAGE_SINT; | |||||
if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || | if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || | ||||
(hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { | (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { | ||||
maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5; | maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5; | ||||
/* | /* | ||||
* receive size is 1/2 page and divide that by 4 bytes | * receive size is 1/2 page and divide that by 4 bytes | ||||
*/ | */ | ||||
if (synch_test_and_clear_bit(0, &event->flags32[0])) | |||||
recv_interrupt_page = | recv_interrupt_page = | ||||
hv_vmbus_g_connection.recv_interrupt_page; | hv_vmbus_g_connection.recv_interrupt_page; | ||||
} else { | } else { | ||||
/* | /* | ||||
* On Host with Win8 or above, the event page can be | * On Host with Win8 or above, the event page can be | ||||
* checked directly to get the id of the channel | * checked directly to get the id of the channel | ||||
* that has the pending interrupt. | * that has the pending interrupt. | ||||
*/ | */ | ||||
maxdword = HV_EVENT_FLAGS_DWORD_COUNT; | maxdword = HV_EVENT_FLAGS_DWORD_COUNT; | ||||
page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu]; | |||||
event = (hv_vmbus_synic_event_flags *) | |||||
page_addr + HV_VMBUS_MESSAGE_SINT; | |||||
recv_interrupt_page = event->flags32; | recv_interrupt_page = event->flags32; | ||||
} | } | ||||
/* | /* | ||||
* Check events | * Check events | ||||
*/ | */ | ||||
if (recv_interrupt_page != NULL) { | if (recv_interrupt_page != NULL) { | ||||
for (dword = 0; dword < maxdword; dword++) { | for (dword = 0; dword < maxdword; dword++) { | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |