summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-06-10 16:14:05 +0000
committermav <mav@FreeBSD.org>2010-06-10 16:14:05 +0000
commitb8bbab8130e4fa97a4817c591bac675626df8a60 (patch)
treeb396ba8b1adb4cea72896ed76ff77fe71a922935 /sys/kern
parent970bcaaade62f997fe73cc23cab599c5b941ce93 (diff)
downloadFreeBSD-src-b8bbab8130e4fa97a4817c591bac675626df8a60.zip
FreeBSD-src-b8bbab8130e4fa97a4817c591bac675626df8a60.tar.gz
Store interrupt trap frame into struct thread. It allows interrupt handler
to obtain both trap frame and opaque argument submitted on registrction. After kernel and all drivers get used to it, legacy hack can be removed. Reviewed by: jhb@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_intr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 105ea18..2ebb056 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -1347,6 +1347,7 @@ int
intr_event_handle(struct intr_event *ie, struct trapframe *frame)
{
struct intr_handler *ih;
+ struct trapframe *oldframe;
struct thread *td;
int error, ret, thread;
@@ -1366,6 +1367,8 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame)
thread = 0;
ret = 0;
critical_enter();
+ oldframe = td->td_intr_frame;
+ td->td_intr_frame = frame;
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
if (ih->ih_filter == NULL) {
thread = 1;
@@ -1403,6 +1406,7 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame)
thread = 1;
}
}
+ td->td_intr_frame = oldframe;
if (thread) {
if (ie->ie_pre_ithread != NULL)
@@ -1592,6 +1596,7 @@ int
intr_event_handle(struct intr_event *ie, struct trapframe *frame)
{
struct intr_thread *ithd;
+ struct trapframe *oldframe;
struct thread *td;
int thread;
@@ -1604,6 +1609,8 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame)
td->td_intr_nesting_level++;
thread = 0;
critical_enter();
+ oldframe = td->td_intr_frame;
+ td->td_intr_frame = frame;
thread = intr_filter_loop(ie, frame, &ithd);
if (thread & FILTER_HANDLED) {
if (ie->ie_post_filter != NULL)
@@ -1612,6 +1619,7 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame)
if (ie->ie_pre_ithread != NULL)
ie->ie_pre_ithread(ie->ie_source);
}
+ td->td_intr_frame = oldframe;
critical_exit();
/* Interrupt storm logic */
OpenPOWER on IntegriCloud