Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/mp_x86.c
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
void *bootstacks[MAXCPU]; | void *bootstacks[MAXCPU]; | ||||
void *dpcpu; | void *dpcpu; | ||||
struct pcb stoppcbs[MAXCPU]; | struct pcb stoppcbs[MAXCPU]; | ||||
struct susppcb **susppcbs; | struct susppcb **susppcbs; | ||||
#ifdef COUNT_IPIS | #ifdef COUNT_IPIS | ||||
/* Interrupt counts. */ | /* Interrupt counts. */ | ||||
static u_long *ipi_preempt_counts[MAXCPU]; | static struct intr_event *ipi_preempt_counts[MAXCPU]; | ||||
static u_long *ipi_ast_counts[MAXCPU]; | static struct intr_event *ipi_ast_counts[MAXCPU]; | ||||
u_long *ipi_invltlb_counts[MAXCPU]; | struct intr_event *ipi_invltlb_counts[MAXCPU]; | ||||
u_long *ipi_invlrng_counts[MAXCPU]; | struct intr_event *ipi_invlrng_counts[MAXCPU]; | ||||
u_long *ipi_invlpg_counts[MAXCPU]; | struct intr_event *ipi_invlpg_counts[MAXCPU]; | ||||
u_long *ipi_invlcache_counts[MAXCPU]; | struct intr_event *ipi_invlcache_counts[MAXCPU]; | ||||
u_long *ipi_rendezvous_counts[MAXCPU]; | struct intr_event *ipi_rendezvous_counts[MAXCPU]; | ||||
static u_long *ipi_hardclock_counts[MAXCPU]; | static struct intr_event *ipi_hardclock_counts[MAXCPU]; | ||||
#endif | #endif | ||||
/* Default cpu_ops implementation. */ | /* Default cpu_ops implementation. */ | ||||
struct cpu_ops cpu_ops; | struct cpu_ops cpu_ops; | ||||
/* | /* | ||||
* Local data and functions. | * Local data and functions. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,214 Lines • ▼ Show 20 Lines | ipi_bitmap_handler(struct trapframe frame) | ||||
oldframe = td->td_intr_frame; | oldframe = td->td_intr_frame; | ||||
td->td_intr_frame = &frame; | td->td_intr_frame = &frame; | ||||
#if defined(STACK) || defined(DDB) | #if defined(STACK) || defined(DDB) | ||||
if (ipi_bitmap & (1 << IPI_TRACE)) | if (ipi_bitmap & (1 << IPI_TRACE)) | ||||
stack_capture_intr(); | stack_capture_intr(); | ||||
#endif | #endif | ||||
if (ipi_bitmap & (1 << IPI_PREEMPT)) { | if (ipi_bitmap & (1 << IPI_PREEMPT)) { | ||||
#ifdef COUNT_IPIS | #ifdef COUNT_IPIS | ||||
(*ipi_preempt_counts[cpu])++; | ipi_preempt_counts[cpu]->ie_intrcnt++; | ||||
#endif | #endif | ||||
sched_preempt(td); | sched_preempt(td); | ||||
} | } | ||||
if (ipi_bitmap & (1 << IPI_AST)) { | if (ipi_bitmap & (1 << IPI_AST)) { | ||||
#ifdef COUNT_IPIS | #ifdef COUNT_IPIS | ||||
(*ipi_ast_counts[cpu])++; | ipi_ast_counts[cpu]->ie_intrcnt++; | ||||
#endif | #endif | ||||
/* Nothing to do for AST */ | /* Nothing to do for AST */ | ||||
} | } | ||||
if (ipi_bitmap & (1 << IPI_HARDCLOCK)) { | if (ipi_bitmap & (1 << IPI_HARDCLOCK)) { | ||||
#ifdef COUNT_IPIS | #ifdef COUNT_IPIS | ||||
(*ipi_hardclock_counts[cpu])++; | ipi_hardclock_counts[cpu]->ie_intrcnt++; | ||||
#endif | #endif | ||||
hardclockintr(); | hardclockintr(); | ||||
} | } | ||||
td->td_intr_frame = oldframe; | td->td_intr_frame = oldframe; | ||||
td->td_intr_nesting_level--; | td->td_intr_nesting_level--; | ||||
if (ipi_bitmap & (1 << IPI_HARDCLOCK)) | if (ipi_bitmap & (1 << IPI_HARDCLOCK)) | ||||
critical_exit(); | critical_exit(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static void | static void | ||||
mp_ipi_intrcnt(void *dummy) | mp_ipi_intrcnt(void *dummy) | ||||
{ | { | ||||
char buf[64]; | char buf[64]; | ||||
int i; | int i; | ||||
CPU_FOREACH(i) { | CPU_FOREACH(i) { | ||||
snprintf(buf, sizeof(buf), "cpu%d:invltlb", i); | INTRCNT_ADD(ipi_invltlb_counts + i, "cpu%d:invltlb", i); | ||||
intrcnt_add(buf, &ipi_invltlb_counts[i]); | INTRCNT_ADD(ipi_invlrng_counts + i, "cpu%d:invlrng", i); | ||||
snprintf(buf, sizeof(buf), "cpu%d:invlrng", i); | INTRCNT_ADD(ipi_invlpg_counts + i, "cpu%d:invlpg", i); | ||||
intrcnt_add(buf, &ipi_invlrng_counts[i]); | INTRCNT_ADD(ipi_invlcache_counts + i, "cpu%d:invlcache", i); | ||||
snprintf(buf, sizeof(buf), "cpu%d:invlpg", i); | INTRCNT_ADD(ipi_preempt_counts + i, "cpu%d:preempt", i); | ||||
intrcnt_add(buf, &ipi_invlpg_counts[i]); | INTRCNT_ADD(ipi_ast_counts + i, "cpu%d:ast", i); | ||||
snprintf(buf, sizeof(buf), "cpu%d:invlcache", i); | INTRCNT_ADD(ipi_rendezvous_counts + i, "cpu%d:rendezvous", i); | ||||
intrcnt_add(buf, &ipi_invlcache_counts[i]); | INTRCNT_ADD(ipi_hardclock_counts + i, "cpu%d:hardclock", i); | ||||
snprintf(buf, sizeof(buf), "cpu%d:preempt", i); | |||||
intrcnt_add(buf, &ipi_preempt_counts[i]); | |||||
snprintf(buf, sizeof(buf), "cpu%d:ast", i); | |||||
intrcnt_add(buf, &ipi_ast_counts[i]); | |||||
snprintf(buf, sizeof(buf), "cpu%d:rendezvous", i); | |||||
intrcnt_add(buf, &ipi_rendezvous_counts[i]); | |||||
snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); | |||||
intrcnt_add(buf, &ipi_hardclock_counts[i]); | |||||
} | } | ||||
} | } | ||||
SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); | SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); | ||||
#endif | #endif |