Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/powerpc/interrupt.c
Show All 26 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
/* | /* | ||||
* Interrupts are dispatched to here from locore asm | * Interrupts are dispatched to here from locore asm | ||||
*/ | */ | ||||
#include "opt_hwpmc_hooks.h" | #include "opt_hwpmc_hooks.h" | ||||
#include "opt_platform.h" | |||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/interrupt.h> | #include <sys/interrupt.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
Show All 20 Lines | |||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#include <machine/psl.h> | #include <machine/psl.h> | ||||
#include <machine/trap.h> | #include <machine/trap.h> | ||||
#include <machine/spr.h> | #include <machine/spr.h> | ||||
#include <machine/sr.h> | #include <machine/sr.h> | ||||
#include "pic_if.h" | #include "pic_if.h" | ||||
#ifdef POWERNV | |||||
int (*hmi_handler)(struct trapframe *); | |||||
#endif | |||||
/* | /* | ||||
* A very short dispatch, to try and maximise assembler code use | * A very short dispatch, to try and maximise assembler code use | ||||
* between all exception types. Maybe 'true' interrupts should go | * between all exception types. Maybe 'true' interrupts should go | ||||
* here, and the trap code can come in separately | * here, and the trap code can come in separately | ||||
*/ | */ | ||||
void | void | ||||
powerpc_interrupt(struct trapframe *framep) | powerpc_interrupt(struct trapframe *framep) | ||||
{ | { | ||||
Show All 33 Lines | #ifdef HWPMC_HOOKS | ||||
case EXC_PERF: | case EXC_PERF: | ||||
critical_enter(); | critical_enter(); | ||||
KASSERT(pmc_intr != NULL, ("Performance exception, but no handler!")); | KASSERT(pmc_intr != NULL, ("Performance exception, but no handler!")); | ||||
(*pmc_intr)(framep); | (*pmc_intr)(framep); | ||||
if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) | if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) | ||||
pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, framep); | pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, framep); | ||||
critical_exit(); | critical_exit(); | ||||
break; | break; | ||||
#endif | |||||
#ifdef POWERNV | |||||
case EXC_HMI: | |||||
if (hmi_handler != 0 && hmi_handler(framep) == 0) | |||||
break; | |||||
/* If no handler, or failure to handle, just drop to trap. */ | |||||
#endif | #endif | ||||
default: | default: | ||||
/* Re-enable interrupts if applicable. */ | /* Re-enable interrupts if applicable. */ | ||||
ee = framep->srr1 & PSL_EE; | ee = framep->srr1 & PSL_EE; | ||||
if (ee != 0) | if (ee != 0) | ||||
mtmsr(mfmsr() | ee); | mtmsr(mfmsr() | ee); | ||||
trap(framep); | trap(framep); | ||||
} | } | ||||
} | } |