Interrupts: Make the IO APIC go get the local APICs.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 9 Oct 2011 11:44:02 +0000 (04:44 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 9 Oct 2011 11:44:02 +0000 (04:44 -0700)
This is so they don't have to declare themselves to the IO APIC and don't have
to have a pointer to the platform object.

src/arch/x86/X86LocalApic.py
src/arch/x86/interrupts.cc
src/arch/x86/interrupts.hh
src/dev/x86/i82094aa.cc
src/dev/x86/i82094aa.hh

index cfb225240b46235a21b00b9f8fcbf0e892760d92..2f53c4e241de456044d614798598d6d76a50d651 100644 (file)
@@ -38,6 +38,3 @@ class X86LocalApic(BasicPioDevice):
     int_port = Port("Port for sending and receiving interrupt messages")
     int_latency = Param.Latency('1ns', \
             "Latency for an interrupt to propagate through this device.")
-    if buildEnv['FULL_SYSTEM']: # No platform in SE mode.
-        platform = Param.Platform(Parent.any,
-                "Platform this device is part of.")
index 55b5bdca97f3a34b620649b7dce861f495c8ddea..38b966dbe4b137e7337cd3da51c8e5d3e56a0349 100644 (file)
@@ -304,11 +304,6 @@ X86ISA::Interrupts::init()
     //
     BasicPioDevice::init();
     IntDev::init();
-#if FULL_SYSTEM
-    Pc * pc = dynamic_cast<Pc *>(platform);
-    assert(pc);
-    pc->southBridge->ioApic->registerLocalApic(initialApicId, this);
-#endif
 }
 
 
@@ -616,9 +611,6 @@ X86ISA::Interrupts::Interrupts(Params * p) :
     pendingStartup(false), startupVector(0),
     startedUp(false), pendingUnmaskableInt(false),
     pendingIPIs(0), cpu(NULL)
-#if FULL_SYSTEM
-    , platform(p->platform)
-#endif
 {
     pioSize = PageBytes;
     memset(regs, 0, sizeof(regs));
index 46e5e5cad14978a046f39e9d5b2995dabc5b11b9..03b4c97b38422c7c2660d86735d902b1cf70e5bc 100644 (file)
@@ -176,11 +176,10 @@ class Interrupts : public BasicPioDevice, IntDev
 
     int initialApicId;
 
-#if FULL_SYSTEM
-    Platform *platform;
-#endif
-
   public:
+
+    int getInitialApicId() { return initialApicId; }
+
     /*
      * Params stuff.
      */
index be7852e86f6f67d508920ef84848916561b9c5af..b864bc5c7e071d6090d8b050726503b951518ed8 100644 (file)
 
 #include "config/full_system.hh"
 
-#if FULL_SYSTEM
 #include "arch/x86/interrupts.hh"
-#endif
-
 #include "arch/x86/intmessage.hh"
+#include "cpu/base.hh"
 #include "debug/I82094AA.hh"
 #include "dev/x86/i82094aa.hh"
 #include "dev/x86/i8259.hh"
@@ -172,7 +170,6 @@ X86ISA::I82094AA::signalInterrupt(int line)
         DPRINTF(I82094AA, "Entry was masked.\n");
         return;
     } else {
-#if FULL_SYSTEM //XXX No interrupt controller in SE mode.
         TriggerIntMessage message = 0;
         message.destination = entry.dest;
         if (entry.deliveryMode == DeliveryMode::ExtInt) {
@@ -202,13 +199,11 @@ X86ISA::I82094AA::signalInterrupt(int line)
             }
         } else {
             for (int i = 0; i < numContexts; i++) {
-                std::map<int, Interrupts *>::iterator localApicIt =
-                    localApics.find(i);
-                assert(localApicIt != localApics.end());
-                Interrupts *localApic = localApicIt->second;
+                Interrupts *localApic = sys->getThreadContext(i)->
+                    getCpuPtr()->getInterruptController();
                 if ((localApic->readReg(APIC_LOGICAL_DESTINATION) >> 24) &
                         message.destination) {
-                    apics.push_back(localApicIt->first);
+                    apics.push_back(localApic->getInitialApicId());
                 }
             }
             if (message.deliveryMode == DeliveryMode::LowestPriority &&
@@ -231,7 +226,6 @@ X86ISA::I82094AA::signalInterrupt(int line)
         }
         intPort->sendMessage(apics, message,
                 sys->getMemoryMode() == Enums::timing);
-#endif
     }
 }
 
@@ -251,13 +245,6 @@ X86ISA::I82094AA::lowerInterruptPin(int number)
     pinStates[number] = false;
 }
 
-void
-X86ISA::I82094AA::registerLocalApic(int initialId, Interrupts *localApic)
-{
-    assert(localApic);
-    localApics[initialId] = localApic;
-}
-
 void
 X86ISA::I82094AA::serialize(std::ostream &os)
 {
index ae0322d940a560cd56f071f32562e2d656c1aa52..00ba2800d4a8b75a97a98aff4051018b34f4b505 100644 (file)
@@ -70,8 +70,6 @@ class I82094AA : public PioDevice, public IntDev
 
     I8259 * extIntPic;
 
-    std::map<int, Interrupts *> localApics;
-
     uint8_t regSel;
     uint8_t initialApicId;
     uint8_t id;
@@ -131,7 +129,6 @@ class I82094AA : public PioDevice, public IntDev
     void signalInterrupt(int line);
     void raiseInterruptPin(int number);
     void lowerInterruptPin(int number);
-    void registerLocalApic(int id, Interrupts *localApic);
 
     virtual void serialize(std::ostream &os);
     virtual void unserialize(Checkpoint *cp, const std::string &section);