summaryrefslogtreecommitdiff
path: root/src/dev/arm
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-11-08 13:58:25 -0600
committerAli Saidi <Ali.Saidi@ARM.com>2010-11-08 13:58:25 -0600
commita1e82259759ce7290269aeca6742098f1adbf2fd (patch)
tree2f93b2fe1d64c24cac0e5405f9f5a7b388c57592 /src/dev/arm
parent432fa0aad6092d6a9252f6a9c83c8b36509c1341 (diff)
downloadgem5-a1e82259759ce7290269aeca6742098f1adbf2fd.tar.xz
ARM: Add checkpointing support
Diffstat (limited to 'src/dev/arm')
-rw-r--r--src/dev/arm/gic.cc44
-rw-r--r--src/dev/arm/pl011.cc42
-rw-r--r--src/dev/arm/rv_ctrl.cc2
-rw-r--r--src/dev/arm/timer_sp804.cc59
-rw-r--r--src/dev/arm/timer_sp804.hh4
5 files changed, 143 insertions, 8 deletions
diff --git a/src/dev/arm/gic.cc b/src/dev/arm/gic.cc
index eff7d94bb..ee8008144 100644
--- a/src/dev/arm/gic.cc
+++ b/src/dev/arm/gic.cc
@@ -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 *
diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc
index 555636f04..d8ea9409b 100644
--- a/src/dev/arm/pl011.cc
+++ b/src/dev/arm/pl011.cc
@@ -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 *
diff --git a/src/dev/arm/rv_ctrl.cc b/src/dev/arm/rv_ctrl.cc
index e2543426b..08ac07233 100644
--- a/src/dev/arm/rv_ctrl.cc
+++ b/src/dev/arm/rv_ctrl.cc
@@ -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 *
diff --git a/src/dev/arm/timer_sp804.cc b/src/dev/arm/timer_sp804.cc
index c662d35bb..f6bbfb515 100644
--- a/src/dev/arm/timer_sp804.cc
+++ b/src/dev/arm/timer_sp804.cc
@@ -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 *
diff --git a/src/dev/arm/timer_sp804.hh b/src/dev/arm/timer_sp804.hh
index 1039456ab..afb6e29ed 100644
--- a/src/dev/arm/timer_sp804.hh
+++ b/src/dev/arm/timer_sp804.hh
@@ -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 */