mem: Add const getters for write packet data
This patch takes a first step in tightening up how we use the data pointer in write packets. A const getter is added for the pointer itself (getConstPtr), and a number of member functions are also made const accordingly. In a range of places throughout the memory system the new member is used. The patch also removes the unused isReadWrite function.
This commit is contained in:
@@ -173,6 +173,7 @@ MemTest::completeRequest(PacketPtr pkt)
|
||||
safe_cast<MemTestSenderState *>(pkt->senderState);
|
||||
|
||||
uint8_t *data = state->data;
|
||||
// @todo: This should really be a const pointer
|
||||
uint8_t *pkt_data = pkt->getPtr<uint8_t>();
|
||||
|
||||
//Remove the address from the list of outstanding
|
||||
|
||||
@@ -197,7 +197,7 @@ Check::initiateAction()
|
||||
pkt->dataDynamic(writeData);
|
||||
|
||||
DPRINTF(RubyTest, "data 0x%x check 0x%x\n",
|
||||
*(pkt->getPtr<uint8_t>()), *writeData);
|
||||
*(pkt->getConstPtr<uint8_t>()), *writeData);
|
||||
|
||||
// push the subblock onto the sender state. The sequencer will
|
||||
// update the subblock on the return
|
||||
|
||||
Reference in New Issue
Block a user