Updated serialization code and added #if tracing so that make fast
builds dev/ide_ctrl.cc: added #if to remove variables that are optimized out. dev/tsunami_io.cc: dev/tsunami_io.hh: Updated serialization code --HG-- extra : convert_revision : b322a3299097cbd05b9b5bb8b0a80e9fa33bdc20
This commit is contained in:
parent
bfcb088281
commit
e937b38e2c
3 changed files with 71 additions and 17 deletions
|
@ -255,7 +255,10 @@ IdeController::cacheAccess(MemReqPtr &req)
|
||||||
void
|
void
|
||||||
IdeController::ReadConfig(int offset, int size, uint8_t *data)
|
IdeController::ReadConfig(int offset, int size, uint8_t *data)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if TRACING_ON
|
||||||
Addr origOffset = offset;
|
Addr origOffset = offset;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (offset < PCI_DEVICE_SPECIFIC) {
|
if (offset < PCI_DEVICE_SPECIFIC) {
|
||||||
PciDev::ReadConfig(offset, size, data);
|
PciDev::ReadConfig(offset, size, data);
|
||||||
|
|
|
@ -76,6 +76,22 @@ TsunamiIO::RTCEvent::description()
|
||||||
return "tsunami RTC 1024Hz interrupt";
|
return "tsunami RTC 1024Hz interrupt";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TsunamiIO::RTCEvent::serialize(std::ostream &os)
|
||||||
|
{
|
||||||
|
Tick time = when();
|
||||||
|
SERIALIZE_SCALAR(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TsunamiIO::RTCEvent::unserialize(Checkpoint *cp, const std::string §ion)
|
||||||
|
{
|
||||||
|
Tick time;
|
||||||
|
UNSERIALIZE_SCALAR(time);
|
||||||
|
reschedule(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Timer Event for PIT Timers
|
// Timer Event for PIT Timers
|
||||||
TsunamiIO::ClockEvent::ClockEvent()
|
TsunamiIO::ClockEvent::ClockEvent()
|
||||||
: Event(&mainEventQueue)
|
: Event(&mainEventQueue)
|
||||||
|
@ -122,6 +138,27 @@ TsunamiIO::ClockEvent::Status()
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TsunamiIO::ClockEvent::serialize(std::ostream &os)
|
||||||
|
{
|
||||||
|
Tick time = when();
|
||||||
|
SERIALIZE_SCALAR(time);
|
||||||
|
SERIALIZE_SCALAR(status);
|
||||||
|
SERIALIZE_SCALAR(mode);
|
||||||
|
SERIALIZE_SCALAR(interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TsunamiIO::ClockEvent::unserialize(Checkpoint *cp, const std::string §ion)
|
||||||
|
{
|
||||||
|
Tick time;
|
||||||
|
UNSERIALIZE_SCALAR(time);
|
||||||
|
UNSERIALIZE_SCALAR(status);
|
||||||
|
UNSERIALIZE_SCALAR(mode);
|
||||||
|
UNSERIALIZE_SCALAR(interval);
|
||||||
|
schedule(time);
|
||||||
|
}
|
||||||
|
|
||||||
TsunamiIO::TsunamiIO(const string &name, Tsunami *t, time_t init_time,
|
TsunamiIO::TsunamiIO(const string &name, Tsunami *t, time_t init_time,
|
||||||
Addr a, MemoryController *mmu, HierParams *hier, Bus *bus)
|
Addr a, MemoryController *mmu, HierParams *hier, Bus *bus)
|
||||||
: PioDevice(name), addr(a), tsunami(t), rtc(t)
|
: PioDevice(name), addr(a), tsunami(t), rtc(t)
|
||||||
|
@ -250,8 +287,11 @@ TsunamiIO::read(MemReqPtr &req, uint8_t *data)
|
||||||
Fault
|
Fault
|
||||||
TsunamiIO::write(MemReqPtr &req, const uint8_t *data)
|
TsunamiIO::write(MemReqPtr &req, const uint8_t *data)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if TRACING_ON
|
||||||
uint8_t dt = *(uint8_t*)data;
|
uint8_t dt = *(uint8_t*)data;
|
||||||
uint64_t dt64 = dt;
|
uint64_t dt64 = dt;
|
||||||
|
#endif
|
||||||
|
|
||||||
DPRINTF(Tsunami, "io write - va=%#x size=%d IOPort=%#x Data=%#x\n",
|
DPRINTF(Tsunami, "io write - va=%#x size=%d IOPort=%#x Data=%#x\n",
|
||||||
req->vaddr, req->size, req->vaddr & 0xfff, dt64);
|
req->vaddr, req->size, req->vaddr & 0xfff, dt64);
|
||||||
|
@ -399,12 +439,6 @@ TsunamiIO::serialize(std::ostream &os)
|
||||||
SERIALIZE_SCALAR(mode2);
|
SERIALIZE_SCALAR(mode2);
|
||||||
SERIALIZE_SCALAR(picr);
|
SERIALIZE_SCALAR(picr);
|
||||||
SERIALIZE_SCALAR(picInterrupting);
|
SERIALIZE_SCALAR(picInterrupting);
|
||||||
Tick time0when = timer0.when();
|
|
||||||
Tick time2when = timer2.when();
|
|
||||||
Tick rtcwhen = rtc.when();
|
|
||||||
SERIALIZE_SCALAR(time0when);
|
|
||||||
SERIALIZE_SCALAR(time2when);
|
|
||||||
SERIALIZE_SCALAR(rtcwhen);
|
|
||||||
SERIALIZE_SCALAR(RTCAddress);
|
SERIALIZE_SCALAR(RTCAddress);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -420,15 +454,6 @@ TsunamiIO::unserialize(Checkpoint *cp, const std::string §ion)
|
||||||
UNSERIALIZE_SCALAR(mode2);
|
UNSERIALIZE_SCALAR(mode2);
|
||||||
UNSERIALIZE_SCALAR(picr);
|
UNSERIALIZE_SCALAR(picr);
|
||||||
UNSERIALIZE_SCALAR(picInterrupting);
|
UNSERIALIZE_SCALAR(picInterrupting);
|
||||||
Tick time0when;
|
|
||||||
Tick time2when;
|
|
||||||
Tick rtcwhen;
|
|
||||||
UNSERIALIZE_SCALAR(time0when);
|
|
||||||
UNSERIALIZE_SCALAR(time2when);
|
|
||||||
UNSERIALIZE_SCALAR(rtcwhen);
|
|
||||||
timer0.schedule(time0when);
|
|
||||||
timer2.schedule(time2when);
|
|
||||||
rtc.reschedule(rtcwhen);
|
|
||||||
UNSERIALIZE_SCALAR(RTCAddress);
|
UNSERIALIZE_SCALAR(RTCAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,19 @@ class TsunamiIO : public PioDevice
|
||||||
*/
|
*/
|
||||||
uint8_t Status();
|
uint8_t Status();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize this object to the given output stream.
|
||||||
|
* @param os The stream to serialize to.
|
||||||
|
*/
|
||||||
|
virtual void serialize(std::ostream &os);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reconstruct the state of this object from a checkpoint.
|
||||||
|
* @param cp The checkpoint use.
|
||||||
|
* @param section The section name of this object
|
||||||
|
*/
|
||||||
|
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,6 +149,19 @@ class TsunamiIO : public PioDevice
|
||||||
*/
|
*/
|
||||||
virtual const char *description();
|
virtual const char *description();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize this object to the given output stream.
|
||||||
|
* @param os The stream to serialize to.
|
||||||
|
*/
|
||||||
|
virtual void serialize(std::ostream &os);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reconstruct the state of this object from a checkpoint.
|
||||||
|
* @param cp The checkpoint use.
|
||||||
|
* @param section The section name of this object
|
||||||
|
*/
|
||||||
|
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** uip UpdateInProgess says that the rtc is updating, but we just fake it
|
/** uip UpdateInProgess says that the rtc is updating, but we just fake it
|
||||||
|
|
Loading…
Reference in a new issue