X86ISA::Interrupts::Interrupts(Params * p)
- : BasicPioDevice(p), IntDevice(this, p->int_latency),
+ : BasicPioDevice(p, PageBytes), IntDevice(this, p->int_latency),
apicTimerEvent(this),
pendingSmi(false), smiVector(0),
pendingNmi(false), nmiVector(0),
pendingIPIs(0), cpu(NULL),
intSlavePort(name() + ".int_slave", this, this)
{
- pioSize = PageBytes;
memset(regs, 0, sizeof(regs));
//Set the local apic DFR to the flat model.
regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1);
using namespace AlphaISA;
AlphaBackdoor::AlphaBackdoor(const Params *p)
- : BasicPioDevice(p), disk(p->disk), terminal(p->terminal),
+ : BasicPioDevice(p, sizeof(struct AlphaAccess)),
+ disk(p->disk), terminal(p->terminal),
system(p->system), cpu(p->cpu)
{
-
- pioSize = sizeof(struct AlphaAccess);
-
alphaAccess = new Access();
alphaAccess->last_offset = pioSize - 1;
using namespace TheISA;
TsunamiCChip::TsunamiCChip(const Params *p)
- : BasicPioDevice(p), tsunami(p->tsunami)
+ : BasicPioDevice(p, 0x10000000), tsunami(p->tsunami)
{
- pioSize = 0x10000000;
-
drir = 0;
ipint = 0;
itint = 0;
}
TsunamiIO::TsunamiIO(const Params *p)
- : BasicPioDevice(p), tsunami(p->tsunami),
+ : BasicPioDevice(p, 0x100), tsunami(p->tsunami),
pitimer(this, p->name + "pitimer"), rtc(p->name + ".rtc", p)
{
- pioSize = 0x100;
-
// set the back pointer from tsunami to myself
tsunami->io = this;
using namespace TheISA;
TsunamiPChip::TsunamiPChip(const Params *p)
-: BasicPioDevice(p)
+ : BasicPioDevice(p, 0x1000)
{
- pioSize = 0x1000;
-
for (int i = 0; i < 4; i++) {
wsba[i] = 0;
wsm[i] = 0;
#include "sim/system.hh"
A9SCU::A9SCU(Params *p)
- : BasicPioDevice(p)
+ : BasicPioDevice(p, 0x60)
{
- pioSize = 0x60;
}
Tick
const uint64_t AmbaVendor = ULL(0xb105f00d00000000);
-AmbaPioDevice::AmbaPioDevice(const Params *p)
- : BasicPioDevice(p), ambaId(AmbaVendor | p->amba_id)
+AmbaPioDevice::AmbaPioDevice(const Params *p, Addr pio_size)
+ : BasicPioDevice(p, pio_size), ambaId(AmbaVendor | p->amba_id)
{
}
-AmbaIntDevice::AmbaIntDevice(const Params *p)
- : AmbaPioDevice(p), intNum(p->int_num), gic(p->gic), intDelay(p->int_delay)
+AmbaIntDevice::AmbaIntDevice(const Params *p, Addr pio_size)
+ : AmbaPioDevice(p, pio_size),
+ intNum(p->int_num), gic(p->gic), intDelay(p->int_delay)
{
}
public:
typedef AmbaPioDeviceParams Params;
- AmbaPioDevice(const Params *p);
+ AmbaPioDevice(const Params *p, Addr pio_size);
};
class AmbaIntDevice : public AmbaPioDevice
public:
typedef AmbaIntDeviceParams Params;
- AmbaIntDevice(const Params *p);
+ AmbaIntDevice(const Params *p, Addr pio_size);
};
class AmbaDmaDevice : public DmaDevice, public AmbaDevice
#include "mem/packet_access.hh"
AmbaFake::AmbaFake(const Params *p)
- : AmbaPioDevice(p)
+ : AmbaPioDevice(p, 0xfff)
{
- pioSize = 0xfff;
}
Tick
#include "mem/packet_access.hh"
Pl050::Pl050(const Params *p)
- : AmbaIntDevice(p), control(0), status(0x43), clkdiv(0), interrupts(0),
- rawInterrupts(0), ackNext(false), shiftDown(false), vnc(p->vnc),
- driverInitialized(false), intEvent(this)
+ : AmbaIntDevice(p, 0xfff), control(0), status(0x43), clkdiv(0),
+ interrupts(0), rawInterrupts(0), ackNext(false), shiftDown(false),
+ vnc(p->vnc), driverInitialized(false), intEvent(this)
{
- pioSize = 0xfff;
-
if (vnc) {
if (!p->is_mouse)
vnc->setKeyboard(this);
#include "sim/sim_exit.hh"
Pl011::Pl011(const Params *p)
- : Uart(p), control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12), imsc(0),
- rawInt(0), maskInt(0), intNum(p->int_num), gic(p->gic),
+ : Uart(p, 0xfff), control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12),
+ imsc(0), rawInt(0), maskInt(0), intNum(p->int_num), gic(p->gic),
endOnEOT(p->end_on_eot), intDelay(p->int_delay), intEvent(this)
{
- pioSize = 0xfff;
}
Tick
#include "mem/packet_access.hh"
PL031::PL031(Params *p)
- : AmbaIntDevice(p), timeVal(mkutctime(&p->time)), lastWrittenTick(0),
- loadVal(0), matchVal(0), rawInt(false), maskInt(false),
- pendingInt(false), matchEvent(this)
+ : AmbaIntDevice(p, 0xfff), timeVal(mkutctime(&p->time)),
+ lastWrittenTick(0), loadVal(0), matchVal(0),
+ rawInt(false), maskInt(false), pendingInt(false), matchEvent(this)
{
- pioSize = 0xfff;
}
#include "mem/packet_access.hh"
RealViewCtrl::RealViewCtrl(Params *p)
- : BasicPioDevice(p), flags(0)
+ : BasicPioDevice(p, 0xD4), flags(0)
{
- pioSize = 0xD4;
}
Tick
#include "mem/packet_access.hh"
CpuLocalTimer::CpuLocalTimer(Params *p)
- : BasicPioDevice(p), gic(p->gic)
+ : BasicPioDevice(p, 0x38), gic(p->gic)
{
// Initialize the timer registers for each per cpu timer
for (int i = 0; i < CPU_MAX; i++) {
localTimer[i].intNumWatchdog = p->int_num_watchdog;
localTimer[i].cpuNum = i;
}
- pioSize = 0x38;
}
CpuLocalTimer::Timer::Timer()
#include "mem/packet_access.hh"
Sp804::Sp804(Params *p)
- : AmbaPioDevice(p), gic(p->gic), timer0(name() + ".timer0", this, p->int_num0, p->clock0),
+ : AmbaPioDevice(p, 0xfff), gic(p->gic),
+ timer0(name() + ".timer0", this, p->int_num0, p->clock0),
timer1(name() + ".timer1", this, p->int_num1, p->clock1)
{
- pioSize = 0xfff;
}
Sp804::Timer::Timer(std::string __name, Sp804 *_parent, int int_num, Tick _clock)
using namespace std;
BadDevice::BadDevice(Params *p)
- : BasicPioDevice(p), devname(p->devicename)
+ : BasicPioDevice(p, 0x10), devname(p->devicename)
{
- pioSize = 0x10;
}
Tick
return count;
}
-BasicPioDevice::BasicPioDevice(const Params *p)
- : PioDevice(p), pioAddr(p->pio_addr), pioSize(0),
+BasicPioDevice::BasicPioDevice(const Params *p, Addr size)
+ : PioDevice(p), pioAddr(p->pio_addr), pioSize(size),
pioDelay(p->pio_latency)
{}
public:
typedef BasicPioDeviceParams Params;
- BasicPioDevice(const Params *p);
+ BasicPioDevice(const Params *p, Addr size);
const Params *
params() const
using namespace std;
IsaFake::IsaFake(Params *p)
- : BasicPioDevice(p)
+ : BasicPioDevice(p, p->ret_bad_addr ? 0 : p->pio_size)
{
- if (!p->ret_bad_addr)
- pioSize = p->pio_size;
-
retData8 = p->ret_data8;
retData16 = p->ret_data16;
retData32 = p->ret_data32;
using namespace TheISA;
MaltaCChip::MaltaCChip(Params *p)
- : BasicPioDevice(p), malta(p->malta)
+ : BasicPioDevice(p, 0xfffffff), malta(p->malta)
{
warn("MaltaCCHIP::MaltaCChip() not implemented.");
- pioSize = 0xfffffff;
//Put back pointer in malta
malta->cchip = this;
}
MaltaIO::MaltaIO(const Params *p)
- : BasicPioDevice(p), malta(p->malta),
+ : BasicPioDevice(p, 0x100), malta(p->malta),
pitimer(this, p->name + "pitimer"), rtc(p->name + ".rtc", p)
{
- pioSize = 0x100;
-
// set the back pointer from malta to myself
malta->io = this;
using namespace TheISA;
MaltaPChip::MaltaPChip(const Params *p)
-: BasicPioDevice(p)
+ : BasicPioDevice(p, 0x1000)
{
- pioSize = 0x1000;
-
for (int i = 0; i < 4; i++) {
wsba[i] = 0;
wsm[i] = 0;
#include "sim/system.hh"
PciConfigAll::PciConfigAll(const Params *p)
- : BasicPioDevice(p)
+ : BasicPioDevice(p, p->size)
{
// the pio_addr Python parameter is ignored, and overridden by
// this caluclated value
pioAddr = p->platform->calcPciConfigAddr(params()->bus,0,0);
-
- pioSize = params()->size;
}
using namespace TheISA;
DumbTOD::DumbTOD(const Params *p)
- : BasicPioDevice(p)
+ : BasicPioDevice(p, 0x08)
{
struct tm tm = p->time;
char *tz;
- pioSize = 0x08;
-
tz = getenv("TZ");
setenv("TZ", "", 1);
tzset();
#include "sim/system.hh"
MmDisk::MmDisk(const Params *p)
- : BasicPioDevice(p), image(p->image), curSector((off_t)-1), dirty(false)
+ : BasicPioDevice(p, p->image->size() * SectorSize),
+ image(p->image), curSector((off_t)-1), dirty(false)
{
std::memset(&diskData, 0, SectorSize);
- pioSize = image->size() * SectorSize;
}
Tick
using namespace std;
-Uart::Uart(const Params *p)
- : BasicPioDevice(p), platform(p->platform), term(p->terminal)
+Uart::Uart(const Params *p, Addr pio_size)
+ : BasicPioDevice(p, pio_size), platform(p->platform), term(p->terminal)
{
status = 0;
public:
typedef UartParams Params;
- Uart(const Params *p);
+ Uart(const Params *p, Addr pio_size);
const Params *
params() const
Uart8250::Uart8250(const Params *p)
- : Uart(p), IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0),
+ : Uart(p, 8), IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0),
txIntrEvent(this, TX_INT), rxIntrEvent(this, RX_INT)
{
- pioSize = 8;
}
Tick
public:
typedef CmosParams Params;
- Cmos(const Params *p) : BasicPioDevice(p), latency(p->pio_latency),
+ Cmos(const Params *p) : BasicPioDevice(p, 2), latency(p->pio_latency),
rtc(this, "rtc", p->time, true, ULL(5000000000), p->int_pin)
{
- pioSize = 2;
memset(regs, 0, numRegs * sizeof(uint8_t));
address = 0;
}
const uint8_t CommandNack = 0xfe;
const uint8_t BatSuccessful = 0xaa;
+
+X86ISA::I8042::I8042(Params *p)
+ : BasicPioDevice(p, 0), // pioSize arg is dummy value... not used
+ latency(p->pio_latency),
+ dataPort(p->data_port), commandPort(p->command_port),
+ statusReg(0), commandByte(0), dataReg(0), lastCommand(NoCommand),
+ mouseIntPin(p->mouse_int_pin), keyboardIntPin(p->keyboard_int_pin)
+{
+ statusReg.passedSelfTest = 1;
+ statusReg.commandLast = 1;
+ statusReg.keyboardUnlocked = 1;
+
+ commandByte.convertScanCodes = 1;
+ commandByte.passedSelfTest = 1;
+ commandByte.keyboardFullInt = 1;
+}
+
+
AddrRangeList
X86ISA::I8042::getAddrRanges() const
{
return dynamic_cast<const Params *>(_params);
}
- I8042(Params *p) : BasicPioDevice(p), latency(p->pio_latency),
- dataPort(p->data_port), commandPort(p->command_port),
- statusReg(0), commandByte(0), dataReg(0), lastCommand(NoCommand),
- mouseIntPin(p->mouse_int_pin), keyboardIntPin(p->keyboard_int_pin)
- {
- statusReg.passedSelfTest = 1;
- statusReg.commandLast = 1;
- statusReg.keyboardUnlocked = 1;
-
- commandByte.convertScanCodes = 1;
- commandByte.passedSelfTest = 1;
- commandByte.keyboardFullInt = 1;
- }
+ I8042(Params *p);
AddrRangeList getAddrRanges() const;
#include "sim/system.hh"
X86ISA::I82094AA::I82094AA(Params *p)
- : BasicPioDevice(p), IntDevice(this, p->int_latency),
+ : BasicPioDevice(p, 20), 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
redirTable[i] = entry;
pinStates[i] = false;
}
-
- pioSize = 20;
}
void
return dynamic_cast<const Params *>(_params);
}
- I8237(Params *p) : BasicPioDevice(p), latency(p->pio_latency), maskReg(0)
+ I8237(Params *p) : BasicPioDevice(p, 16), latency(p->pio_latency), maskReg(0)
{
- pioSize = 16;
}
Tick read(PacketPtr pkt);
return dynamic_cast<const Params *>(_params);
}
- I8254(Params *p) : BasicPioDevice(p), latency(p->pio_latency),
+ I8254(Params *p) : BasicPioDevice(p, 4), latency(p->pio_latency),
pit(p->name, this), intPin(p->int_pin)
{
- pioSize = 4;
}
Tick read(PacketPtr pkt);
#include "mem/packet.hh"
#include "mem/packet_access.hh"
-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),
- readIRR(true), initControlWord(0), autoEOI(false)
+X86ISA::I8259::I8259(Params * p)
+ : BasicPioDevice(p, 2), IntDevice(this),
+ latency(p->pio_latency), output(p->output),
+ mode(p->mode), slave(p->slave),
+ IRR(0), ISR(0), IMR(0),
+ readIRR(true), initControlWord(0), autoEOI(false)
{
for (int i = 0; i < NumLines; i++)
pinStates[i] = false;
- pioSize = 2;
}
Tick
return dynamic_cast<const Params *>(_params);
}
- Speaker(Params *p) : BasicPioDevice(p),
+ Speaker(Params *p) : BasicPioDevice(p, 1),
latency(p->pio_latency), controlVal(0), timer(p->i8254)
{
- pioSize = 1;
}
Tick read(PacketPtr pkt);