From 0622f30961fc32b967bb1ef784afc5a205b16f6e Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 19 Feb 2013 05:56:05 -0500 Subject: 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. --- src/cpu/testers/rubytest/RubyTester.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/cpu/testers/rubytest/RubyTester.cc') diff --git a/src/cpu/testers/rubytest/RubyTester.cc b/src/cpu/testers/rubytest/RubyTester.cc index 085647533..68f76f1a6 100644 --- a/src/cpu/testers/rubytest/RubyTester.cc +++ b/src/cpu/testers/rubytest/RubyTester.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 ARM Limited + * Copyright (c) 2012-2013 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -149,17 +149,13 @@ RubyTester::CpuPort::recvTimingResp(PacketPtr pkt) // retrieve the subblock and call hitCallback RubyTester::SenderState* senderState = safe_cast(pkt->senderState); - SubBlock* subblock = senderState->subBlock; - assert(subblock != NULL); + SubBlock& subblock = senderState->subBlock; - // pop the sender state from the packet - pkt->senderState = senderState->saved; - - tester->hitCallback(id, subblock); + tester->hitCallback(id, &subblock); // Now that the tester has completed, delete the senderState // (includes sublock) and the packet, then return - delete senderState; + delete pkt->senderState; delete pkt->req; delete pkt; return true; -- cgit v1.2.3