summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-10-10 23:42:31 -0700
committerGabe Black <gblack@eecs.umich.edu>2008-10-10 23:42:31 -0700
commitf85a7f00c0a9da6181fb803d760b1378fbc8bd27 (patch)
tree8fbe60a1bfdeccba1e14db7fdc9e4bcad43d9dc9 /src
parentb03c95d075b74913313576e6e1fa4fc6b1f4dcb2 (diff)
downloadgem5-f85a7f00c0a9da6181fb803d760b1378fbc8bd27.tar.xz
X86: Make the time on the RTC configurable.
Diffstat (limited to 'src')
-rw-r--r--src/dev/x86/south_bridge/SouthBridge.py2
-rw-r--r--src/dev/x86/south_bridge/cmos.hh17
-rw-r--r--src/dev/x86/south_bridge/south_bridge.cc2
3 files changed, 8 insertions, 13 deletions
diff --git a/src/dev/x86/south_bridge/SouthBridge.py b/src/dev/x86/south_bridge/SouthBridge.py
index bec3c4223..9e1b66896 100644
--- a/src/dev/x86/south_bridge/SouthBridge.py
+++ b/src/dev/x86/south_bridge/SouthBridge.py
@@ -32,4 +32,6 @@ from Device import PioDevice
class SouthBridge(PioDevice):
type = 'SouthBridge'
+ time = Param.Time('01/01/2009',
+ "System time to use ('Now' for actual time)")
pio_latency = Param.Latency('1ns', "Programmed IO latency in simticks")
diff --git a/src/dev/x86/south_bridge/cmos.hh b/src/dev/x86/south_bridge/cmos.hh
index 1cb22fa9e..585d9351e 100644
--- a/src/dev/x86/south_bridge/cmos.hh
+++ b/src/dev/x86/south_bridge/cmos.hh
@@ -44,8 +44,6 @@ class Cmos : public SubDevice
protected:
uint8_t address;
- struct tm foo_time;
-
static const int numRegs = 128;
uint8_t regs[numRegs];
@@ -70,22 +68,17 @@ class Cmos : public SubDevice
public:
- Cmos(EventManager *em) : rtc(em, "rtc", foo_time, true, ULL(5000000000))
- {
- memset(regs, 0, numRegs * sizeof(uint8_t));
- address = 0;
- }
-
- Cmos(EventManager *em, Tick _latency) : SubDevice(_latency),
- rtc(em, "rtc", foo_time, true, ULL(5000000000))
+ Cmos(EventManager *em, Tick _latency, struct tm time) :
+ SubDevice(_latency), rtc(em, "rtc", time, true, ULL(5000000000))
{
memset(regs, 0, numRegs * sizeof(uint8_t));
address = 0;
}
- Cmos(EventManager *em, Addr start, Addr size, Tick _latency) :
+ Cmos(EventManager *em, Addr start, Addr size,
+ Tick _latency, struct tm time) :
SubDevice(start, size, _latency),
- rtc(em, "rtc", foo_time, true, ULL(5000000000))
+ rtc(em, "rtc", time, true, ULL(5000000000))
{
memset(regs, 0, numRegs * sizeof(uint8_t));
address = 0;
diff --git a/src/dev/x86/south_bridge/south_bridge.cc b/src/dev/x86/south_bridge/south_bridge.cc
index ded5d7ac5..fda5acbda 100644
--- a/src/dev/x86/south_bridge/south_bridge.cc
+++ b/src/dev/x86/south_bridge/south_bridge.cc
@@ -70,7 +70,7 @@ SouthBridge::SouthBridge(const Params *p) : PioDevice(p),
pic1(0x20, 2, p->pio_latency),
pic2(0xA0, 2, p->pio_latency),
pit(this, p->name + ".pit", 0x40, 4, p->pio_latency),
- cmos(this, 0x70, 2, p->pio_latency),
+ cmos(this, 0x70, 2, p->pio_latency, p->time),
speaker(&pit, 0x61, 1, p->pio_latency)
{
addDevice(pic1);