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.
+ // 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 IntDevice. Note IntDevice is
+ // not a SimObject itself.
//
BasicPioDevice::init();
- IntDev::init();
+ IntDevice::init();
// the slave port has a range so inform the connected master
intSlavePort.sendRangeChange();
}
-X86ISA::Interrupts::Interrupts(Params * p) :
- BasicPioDevice(p), IntDev(this, p->int_latency),
- apicTimerEvent(this),
- pendingSmi(false), smiVector(0),
- pendingNmi(false), nmiVector(0),
- pendingExtInt(false), extIntVector(0),
- pendingInit(false), initVector(0),
- pendingStartup(false), startupVector(0),
- startedUp(false), pendingUnmaskableInt(false),
- pendingIPIs(0), cpu(NULL),
- intSlavePort(name() + ".int_slave", this, this)
+X86ISA::Interrupts::Interrupts(Params * p)
+ : BasicPioDevice(p), IntDevice(this, p->int_latency),
+ apicTimerEvent(this),
+ pendingSmi(false), smiVector(0),
+ pendingNmi(false), nmiVector(0),
+ pendingExtInt(false), extIntVector(0),
+ pendingInit(false), initVector(0),
+ pendingStartup(false), startupVector(0),
+ startedUp(false), pendingUnmaskableInt(false),
+ pendingIPIs(0), cpu(NULL),
+ intSlavePort(name() + ".int_slave", this, this)
{
pioSize = PageBytes;
memset(regs, 0, sizeof(regs));
ApicRegIndex decodeAddr(Addr paddr);
-class Interrupts : public BasicPioDevice, IntDev
+class Interrupts : public BasicPioDevice, IntDevice
{
protected:
// Storage for the APIC registers
void init();
/*
- * Functions to interact with the interrupt port from IntDev.
+ * Functions to interact with the interrupt port from IntDevice.
*/
Tick read(PacketPtr pkt);
Tick write(PacketPtr pkt);
class PciDevice(DmaDevice):
type = 'PciDevice'
- cxx_class = 'PciDev'
+ cxx_class = 'PciDevice'
cxx_header = "dev/pcidev.hh"
abstract = True
platform = Param.Platform(Parent.any, "Platform this device is part of.")
using namespace CopyEngineReg;
CopyEngine::CopyEngine(const Params *p)
- : PciDev(p)
+ : PciDevice(p)
{
// All Reg regs are initialized to 0 by default
regs.chanCount = p->ChanCnt;
{
if (if_name != "dma") {
// pass it along to our super class
- return PciDev::getMasterPort(if_name, idx);
+ return PciDevice::getMasterPort(if_name, idx);
} else {
if (idx >= static_cast<int>(chan.size())) {
panic("CopyEngine::getMasterPort: unknown index %d\n", idx);
void
CopyEngine::serialize(std::ostream &os)
{
- PciDev::serialize(os);
+ PciDevice::serialize(os);
regs.serialize(os);
for (int x =0; x < chan.size(); x++) {
nameOut(os, csprintf("%s.channel%d", name(), x));
void
CopyEngine::unserialize(Checkpoint *cp, const std::string §ion)
{
- PciDev::unserialize(cp, section);
+ PciDevice::unserialize(cp, section);
regs.unserialize(cp, section);
for (int x = 0; x < chan.size(); x++)
chan[x]->unserialize(cp, csprintf("%s.channel%d", section, x));
#include "sim/drain.hh"
#include "sim/eventq.hh"
-class CopyEngine : public PciDev
+class CopyEngine : public PciDevice
{
class CopyEngineChannel : public Drainable
{
* The base EtherObject class, allows for an accesor function to a
* simobj that returns the Port.
*/
-class EtherDevice : public PciDev
+class EtherDevice : public PciDevice
{
public:
typedef EtherDeviceParams Params;
EtherDevice(const Params *params)
- : PciDev(params)
+ : PciDevice(params)
{}
const Params *
IGbE::init()
{
cpa = CPA::cpa();
- PciDev::init();
+ PciDevice::init();
}
EtherInt*
{
int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
if (offset < PCI_DEVICE_SPECIFIC)
- PciDev::writeConfig(pkt);
+ PciDevice::writeConfig(pkt);
else
panic("Device specific PCI config space not implemented.\n");
void
IGbE::serialize(std::ostream &os)
{
- PciDev::serialize(os);
+ PciDevice::serialize(os);
regs.serialize(os);
SERIALIZE_SCALAR(eeOpBits);
void
IGbE::unserialize(Checkpoint *cp, const std::string §ion)
{
- PciDev::unserialize(cp, section);
+ PciDevice::unserialize(cp, section);
regs.unserialize(cp, section);
UNSERIALIZE_SCALAR(eeOpBits);
}
IdeController::IdeController(Params *p)
- : PciDev(p), primary(name() + ".primary", BARSize[0], BARSize[1]),
+ : PciDevice(p), primary(name() + ".primary", BARSize[0], BARSize[1]),
secondary(name() + ".secondary", BARSize[2], BARSize[3]),
bmiAddr(0), bmiSize(BARSize[4]),
primaryTiming(htole(timeRegWithDecodeEn)),
IdeController::intrPost()
{
primary.bmiRegs.status.intStatus = 1;
- PciDev::intrPost();
+ PciDevice::intrPost();
}
void
{
int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
if (offset < PCI_DEVICE_SPECIFIC) {
- return PciDev::readConfig(pkt);
+ return PciDevice::readConfig(pkt);
}
pkt->allocate();
{
int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
if (offset < PCI_DEVICE_SPECIFIC) {
- PciDev::writeConfig(pkt);
+ PciDevice::writeConfig(pkt);
} else {
switch (pkt->getSize()) {
case sizeof(uint8_t):
void
IdeController::serialize(std::ostream &os)
{
- // Serialize the PciDev base class
- PciDev::serialize(os);
+ // Serialize the PciDevice base class
+ PciDevice::serialize(os);
// Serialize channels
primary.serialize("primary", os);
void
IdeController::unserialize(Checkpoint *cp, const std::string §ion)
{
- // Unserialize the PciDev base class
- PciDev::unserialize(cp, section);
+ // Unserialize the PciDevice base class
+ PciDevice::unserialize(cp, section);
// Unserialize channels
primary.unserialize("primary", cp, section);
* Device model for an Intel PIIX4 IDE controller
*/
-class IdeController : public PciDev
+class IdeController : public PciDevice
{
private:
// Bus master IDE status register bit fields
{
int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
if (offset < PCI_DEVICE_SPECIFIC)
- PciDev::writeConfig(pkt);
+ PciDevice::writeConfig(pkt);
else
panic("Device specific PCI config space not implemented!\n");
void
NSGigE::serialize(ostream &os)
{
- // Serialize the PciDev base class
- PciDev::serialize(os);
+ // Serialize the PciDevice base class
+ PciDevice::serialize(os);
/*
* Finalize any DMA events now.
void
NSGigE::unserialize(Checkpoint *cp, const std::string §ion)
{
- // Unserialize the PciDev base class
- PciDev::unserialize(cp, section);
+ // Unserialize the PciDevice base class
+ PciDevice::unserialize(cp, section);
UNSERIALIZE_SCALAR(regs.command);
UNSERIALIZE_SCALAR(regs.config);
* PCI Config Space
* All of PCI config space needs to return -1 on Tsunami, except
* the devices that exist. This device maps the entire bus config
- * space and passes the requests on to TsunamiPCIDev devices as
+ * space and passes the requests on to TsunamiPCIDevice devices as
* appropriate.
*/
class PciConfigAll : public BasicPioDevice
/**
* Read something in PCI config space. If the device does not exist
- * -1 is returned, if the device does exist its PciDev::ReadConfig (or the
- * virtual function that overrides) it is called.
+ * -1 is returned, if the device does exist its PciDevice::ReadConfig
+ * (or the virtual function that overrides) it is called.
* @param pkt Contains information about the read operation
* @return Amount of time to do the read
*/
/**
* Write to PCI config spcae. If the device does not exit the simulator
- * panics. If it does it is passed on the PciDev::WriteConfig (or the virtual
- * function that overrides it).
+ * panics. If it does it is passed on the PciDevice::WriteConfig (or
+ * the virtual function that overrides it).
* @param pkt Contains information about the write operation
* @return Amount of time to do the read
*/
#include "sim/core.hh"
-PciDev::PciConfigPort::PciConfigPort(PciDev *dev, int busid, int devid,
+PciDevice::PciConfigPort::PciConfigPort(PciDevice *dev, int busid, int devid,
int funcid, Platform *p)
: SimpleTimingPort(dev->name() + "-pciconf", dev), device(dev),
platform(p), busId(busid), deviceId(devid), functionId(funcid)
Tick
-PciDev::PciConfigPort::recvAtomic(PacketPtr pkt)
+PciDevice::PciConfigPort::recvAtomic(PacketPtr pkt)
{
assert(pkt->getAddr() >= configAddr &&
pkt->getAddr() < configAddr + PCI_CONFIG_SIZE);
}
AddrRangeList
-PciDev::PciConfigPort::getAddrRanges() const
+PciDevice::PciConfigPort::getAddrRanges() const
{
AddrRangeList ranges;
if (configAddr != ULL(-1))
}
-PciDev::PciDev(const Params *p)
+PciDevice::PciDevice(const Params *p)
: DmaDevice(p), platform(p->platform), pioDelay(p->pio_latency),
configDelay(p->config_latency),
configPort(this, params()->pci_bus, params()->pci_dev,
}
void
-PciDev::init()
+PciDevice::init()
{
if (!configPort.isConnected())
panic("PCI config port on %s not connected to anything!\n", name());
}
unsigned int
-PciDev::drain(DrainManager *dm)
+PciDevice::drain(DrainManager *dm)
{
unsigned int count;
count = pioPort.drain(dm) + dmaPort.drain(dm) + configPort.drain(dm);
}
Tick
-PciDev::readConfig(PacketPtr pkt)
+PciDevice::readConfig(PacketPtr pkt)
{
int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
if (offset >= PCI_DEVICE_SPECIFIC)
}
AddrRangeList
-PciDev::getAddrRanges() const
+PciDevice::getAddrRanges() const
{
AddrRangeList ranges;
int x = 0;
}
Tick
-PciDev::writeConfig(PacketPtr pkt)
+PciDevice::writeConfig(PacketPtr pkt)
{
int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
if (offset >= PCI_DEVICE_SPECIFIC)
}
void
-PciDev::serialize(std::ostream &os)
+PciDevice::serialize(std::ostream &os)
{
SERIALIZE_ARRAY(BARSize, sizeof(BARSize) / sizeof(BARSize[0]));
SERIALIZE_ARRAY(BARAddrs, sizeof(BARAddrs) / sizeof(BARAddrs[0]));
}
void
-PciDev::unserialize(Checkpoint *cp, const std::string §ion)
+PciDevice::unserialize(Checkpoint *cp, const std::string §ion)
{
UNSERIALIZE_ARRAY(BARSize, sizeof(BARSize) / sizeof(BARSize[0]));
UNSERIALIZE_ARRAY(BARAddrs, sizeof(BARAddrs) / sizeof(BARAddrs[0]));
/**
* PCI device, base implementation is only config space.
*/
-class PciDev : public DmaDevice
+class PciDevice : public DmaDevice
{
class PciConfigPort : public SimpleTimingPort
{
protected:
- PciDev *device;
+ PciDevice *device;
virtual Tick recvAtomic(PacketPtr pkt);
Addr configAddr;
public:
- PciConfigPort(PciDev *dev, int busid, int devid, int funcid,
+ PciConfigPort(PciDevice *dev, int busid, int devid, int funcid,
Platform *p);
};
* config file object PCIConfigData and registers the device with
* a PciConfigAll object.
*/
- PciDev(const Params *params);
+ PciDevice(const Params *params);
virtual void init();
void
Base::serialize(std::ostream &os)
{
- // Serialize the PciDev base class
- PciDev::serialize(os);
+ // Serialize the PciDevice base class
+ PciDevice::serialize(os);
SERIALIZE_SCALAR(rxEnable);
SERIALIZE_SCALAR(txEnable);
void
Base::unserialize(Checkpoint *cp, const std::string §ion)
{
- // Unserialize the PciDev base class
- PciDev::unserialize(cp, section);
+ // Unserialize the PciDevice base class
+ PciDevice::unserialize(cp, section);
UNSERIALIZE_SCALAR(rxEnable);
UNSERIALIZE_SCALAR(txEnable);
{
int count;
- // Serialize the PciDev base class
+ // Serialize the PciDevice base class
Base::serialize(os);
if (rxState == rxCopy)
void
Device::unserialize(Checkpoint *cp, const std::string §ion)
{
- // Unserialize the PciDev base class
+ // Unserialize the PciDevice base class
Base::unserialize(cp, section);
/*
SimObject('X86IntPin.py')
Source('intdev.cc')
- DebugFlag('IntDev')
+ DebugFlag('IntDevice')
#include "sim/system.hh"
X86ISA::I82094AA::I82094AA(Params *p)
- : BasicPioDevice(p), IntDev(this, p->int_latency),
+ : BasicPioDevice(p), IntDevice(this, p->int_latency),
extIntPic(p->external_int_pic), lowestPriorityOffset(0)
{
// This assumes there's only one I/O APIC in the system and since the apic
{
// 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.
+ // from IntDevice. Note IntDevice is not a SimObject itself.
BasicPioDevice::init();
- IntDev::init();
+ IntDevice::init();
}
BaseMasterPort &
class I8259;
class Interrupts;
-class I82094AA : public BasicPioDevice, public IntDev
+class I82094AA : public BasicPioDevice, public IntDevice
{
public:
BitUnion64(RedirTableEntry)
#include "mem/packet.hh"
#include "mem/packet_access.hh"
-X86ISA::I8259::I8259(Params * p) : BasicPioDevice(p), IntDev(this),
+X86ISA::I8259::I8259(Params * p) : BasicPioDevice(p), IntDevice(this),
latency(p->pio_latency), output(p->output),
mode(p->mode), slave(p->slave),
IRR(0), ISR(0), IMR(0),
namespace X86ISA
{
-class I8259 : public BasicPioDevice, public IntDev
+class I8259 : public BasicPioDevice, public IntDevice
{
protected:
static const int NumLines = 8;
#include "dev/x86/intdev.hh"
void
-X86ISA::IntDev::IntMasterPort::sendMessage(ApicList apics,
+X86ISA::IntDevice::IntMasterPort::sendMessage(ApicList apics,
TriggerIntMessage message,
bool timing)
{
}
void
-X86ISA::IntDev::init()
+X86ISA::IntDevice::init()
{
if (!intMasterPort.isConnected()) {
panic("Int port not connected to anything!");
typedef std::list<int> ApicList;
-class IntDev
+class IntDevice
{
protected:
class IntSlavePort : public MessageSlavePort
{
- IntDev * device;
+ IntDevice * device;
public:
IntSlavePort(const std::string& _name, MemObject* _parent,
- IntDev* dev) :
+ IntDevice* dev) :
MessageSlavePort(_name, _parent), device(dev)
{
}
class IntMasterPort : public MessageMasterPort
{
- IntDev* device;
+ IntDevice* device;
Tick latency;
public:
IntMasterPort(const std::string& _name, MemObject* _parent,
- IntDev* dev, Tick _latency) :
+ IntDevice* dev, Tick _latency) :
MessageMasterPort(_name, _parent), device(dev), latency(_latency)
{
}
IntMasterPort intMasterPort;
public:
- IntDev(MemObject * parent, Tick latency = 0) :
+ IntDevice(MemObject * parent, Tick latency = 0) :
intMasterPort(parent->name() + ".int_master", parent, this, latency)
{
}
- virtual ~IntDev()
+ virtual ~IntDevice()
{}
virtual void init();
class IntSinkPin : public SimObject
{
public:
- IntDev * device;
+ IntDevice * device;
int number;
typedef X86IntSinkPinParams Params;
}
IntSinkPin(Params *p) : SimObject(p),
- device(dynamic_cast<IntDev *>(p->device)), number(p->number)
+ device(dynamic_cast<IntDevice *>(p->device)), number(p->number)
{
assert(device);
}