summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorLisa Hsu <hsul@eecs.umich.edu>2004-03-22 13:21:18 -0500
committerLisa Hsu <hsul@eecs.umich.edu>2004-03-22 13:21:18 -0500
commitddeaa4d5e158522f6106fa0afd1dcd52c1da1f21 (patch)
tree8c695a46ce8077f43e3d8d6631a75caea7036d70 /dev
parent25a07e746759b04223c71ea32530a2cc90be4bc3 (diff)
parent3bc851b7dbe529dc1e45c9ab9082b941fad9465c (diff)
downloadgem5-ddeaa4d5e158522f6106fa0afd1dcd52c1da1f21.tar.xz
Merge zizzer:/bk/linux into zower.eecs.umich.edu:/z/hsul/work/bk/linux
--HG-- extra : convert_revision : b4e2fc55ec9cd0caa7cdf02de8a61c66e8b35c67
Diffstat (limited to 'dev')
-rw-r--r--dev/alpha_console.cc17
-rw-r--r--dev/alpha_console.hh3
-rw-r--r--dev/pcidev.cc12
-rw-r--r--dev/pcidev.hh10
4 files changed, 25 insertions, 17 deletions
diff --git a/dev/alpha_console.cc b/dev/alpha_console.cc
index 2e9e09e93..111b23c81 100644
--- a/dev/alpha_console.cc
+++ b/dev/alpha_console.cc
@@ -50,11 +50,12 @@
#include "sim/builder.hh"
#include "sim/system.hh"
#include "dev/tsunami_io.hh"
+#include "sim/sim_object.hh"
using namespace std;
AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d,
- System *system, BaseCPU *cpu, TsunamiIO *clock,
+ System *system, BaseCPU *cpu, SimObject *clock,
int num_cpus, MemoryController *mmu, Addr a,
HierParams *hier, Bus *bus)
: PioDevice(name), disk(d), console(cons), addr(a)
@@ -79,8 +80,14 @@ AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d,
alphaAccess->numCPUs = num_cpus;
alphaAccess->mem_size = system->physmem->size();
alphaAccess->cpuClock = cpu->getFreq() / 1000000;
- alphaAccess->intrClockFrequency = clock->frequency();
-
+ TsunamiIO *clock_linux = dynamic_cast<TsunamiIO *>(clock);
+ TlaserClock *clock_tru64 = dynamic_cast<TlaserClock *>(clock);
+ if (clock_linux)
+ alphaAccess->intrClockFrequency = clock_linux->frequency();
+ else if (clock_tru64)
+ alphaAccess->intrClockFrequency = clock_tru64->frequency();
+ else
+ panic("clock must be of type TlaserClock or TsunamiIO\n");
alphaAccess->diskUnit = 1;
}
@@ -267,7 +274,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaConsole)
Param<Addr> addr;
SimObjectParam<System *> system;
SimObjectParam<BaseCPU *> cpu;
- SimObjectParam<TsunamiIO *> clock;
+ SimObjectParam<SimObject *> clock;
SimObjectParam<Bus*> io_bus;
SimObjectParam<HierParams *> hier;
@@ -282,7 +289,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaConsole)
INIT_PARAM(addr, "Device Address"),
INIT_PARAM(system, "system object"),
INIT_PARAM(cpu, "Processor"),
- INIT_PARAM(clock, "Turbolaser Clock"),
+ INIT_PARAM(clock, "Clock"),
INIT_PARAM_DFLT(io_bus, "The IO Bus to attach to", NULL),
INIT_PARAM_DFLT(hier, "Hierarchy global variables", &defaultHierParams)
diff --git a/dev/alpha_console.hh b/dev/alpha_console.hh
index be8538e50..4986d0e5f 100644
--- a/dev/alpha_console.hh
+++ b/dev/alpha_console.hh
@@ -38,6 +38,7 @@
#include "dev/io_device.hh"
#include "sim/host.hh"
#include "dev/tsunami_io.hh"
+#include "sim/sim_object.hh"
class BaseCPU;
class SimConsole;
@@ -90,7 +91,7 @@ class AlphaConsole : public PioDevice
public:
/** Standard Constructor */
AlphaConsole(const std::string &name, SimConsole *cons, SimpleDisk *d,
- System *system, BaseCPU *cpu, TsunamiIO *clock,
+ System *system, BaseCPU *cpu, SimObject *clock,
int num_cpus, MemoryController *mmu, Addr addr,
HierParams *hier, Bus *bus);
diff --git a/dev/pcidev.cc b/dev/pcidev.cc
index 0e0b7f840..2b2f54fce 100644
--- a/dev/pcidev.cc
+++ b/dev/pcidev.cc
@@ -53,8 +53,8 @@ using namespace std;
PciDev::PciDev(const string &name, MemoryController *mmu, PciConfigAll *cf,
PciConfigData *cd, uint32_t bus, uint32_t dev, uint32_t func)
- : FunctionalMemory(name), MMU(mmu), ConfigSpace(cf), ConfigData(cd),
- Bus(bus), Device(dev), Function(func)
+ : FunctionalMemory(name), MMU(mmu), configSpace(cf), configData(cd),
+ bus(bus), device(dev), function(func)
{
// copy the config data from the PciConfigData object
if (cd) {
@@ -79,21 +79,21 @@ PciDev::ReadConfig(int offset, int size, uint8_t *data)
memcpy((uint32_t*)data, config.data + offset, sizeof(uint32_t));
DPRINTF(PCIDEV,
"read device: %#x function: %#x register: %#x data: %#x\n",
- Device, Function, offset, *(uint32_t*)(config.data + offset));
+ device, function, offset, *(uint32_t*)(config.data + offset));
break;
case sizeof(uint16_t):
memcpy((uint16_t*)data, config.data + offset, sizeof(uint16_t));
DPRINTF(PCIDEV,
"read device: %#x function: %#x register: %#x data: %#x\n",
- Device, Function, offset, *(uint16_t*)(config.data + offset));
+ device, function, offset, *(uint16_t*)(config.data + offset));
break;
case sizeof(uint8_t):
memcpy((uint8_t*)data, config.data + offset, sizeof(uint8_t));
DPRINTF(PCIDEV,
"read device: %#x function: %#x register: %#x data: %#x\n",
- Device, Function, offset, (uint16_t)(*(uint8_t*)(config.data + offset)));
+ device, function, offset, (uint16_t)(*(uint8_t*)(config.data + offset)));
break;
default:
@@ -115,7 +115,7 @@ PciDev::WriteConfig(int offset, int size, uint32_t data)
DPRINTF(PCIDEV,
"write device: %#x function: %#x reg: %#x size: %#x data: %#x\n",
- Device, Function, offset, size, word_value);
+ device, function, offset, size, word_value);
barnum = (offset - PCI0_BASE_ADDR0) >> 2;
diff --git a/dev/pcidev.hh b/dev/pcidev.hh
index 6496791b2..1a45f5c7b 100644
--- a/dev/pcidev.hh
+++ b/dev/pcidev.hh
@@ -67,11 +67,11 @@ class PciDev : public FunctionalMemory
{
protected:
MemoryController *MMU;
- PciConfigAll *ConfigSpace;
- PciConfigData *ConfigData;
- uint32_t Bus;
- uint32_t Device;
- uint32_t Function;
+ PciConfigAll *configSpace;
+ PciConfigData *configData;
+ uint32_t bus;
+ uint32_t device;
+ uint32_t function;
PCIConfig config;
uint32_t BARSize[6];