/* * External input interrupt routine */ void powerpc_extr_interrupt(struct trapframe *framep) { critical_enter(); PIC_DISPATCH(root_pic, framep); critical_exit(); framep->srr1 &= ~PSL_WE; }
/* * A very short dispatch, to try and maximise assembler code use * between all exception types. Maybe 'true' interrupts should go * here, and the trap code can come in separately */ void powerpc_interrupt(struct trapframe *framep) { struct thread *td; struct trapframe *oldframe; register_t ee; td = curthread; CTR2(KTR_INTR, "%s: EXC=%x", __func__, framep->exc); switch (framep->exc) { case EXC_EXI: critical_enter(); PIC_DISPATCH(root_pic, framep); critical_exit(); break; case EXC_DECR: critical_enter(); atomic_add_int(&td->td_intr_nesting_level, 1); oldframe = td->td_intr_frame; td->td_intr_frame = framep; decr_intr(framep); td->td_intr_frame = oldframe; atomic_subtract_int(&td->td_intr_nesting_level, 1); critical_exit(); break; #ifdef HWPMC_HOOKS case EXC_PERF: critical_enter(); KASSERT(pmc_intr != NULL, ("Performance exception, but no handler!")); (*pmc_intr)(PCPU_GET(cpuid), framep); if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, framep); critical_exit(); break; #endif default: /* Re-enable interrupts if applicable. */ ee = framep->srr1 & PSL_EE; if (ee != 0) mtmsr(mfmsr() | ee); trap(framep); } }
/* * A very short dispatch, to try and maximise assembler code use * between all exception types. Maybe 'true' interrupts should go * here, and the trap code can come in separately */ void powerpc_interrupt(struct trapframe *framep) { struct thread *td; struct trapframe *oldframe; register_t ee; td = curthread; CTR2(KTR_INTR, "%s: EXC=%x", __func__, framep->exc); switch (framep->exc) { case EXC_EXI: critical_enter(); PIC_DISPATCH(root_pic, framep); critical_exit(); break; case EXC_DECR: critical_enter(); atomic_add_int(&td->td_intr_nesting_level, 1); oldframe = td->td_intr_frame; td->td_intr_frame = framep; decr_intr(framep); td->td_intr_frame = oldframe; atomic_subtract_int(&td->td_intr_nesting_level, 1); critical_exit(); break; default: /* Re-enable interrupts if applicable. */ ee = framep->srr1 & PSL_EE; if (ee != 0) mtmsr(mfmsr() | ee); trap(framep); } }