Kernel/x86 - (minor) Cleaned up debug in VM8086
[tpg/acess2.git] / KernelLand / Kernel / arch / x86 / lib.c
index 175f9a5..b732f75 100644 (file)
@@ -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

UCC git Repository :: git.ucc.asn.au