dev, x86: Delete the now unused X86 specific interrupt pins/lines.

Change-Id: I3915f0ad673119b551dcc4c5cedec180a9b88735
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20702
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2019-09-06 15:14:00 -07:00
parent ab376064bd
commit 679ed0eec5
12 changed files with 14 additions and 192 deletions

View File

@@ -65,6 +65,5 @@ if env['TARGET_ISA'] == 'x86':
Source('i82094aa.cc')
DebugFlag('I82094AA')
SimObject('X86IntPin.py')
Source('intdev.cc')
DebugFlag('IntDevice')

View File

@@ -1,54 +0,0 @@
# Copyright (c) 2008 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer;
# redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution;
# neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Gabe Black
from m5.params import *
from m5.SimObject import SimObject
# A generic pin to drive an interrupt signal generated by a device.
class X86IntSourcePin(SimObject):
type = 'X86IntSourcePin'
cxx_class = 'X86ISA::IntSourcePin'
cxx_header = "dev/x86/intdev.hh"
# A generic pin to receive an interrupt signal generated by another device.
class X86IntSinkPin(SimObject):
type = 'X86IntSinkPin'
cxx_class = 'X86ISA::IntSinkPin'
cxx_header = "dev/x86/intdev.hh"
device = Param.SimObject("Device this pin belongs to")
number = Param.Int("The pin number on the device")
# An interrupt line which is driven by a source pin and drives a sink pin.
class X86IntLine(SimObject):
type = 'X86IntLine'
cxx_class = 'X86ISA::IntLine'
cxx_header = "dev/x86/intdev.hh"
source = Param.X86IntSourcePin("Pin driving this line")
sink = Param.X86IntSinkPin("Pin driven by this line")

View File

@@ -56,14 +56,14 @@ class Cmos : public BasicPioDevice
class X86RTC : public MC146818
{
public:
std::vector<::IntSourcePin<X86RTC> *> intPin;
std::vector<IntSourcePin<X86RTC> *> intPin;
X86RTC(EventManager *em, const std::string &n, const struct tm time,
bool bcd, Tick frequency, int int_pin_count) :
MC146818(em, n, time, bcd, frequency)
{
for (int i = 0; i < int_pin_count; i++) {
intPin.push_back(new ::IntSourcePin<X86RTC>(
intPin.push_back(new IntSourcePin<X86RTC>(
csprintf("%s.int_pin[%d]", n, i), i, this));
}
}

View File

@@ -64,11 +64,11 @@ X86ISA::I8042::I8042(Params *p)
commandByte.keyboardFullInt = 1;
for (int i = 0; i < p->port_keyboard_int_pin_connection_count; i++) {
keyboardIntPin.push_back(new ::IntSourcePin<I8042>(
keyboardIntPin.push_back(new IntSourcePin<I8042>(
csprintf("%s.keyboard_int_pin[%d]", name(), i), i, this));
}
for (int i = 0; i < p->port_mouse_int_pin_connection_count; i++) {
mouseIntPin.push_back(new ::IntSourcePin<I8042>(
mouseIntPin.push_back(new IntSourcePin<I8042>(
csprintf("%s.mouse_int_pin[%d]", name(), i), i, this));
}
}

View File

@@ -108,8 +108,8 @@ class I8042 : public BasicPioDevice
static const uint16_t NoCommand = (uint16_t)(-1);
uint16_t lastCommand;
std::vector<::IntSourcePin<I8042> *> mouseIntPin;
std::vector<::IntSourcePin<I8042> *> keyboardIntPin;
std::vector<IntSourcePin<I8042> *> mouseIntPin;
std::vector<IntSourcePin<I8042> *> keyboardIntPin;
PS2Device *mouse;
PS2Device *keyboard;

View File

@@ -59,7 +59,7 @@ X86ISA::I82094AA::I82094AA(Params *p)
}
for (int i = 0; i < p->port_inputs_connection_count; i++)
inputs.push_back(new ::IntSinkPin<I82094AA>(
inputs.push_back(new IntSinkPin<I82094AA>(
csprintf("%s.inputs[%d]", name(), i), i, this));
}

View File

@@ -82,7 +82,7 @@ class I82094AA : public BasicPioDevice, public IntDevice
RedirTableEntry redirTable[TableSize];
bool pinStates[TableSize];
std::vector<::IntSinkPin<I82094AA> *> inputs;
std::vector<IntSinkPin<I82094AA> *> inputs;
public:
typedef I82094AAParams Params;

View File

@@ -63,7 +63,7 @@ class I8254 : public BasicPioDevice
X86Intel8254Timer pit;
std::vector<::IntSourcePin<I8254> *> intPin;
std::vector<IntSourcePin<I8254> *> intPin;
void counterInterrupt(unsigned int num);
@@ -89,7 +89,7 @@ class I8254 : public BasicPioDevice
pit(p->name, this)
{
for (int i = 0; i < p->port_int_pin_connection_count; i++) {
intPin.push_back(new ::IntSourcePin<I8254>(csprintf(
intPin.push_back(new IntSourcePin<I8254>(csprintf(
"%s.int_pin[%d]", name(), i), i, this));
}
}

View File

@@ -44,7 +44,7 @@ X86ISA::I8259::I8259(Params * p)
readIRR(true), initControlWord(0), autoEOI(false)
{
for (int i = 0; i < p->port_output_connection_count; i++) {
output.push_back(new ::IntSourcePin<I8259>(
output.push_back(new IntSourcePin<I8259>(
csprintf("%s.output[%d]", name(), i), i, this));
}
@@ -52,7 +52,7 @@ X86ISA::I8259::I8259(Params * p)
panic_if(in_count >= NumLines,
"I8259 only supports 8 inputs, but there are %d.", in_count);
for (int i = 0; i < in_count; i++) {
inputs.push_back(new ::IntSinkPin<I8259>(
inputs.push_back(new IntSinkPin<I8259>(
csprintf("%s.inputs[%d]", name(), i), i, this));
}

View File

@@ -48,8 +48,8 @@ class I8259 : public BasicPioDevice
void init() override;
Tick latency;
std::vector<::IntSourcePin<I8259> *> output;
std::vector<::IntSinkPin<I8259> *> inputs;
std::vector<IntSourcePin<I8259> *> output;
std::vector<IntSinkPin<I8259> *> inputs;
Enums::X86I8259CascadeMode mode;
I8259 * slave;

View File

@@ -70,21 +70,3 @@ X86ISA::IntDevice::init()
panic("Int port not connected to anything!");
}
}
X86ISA::IntSourcePin *
X86IntSourcePinParams::create()
{
return new X86ISA::IntSourcePin(this);
}
X86ISA::IntSinkPin *
X86IntSinkPinParams::create()
{
return new X86ISA::IntSinkPin(this);
}
X86ISA::IntLine *
X86IntLineParams::create()
{
return new X86ISA::IntLine(this);
}

View File

@@ -50,9 +50,6 @@
#include "arch/x86/intmessage.hh"
#include "arch/x86/x86_traits.hh"
#include "mem/mport.hh"
#include "params/X86IntLine.hh"
#include "params/X86IntSinkPin.hh"
#include "params/X86IntSourcePin.hh"
#include "sim/sim_object.hh"
namespace X86ISA {
@@ -121,24 +118,6 @@ class IntDevice
virtual void init();
virtual void
signalInterrupt(int line)
{
panic("signalInterrupt not implemented.\n");
}
virtual void
raiseInterruptPin(int number)
{
panic("raiseInterruptPin not implemented.\n");
}
virtual void
lowerInterruptPin(int number)
{
panic("lowerInterruptPin not implemented.\n");
}
virtual Tick
recvMessage(PacketPtr pkt)
{
@@ -160,90 +139,6 @@ class IntDevice
}
};
class IntSinkPin : public SimObject
{
public:
IntDevice * device;
int number;
typedef X86IntSinkPinParams Params;
const Params *
params() const
{
return dynamic_cast<const Params *>(_params);
}
IntSinkPin(Params *p) : SimObject(p),
device(dynamic_cast<IntDevice *>(p->device)), number(p->number)
{
assert(device);
}
};
class IntSourcePin : public SimObject
{
protected:
std::vector<IntSinkPin *> sinks;
public:
typedef X86IntSourcePinParams Params;
const Params *
params() const
{
return dynamic_cast<const Params *>(_params);
}
void
addSink(IntSinkPin *sink)
{
sinks.push_back(sink);
}
void
raise()
{
for (int i = 0; i < sinks.size(); i++) {
const IntSinkPin &pin = *sinks[i];
pin.device->raiseInterruptPin(pin.number);
}
}
void
lower()
{
for (int i = 0; i < sinks.size(); i++) {
const IntSinkPin &pin = *sinks[i];
pin.device->lowerInterruptPin(pin.number);
}
}
IntSourcePin(Params *p) : SimObject(p)
{}
};
class IntLine : public SimObject
{
protected:
IntSourcePin *source;
IntSinkPin *sink;
public:
typedef X86IntLineParams Params;
const Params *
params() const
{
return dynamic_cast<const Params *>(_params);
}
IntLine(Params *p) : SimObject(p), source(p->source), sink(p->sink)
{
source->addSink(sink);
}
};
} // namespace X86ISA
#endif //__DEV_X86_INTDEV_HH__