diff options
Diffstat (limited to 'i386')
-rw-r--r-- | i386/i386/locore.S | 14 | ||||
-rw-r--r-- | i386/i386/mp_desc.c | 8 |
2 files changed, 19 insertions, 3 deletions
diff --git a/i386/i386/locore.S b/i386/i386/locore.S index 55add6e4..cb0f063b 100644 --- a/i386/i386/locore.S +++ b/i386/i386/locore.S @@ -701,12 +701,20 @@ ENTRY(all_intrs) TIME_INT_ENTRY /* do timing */ #endif - call EXT(interrupt) /* call generic interrupt routine */ +#ifdef MACH_LDEBUG + CPU_NUMBER(%ecx) + incl CX(EXT(in_interrupt),%ecx) +#endif - .globl EXT(return_to_iret) -LEXT(return_to_iret) /* ( label for kdb_kintr and hardclock) */ + call EXT(interrupt) /* call generic interrupt routine */ + .globl EXT(return_to_iret) /* ( label for kdb_kintr and hardclock */ +LEXT(return_to_iret) /* to find the return from calling interrupt) */ CPU_NUMBER(%edx) +#ifdef MACH_LDEBUG + decl CX(EXT(in_interrupt),%edx) +#endif + #if STAT_TIME #else TIME_INT_EXIT /* do timing */ diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c index fa66aa44..88fbb50a 100644 --- a/i386/i386/mp_desc.c +++ b/i386/i386/mp_desc.c @@ -67,6 +67,14 @@ vm_offset_t int_stack_top[NCPUS]; vm_offset_t int_stack_base[NCPUS]; +/* + * Whether we are currently handling an interrupt. + * To catch code erroneously taking non-irq-safe locks. + */ +#ifdef MACH_LDEBUG +unsigned long in_interrupt[NCPUS]; +#endif + /* Interrupt stack allocation */ uint8_t solid_intstack[NCPUS*INTSTACK_SIZE] __aligned(NCPUS*INTSTACK_SIZE); |