Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/xen/xen_arch_intr.c
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
#include <x86/apicvar.h> | #include <x86/apicvar.h> | ||||
/************************ Xen x86 interrupt interface ************************/ | /************************ Xen x86 interrupt interface ************************/ | ||||
/* | /* | ||||
* Pointers to the interrupt counters | * Pointers to the interrupt counters | ||||
*/ | */ | ||||
DPCPU_DEFINE_STATIC(u_long *, pintrcnt); | DPCPU_DEFINE_STATIC(struct intr_event *, counters); | ||||
/** | /** | ||||
* Allocate and register a per-cpu Xen upcall interrupt counter. | * Allocate and register a per-cpu Xen upcall interrupt counter. | ||||
* | * | ||||
* \param cpu The cpu for which to register this interrupt count. | * \param cpu The cpu for which to register this interrupt count. | ||||
*/ | */ | ||||
static void | static void | ||||
xen_intr_intrcnt_add(const u_int cpu) | xen_intr_intrcnt_add(const u_int cpu) | ||||
{ | { | ||||
char buf[MAXCOMLEN + 1]; | struct intr_event **ppevent; | ||||
u_long **ppintrcnt; | |||||
ppintrcnt = DPCPU_ID_PTR(cpu, pintrcnt); | ppevent = DPCPU_ID_PTR(cpu, counters); | ||||
if (ppintrcnt != NULL) | if (ppevent != NULL) | ||||
return; | return; | ||||
snprintf(buf, sizeof(buf), "cpu%d:xen", cpu); | INTRCNT_ADD(ppevent, "cpu%d:xen", cpu); | ||||
intrcnt_add(buf, ppintrcnt); | |||||
} | } | ||||
static void | static void | ||||
xen_intrcnt_init(void *dummy __unused) | xen_intrcnt_init(void *dummy __unused) | ||||
{ | { | ||||
unsigned int i; | unsigned int i; | ||||
if (!xen_domain()) | if (!xen_domain()) | ||||
Show All 19 Lines | xen_arch_intr_handle_upcall(struct trapframe *trap_frame) | ||||
struct trapframe *old; | struct trapframe *old; | ||||
/* | /* | ||||
* Disable preemption in order to always check and fire events | * Disable preemption in order to always check and fire events | ||||
* on the right vCPU | * on the right vCPU | ||||
*/ | */ | ||||
critical_enter(); | critical_enter(); | ||||
++*DPCPU_GET(pintrcnt); | ++DPCPU_GET(counters)->ie_intrcnt; | ||||
old = curthread->td_intr_frame; | old = curthread->td_intr_frame; | ||||
curthread->td_intr_frame = trap_frame; | curthread->td_intr_frame = trap_frame; | ||||
xen_intr_handle_upcall(NULL); | xen_intr_handle_upcall(NULL); | ||||
curthread->td_intr_frame = old; | curthread->td_intr_frame = old; | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |