ARM: Add checkpointing support

This commit is contained in:
Ali Saidi
2010-11-08 13:58:25 -06:00
parent 432fa0aad6
commit a1e8225975
18 changed files with 268 additions and 65 deletions

View File

@@ -495,13 +495,53 @@ Gic::addressRanges(AddrRangeList &range_list)
void
Gic::serialize(std::ostream &os)
{
panic("Need to implement serialization\n");
DPRINTF(Checkpoint, "Serializing Arm GIC\n");
SERIALIZE_SCALAR(distAddr);
SERIALIZE_SCALAR(cpuAddr);
SERIALIZE_SCALAR(distPioDelay);
SERIALIZE_SCALAR(cpuPioDelay);
SERIALIZE_SCALAR(enabled);
SERIALIZE_SCALAR(itLines);
SERIALIZE_SCALAR(itLinesLog2);
SERIALIZE_ARRAY(intEnabled, 32);
SERIALIZE_ARRAY(pendingInt, 32);
SERIALIZE_ARRAY(activeInt, 32);
SERIALIZE_ARRAY(iccrpr, 8);
SERIALIZE_ARRAY(intPriority, 1020);
SERIALIZE_ARRAY(cpuTarget, 1020);
SERIALIZE_ARRAY(intConfig, 64);
SERIALIZE_ARRAY(cpuEnabled, 8);
SERIALIZE_ARRAY(cpuPriority, 8);
SERIALIZE_ARRAY(cpuBpr, 8);
SERIALIZE_ARRAY(cpuHighestInt, 8);
SERIALIZE_SCALAR(irqEnable);
}
void
Gic::unserialize(Checkpoint *cp, const std::string &section)
{
panic("Need to implement serialization\n");
DPRINTF(Checkpoint, "Unserializing Arm GIC\n");
UNSERIALIZE_SCALAR(distAddr);
UNSERIALIZE_SCALAR(cpuAddr);
UNSERIALIZE_SCALAR(distPioDelay);
UNSERIALIZE_SCALAR(cpuPioDelay);
UNSERIALIZE_SCALAR(enabled);
UNSERIALIZE_SCALAR(itLines);
UNSERIALIZE_SCALAR(itLinesLog2);
UNSERIALIZE_ARRAY(intEnabled, 32);
UNSERIALIZE_ARRAY(pendingInt, 32);
UNSERIALIZE_ARRAY(activeInt, 32);
UNSERIALIZE_ARRAY(iccrpr, 8);
UNSERIALIZE_ARRAY(intPriority, 1020);
UNSERIALIZE_ARRAY(cpuTarget, 1020);
UNSERIALIZE_ARRAY(intConfig, 64);
UNSERIALIZE_ARRAY(cpuEnabled, 8);
UNSERIALIZE_ARRAY(cpuPriority, 8);
UNSERIALIZE_ARRAY(cpuBpr, 8);
UNSERIALIZE_ARRAY(cpuHighestInt, 8);
UNSERIALIZE_SCALAR(irqEnable);
}
Gic *

View File

@@ -274,13 +274,51 @@ Pl011::generateInterrupt()
void
Pl011::serialize(std::ostream &os)
{
panic("Need to implement serialization\n");
DPRINTF(Checkpoint, "Serializing Arm PL011\n");
SERIALIZE_SCALAR(control);
SERIALIZE_SCALAR(fbrd);
SERIALIZE_SCALAR(ibrd);
SERIALIZE_SCALAR(lcrh);
SERIALIZE_SCALAR(ifls);
uint16_t imsc_serial = imsc;
SERIALIZE_SCALAR(imsc_serial);
uint16_t rawInt_serial = rawInt;
SERIALIZE_SCALAR(rawInt_serial);
uint16_t maskInt_serial = maskInt;
SERIALIZE_SCALAR(maskInt_serial);
SERIALIZE_SCALAR(endOnEOT);
SERIALIZE_SCALAR(intDelay);
}
void
Pl011::unserialize(Checkpoint *cp, const std::string &section)
{
panic("Need to implement serialization\n");
DPRINTF(Checkpoint, "Unserializing Arm PL011\n");
UNSERIALIZE_SCALAR(control);
UNSERIALIZE_SCALAR(fbrd);
UNSERIALIZE_SCALAR(ibrd);
UNSERIALIZE_SCALAR(lcrh);
UNSERIALIZE_SCALAR(ifls);
uint16_t imsc_serial;
UNSERIALIZE_SCALAR(imsc_serial);
imsc = imsc_serial;
uint16_t rawInt_serial;
UNSERIALIZE_SCALAR(rawInt_serial);
rawInt = rawInt_serial;
uint16_t maskInt_serial;
UNSERIALIZE_SCALAR(maskInt_serial);
maskInt = maskInt_serial;
UNSERIALIZE_SCALAR(endOnEOT);
UNSERIALIZE_SCALAR(intDelay);
}
Pl011 *

View File

@@ -97,13 +97,11 @@ RealViewCtrl::write(PacketPtr pkt)
void
RealViewCtrl::serialize(std::ostream &os)
{
panic("Need to implement serialization\n");
}
void
RealViewCtrl::unserialize(Checkpoint *cp, const std::string &section)
{
panic("Need to implement serialization\n");
}
RealViewCtrl *

View File

@@ -219,17 +219,72 @@ Sp804::Timer::counterAtZero()
restartCounter(loadValue);
}
void
Sp804::Timer::serialize(std::ostream &os)
{
DPRINTF(Checkpoint, "Serializing Arm Sp804\n");
SERIALIZE_SCALAR(intNum);
SERIALIZE_SCALAR(clock);
uint32_t control_serial = control;
SERIALIZE_SCALAR(control_serial);
SERIALIZE_SCALAR(rawInt);
SERIALIZE_SCALAR(pendingInt);
SERIALIZE_SCALAR(loadValue);
bool is_in_event = zeroEvent.scheduled();
SERIALIZE_SCALAR(is_in_event);
Tick event_time;
if (is_in_event){
event_time = zeroEvent.when();
SERIALIZE_SCALAR(event_time);
}
}
void
Sp804::Timer::unserialize(Checkpoint *cp, const std::string &section)
{
DPRINTF(Checkpoint, "Unserializing Arm Sp804\n");
UNSERIALIZE_SCALAR(intNum);
UNSERIALIZE_SCALAR(clock);
uint32_t control_serial;
UNSERIALIZE_SCALAR(control_serial);
control = control_serial;
UNSERIALIZE_SCALAR(rawInt);
UNSERIALIZE_SCALAR(pendingInt);
UNSERIALIZE_SCALAR(loadValue);
bool is_in_event;
UNSERIALIZE_SCALAR(is_in_event);
Tick event_time;
if (is_in_event){
UNSERIALIZE_SCALAR(event_time);
parent->schedule(zeroEvent, event_time);
}
}
void
Sp804::serialize(std::ostream &os)
{
panic("Need to implement serialization\n");
nameOut(os, csprintf("%s.timer0", name()));
timer0.serialize(os);
nameOut(os, csprintf("%s.timer1", name()));
timer1.serialize(os);
}
void
Sp804::unserialize(Checkpoint *cp, const std::string &section)
{
panic("Need to implement serialization\n");
timer0.unserialize(cp, csprintf("%s.timer0", section));
timer1.unserialize(cp, csprintf("%s.timer1", section));
}
Sp804 *

View File

@@ -121,6 +121,10 @@ class Sp804 : public AmbaDevice
/** Handle write for a single timer */
void write(PacketPtr pkt, Addr daddr);
void serialize(std::ostream &os);
void unserialize(Checkpoint *cp, const std::string &section);
};
/** Pointer to the GIC for causing an interrupt */