python: Move more code into m5.util allow SCons to use that code.
[gem5.git] / src / dev / x86 / i8254.hh
index 9528013c81bc1732bf3eceafd930fab4b5c290cf..7de20dfd4a06fc313b1de1e31d61b81e76a33bbc 100644 (file)
 namespace X86ISA
 {
 
-class IntPin;
+class IntSourcePin;
 
 class I8254 : public BasicPioDevice
 {
   protected:
     Tick latency;
-    Intel8254Timer pit;
+    class X86Intel8254Timer : public Intel8254Timer
+    {
+      protected:
+        I8254 * parent;
+
+        void
+        counterInterrupt(unsigned int num)
+        {
+            parent->counterInterrupt(num);
+        }
+
+      public:
+        X86Intel8254Timer(const std::string &name, I8254 * _parent) :
+            Intel8254Timer(_parent, name), parent(_parent)
+        {}
+    };
+
+    
+    X86Intel8254Timer pit;
 
-    IntPin *intPin;
+    IntSourcePin *intPin;
+    
+    void counterInterrupt(unsigned int num);
 
   public:
     typedef I8254Params Params;
@@ -58,7 +78,7 @@ class I8254 : public BasicPioDevice
     }
 
     I8254(Params *p) : BasicPioDevice(p), latency(p->pio_latency),
-            pit(this, p->name), intPin(p->int_pin)
+            pit(p->name, this), intPin(p->int_pin)
     {
         pioSize = 4;
     }