diff options
-rw-r--r-- | sys/kern/kern_intr.c | 8 | ||||
-rw-r--r-- | sys/sys/proc.h | 1 |
2 files changed, 9 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 */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 1195019..a820aa6 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -301,6 +301,7 @@ struct thread { int td_errno; /* Error returned by last syscall. */ struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ + struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ }; struct mtx *thread_lock_block(struct thread *); |