X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Farch%2Fx86%2Flib.c;h=b732f75fec3582c9e0ad712d5c675089f076029c;hb=be5123fe1f4aa66b76ce8ef589362ad21b6bbf72;hp=6b3d72281a23012c9c4bb85ac6b78117a57f9f12;hpb=d5ba2e6250feee1c3a30c0b40ec03f3d9d77fb56;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/arch/x86/lib.c b/KernelLand/Kernel/arch/x86/lib.c index 6b3d7228..b732f75f 100644 --- a/KernelLand/Kernel/arch/x86/lib.c +++ b/KernelLand/Kernel/arch/x86/lib.c @@ -85,6 +85,12 @@ void SHORTLOCK(struct sShortSpinlock *Lock) __ASM__ ("pushf;\n\tpop %0" : "=r"(IF)); IF &= 0x200; // AND out all but the interrupt flag + if( CPU_HAS_LOCK(Lock) ) + { + Panic("Double lock of %p, %p req, %p has", Lock, __builtin_return_address(0), Lock->LockedBy); + for(;;); + } + #if TRACE_LOCKS if( TRACE_LOCK_COND ) { @@ -98,6 +104,7 @@ void SHORTLOCK(struct sShortSpinlock *Lock) // Wait for another CPU to release __AtomicTestSetLoop( (Uint*)&Lock->Lock, cpu ); Lock->IF = IF; + Lock->LockedBy = __builtin_return_address(0); #if TRACE_LOCKS if( TRACE_LOCK_COND )