X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Farch%2Fx86%2Flib.c;h=b732f75fec3582c9e0ad712d5c675089f076029c;hb=8c23fb908ad7ad37472ed83e0753bdfbab19ae13;hp=175f9a5550f5cde85acfb9b070968b9bedfcab48;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/arch/x86/lib.c b/KernelLand/Kernel/arch/x86/lib.c index 175f9a55..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 ) @@ -177,8 +184,8 @@ void Debug_PutCharDebug(char ch) if(!gbDebug_SerialSetup) { outb(SERIAL_PORT + 1, 0x00); // Disable all interrupts outb(SERIAL_PORT + 3, 0x80); // Enable DLAB (set baud rate divisor) - outb(SERIAL_PORT + 0, 0x0C); // Set divisor to 12 (lo byte) 9600 baud - outb(SERIAL_PORT + 1, 0x00); // (hi byte) + outb(SERIAL_PORT + 0, 0x01); // Set divisor to 1 (lo byte) - 115200 baud + outb(SERIAL_PORT + 1, 0x00); // (hi byte) outb(SERIAL_PORT + 3, 0x03); // 8 bits, no parity, one stop bit outb(SERIAL_PORT + 2, 0xC7); // Enable FIFO with 14-byte threshold and clear it outb(SERIAL_PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set