x86: changes to apic, keyboard
authorNilay Vaish <nilay@cs.wisc.edu>
Thu, 28 Mar 2013 14:34:23 +0000 (09:34 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Thu, 28 Mar 2013 14:34:23 +0000 (09:34 -0500)
It is possible that operating system wants to shutdown the
lapic timer by writing timer's initial count to 0. This patch
adds a check that the timer event is only scheduled if the
count is 0.

The patch also converts few of the panics related to the keyboard
to warnings since we are any way not interested in simulating the
keyboard.

src/arch/x86/interrupts.cc
src/dev/x86/i8042.cc

index 9983d7305e2a8c81def27fa35de05fc80856a04c..ad9d483c731b2bb0bfa811fab39a51342d7a2335 100644 (file)
@@ -597,9 +597,10 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val)
                            curTick() + (newCount + 1) *
                            clockPeriod() - offset, true);
             } else {
-                reschedule(apicTimerEvent,
-                           curTick() + newCount *
-                           clockPeriod(), true);
+                if (newCount)
+                    reschedule(apicTimerEvent,
+                               curTick() + newCount *
+                               clockPeriod(), true);
             }
         }
         break;
index 1fc50db15f290950b3df9d6e4555275d10586a3f..c0bd34ad2e40523599c627b1a5cffe646b6cb4d2 100644 (file)
@@ -411,10 +411,12 @@ X86ISA::I8042::write(PacketPtr pkt)
           case ReadOutputPort:
             panic("i8042 \"Read output port\" command not implemented.\n");
           case WriteOutputPort:
-            panic("i8042 \"Write output port\" command not implemented.\n");
+            warn("i8042 \"Write output port\" command not implemented.\n");
+            lastCommand = WriteOutputPort;
           case WriteKeyboardOutputBuff:
-            panic("i8042 \"Write keyboard output buffer\" "
+            warn("i8042 \"Write keyboard output buffer\" "
                     "command not implemented.\n");
+            lastCommand = WriteKeyboardOutputBuff;
           case WriteMouseOutputBuff:
             DPRINTF(I8042, "Got command to write to mouse output buffer.\n");
             lastCommand = WriteMouseOutputBuff;
@@ -432,7 +434,7 @@ X86ISA::I8042::write(PacketPtr pkt)
           case SystemReset:
             panic("i8042 \"System reset\" command not implemented.\n");
           default:
-            panic("Write to unknown i8042 "
+            warn("Write to unknown i8042 "
                     "(keyboard controller) command port.\n");
         }
     } else {