summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:05 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:05 -0500
commit0622f30961fc32b967bb1ef784afc5a205b16f6e (patch)
treeb6b57cf049b7fc7e49cc65a735af7508862b9c24 /src/arch/x86
parentf69d431ede9b815ea4b63a2d20237ed3e79df169 (diff)
downloadgem5-0622f30961fc32b967bb1ef784afc5a205b16f6e.tar.xz
mem: Add predecessor to SenderState base class
This patch adds a predecessor field to the SenderState base class to make the process of linking them up more uniform, and enable a traversal of the stack without knowing the specific type of the subclasses. There are a number of simplifications done as part of changing the SenderState, particularly in the RubyTest.
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/pagetable_walker.cc5
-rw-r--r--src/arch/x86/pagetable_walker.hh6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/arch/x86/pagetable_walker.cc b/src/arch/x86/pagetable_walker.cc
index b096fbfe8..c768bb428 100644
--- a/src/arch/x86/pagetable_walker.cc
+++ b/src/arch/x86/pagetable_walker.cc
@@ -123,8 +123,7 @@ bool
Walker::recvTimingResp(PacketPtr pkt)
{
WalkerSenderState * senderState =
- dynamic_cast<WalkerSenderState *>(pkt->senderState);
- pkt->senderState = senderState->saved;
+ dynamic_cast<WalkerSenderState *>(pkt->popSenderState());
WalkerState * senderWalk = senderState->senderWalk;
bool walkComplete = senderWalk->recvPacket(pkt);
delete senderState;
@@ -169,7 +168,7 @@ Walker::recvRetry()
bool Walker::sendTiming(WalkerState* sendingState, PacketPtr pkt)
{
- pkt->senderState = new WalkerSenderState(sendingState, pkt->senderState);
+ pkt->pushSenderState(new WalkerSenderState(sendingState));
return port.sendTimingReq(pkt);
}
diff --git a/src/arch/x86/pagetable_walker.hh b/src/arch/x86/pagetable_walker.hh
index 07f476b00..c2781ca1b 100644
--- a/src/arch/x86/pagetable_walker.hh
+++ b/src/arch/x86/pagetable_walker.hh
@@ -157,10 +157,8 @@ namespace X86ISA
struct WalkerSenderState : public Packet::SenderState
{
WalkerState * senderWalk;
- Packet::SenderState * saved;
- WalkerSenderState(WalkerState * _senderWalk,
- Packet::SenderState * _saved) :
- senderWalk(_senderWalk), saved(_saved) {}
+ WalkerSenderState(WalkerState * _senderWalk) :
+ senderWalk(_senderWalk) {}
};
public: