]> Joshua Wise's Git repositories - netwatch.git/blobdiff - aseg/counter.c
Add locks from time to time.
[netwatch.git] / aseg / counter.c
index d6208d6545f753bfe6079f5ae031c1b150cdc25b..ab200c107c8c73e441c7ba9211a72688a80e70b4 100644 (file)
@@ -22,10 +22,8 @@ static void cause_kbd_irq()
        while (inb(0x64) & 0x1)
                inb(0x60);
        outb(0x60, 0xee);       /* Cause an IRQ. */
-       while (!(inb(0x64) & 0x1))
+       while (inb(0x60) != 0xEE)
                ;
-       while (inb(0x64) & 0x1)
-               inb(0x60);
 }
 
 void pci_dump() {
@@ -62,7 +60,8 @@ void pci_dump() {
                        {
                                b = kbd_get_injected_scancode();
                                lastctr = counter;
-                               inb(0x60);
+                               while (inb(0x64) & 0x1)
+                                       inb(0x60);
                        } else
                                b = inb(0x60);
                        if ((curdev == 0) && (b == 0x01)) {     /* Escape */
@@ -94,6 +93,7 @@ void pci_dump() {
                dolog("Unhandled PCI cycle");
        }
        
+       outl(0x840, 0x0);
        outl(0x844, 0x1000);
        outl(0x848, 0x1000);
 }
This page took 0.02619 seconds and 4 git commands to generate.