dev: fixed bugs to extend interrupt capability beyond 15 cores
This commit is contained in:
parent
3a2d2223e1
commit
c41fc138e7
5 changed files with 38 additions and 12 deletions
|
@ -294,7 +294,14 @@ X86ISA::Interrupts::setCPU(BaseCPU * newCPU)
|
||||||
void
|
void
|
||||||
X86ISA::Interrupts::init()
|
X86ISA::Interrupts::init()
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// The local apic must register its address ranges on both its pio port
|
||||||
|
// via the basicpiodevice(piodevice) init() function and its int port
|
||||||
|
// that it inherited from IntDev. Note IntDev is not a SimObject itself.
|
||||||
|
//
|
||||||
BasicPioDevice::init();
|
BasicPioDevice::init();
|
||||||
|
IntDev::init();
|
||||||
|
|
||||||
Pc * pc = dynamic_cast<Pc *>(platform);
|
Pc * pc = dynamic_cast<Pc *>(platform);
|
||||||
assert(pc);
|
assert(pc);
|
||||||
pc->southBridge->ioApic->registerLocalApic(initialApicId, this);
|
pc->southBridge->ioApic->registerLocalApic(initialApicId, this);
|
||||||
|
|
|
@ -41,9 +41,12 @@ X86ISA::I82094AA::I82094AA(Params *p) : PioDevice(p),
|
||||||
latency(p->pio_latency), pioAddr(p->pio_addr),
|
latency(p->pio_latency), pioAddr(p->pio_addr),
|
||||||
extIntPic(p->external_int_pic), lowestPriorityOffset(0)
|
extIntPic(p->external_int_pic), lowestPriorityOffset(0)
|
||||||
{
|
{
|
||||||
// This assumes there's only one I/O APIC in the system
|
// This assumes there's only one I/O APIC in the system and since the apic
|
||||||
|
// id is stored in a 8-bit field with 0xff meaning broadcast, the id must
|
||||||
|
// be less than 0xff
|
||||||
|
|
||||||
|
assert(p->apic_id < 0xff);
|
||||||
initialApicId = id = p->apic_id;
|
initialApicId = id = p->apic_id;
|
||||||
assert(id <= 0xf);
|
|
||||||
arbId = id;
|
arbId = id;
|
||||||
regSel = 0;
|
regSel = 0;
|
||||||
RedirTableEntry entry = 0;
|
RedirTableEntry entry = 0;
|
||||||
|
@ -54,6 +57,17 @@ X86ISA::I82094AA::I82094AA(Params *p) : PioDevice(p),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
X86ISA::I82094AA::init()
|
||||||
|
{
|
||||||
|
// The io apic must register its address ranges on both its pio port
|
||||||
|
// via the piodevice init() function and its int port that it inherited
|
||||||
|
// from IntDev. Note IntDev is not a SimObject itself.
|
||||||
|
|
||||||
|
PioDevice::init();
|
||||||
|
IntDev::init();
|
||||||
|
}
|
||||||
|
|
||||||
Tick
|
Tick
|
||||||
X86ISA::I82094AA::read(PacketPtr pkt)
|
X86ISA::I82094AA::read(PacketPtr pkt)
|
||||||
{
|
{
|
||||||
|
@ -96,11 +110,11 @@ void
|
||||||
X86ISA::I82094AA::writeReg(uint8_t offset, uint32_t value)
|
X86ISA::I82094AA::writeReg(uint8_t offset, uint32_t value)
|
||||||
{
|
{
|
||||||
if (offset == 0x0) {
|
if (offset == 0x0) {
|
||||||
id = bits(value, 27, 24);
|
id = bits(value, 31, 24);
|
||||||
} else if (offset == 0x1) {
|
} else if (offset == 0x1) {
|
||||||
// The IOAPICVER register is read only.
|
// The IOAPICVER register is read only.
|
||||||
} else if (offset == 0x2) {
|
} else if (offset == 0x2) {
|
||||||
arbId = bits(value, 27, 24);
|
arbId = bits(value, 31, 24);
|
||||||
} else if (offset >= 0x10 && offset <= (0x10 + TableSize * 2)) {
|
} else if (offset >= 0x10 && offset <= (0x10 + TableSize * 2)) {
|
||||||
int index = (offset - 0x10) / 2;
|
int index = (offset - 0x10) / 2;
|
||||||
if (offset % 2) {
|
if (offset % 2) {
|
||||||
|
|
|
@ -98,6 +98,8 @@ class I82094AA : public PioDevice, public IntDev
|
||||||
|
|
||||||
I82094AA(Params *p);
|
I82094AA(Params *p);
|
||||||
|
|
||||||
|
void init();
|
||||||
|
|
||||||
Tick read(PacketPtr pkt);
|
Tick read(PacketPtr pkt);
|
||||||
Tick write(PacketPtr pkt);
|
Tick write(PacketPtr pkt);
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,15 @@ X86ISA::IntDev::IntPort::sendMessage(ApicList apics,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
X86ISA::IntDev::init()
|
||||||
|
{
|
||||||
|
if (!intPort) {
|
||||||
|
panic("Int port not connected to anything!");
|
||||||
|
}
|
||||||
|
intPort->sendStatusChange(Port::RangeChange);
|
||||||
|
}
|
||||||
|
|
||||||
X86ISA::IntSourcePin *
|
X86ISA::IntSourcePin *
|
||||||
X86IntSourcePinParams::create()
|
X86IntSourcePinParams::create()
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,14 +84,6 @@ class IntDev
|
||||||
// need to be moved into a subclass.
|
// need to be moved into a subclass.
|
||||||
void sendMessage(ApicList apics,
|
void sendMessage(ApicList apics,
|
||||||
TriggerIntMessage message, bool timing);
|
TriggerIntMessage message, bool timing);
|
||||||
|
|
||||||
void recvStatusChange(Status status)
|
|
||||||
{
|
|
||||||
if (status == RangeChange) {
|
|
||||||
sendStatusChange(Port::RangeChange);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IntPort * intPort;
|
IntPort * intPort;
|
||||||
|
@ -110,6 +102,8 @@ class IntDev
|
||||||
virtual ~IntDev()
|
virtual ~IntDev()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
virtual void init();
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
signalInterrupt(int line)
|
signalInterrupt(int line)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue