diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-08-07 09:59:13 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-08-07 09:59:13 +0100 |
commit | 53e777d6838ac3ca80e6557626f9e99fd93dd0f7 (patch) | |
tree | 9029d3e7f1e158beac24761f2c9c690b3918d734 /src/dev/sinic.cc | |
parent | 3e26756f1dfe1ddd1d7f5e458771c9bf79acb09a (diff) | |
download | gem5-53e777d6838ac3ca80e6557626f9e99fd93dd0f7.tar.xz |
base: Declare a type for context IDs
Context IDs used to be declared as ad hoc (usually as int). This
changeset introduces a typedef for ContextIDs and a constant for
invalid context IDs.
Diffstat (limited to 'src/dev/sinic.cc')
-rw-r--r-- | src/dev/sinic.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dev/sinic.cc b/src/dev/sinic.cc index d4a3f19b3..a17f50864 100644 --- a/src/dev/sinic.cc +++ b/src/dev/sinic.cc @@ -152,7 +152,7 @@ Device::getEthPort(const std::string &if_name, int idx) void -Device::prepareIO(int cpu, int index) +Device::prepareIO(ContextID cpu, int index) { int size = virtualRegs.size(); if (index > size) @@ -165,7 +165,7 @@ Device::prepareIO(int cpu, int index) //add stats for average number of vnics busy void -Device::prepareRead(int cpu, int index) +Device::prepareRead(ContextID cpu, int index) { using namespace Regs; prepareIO(cpu, index); @@ -206,7 +206,7 @@ Device::prepareRead(int cpu, int index) } void -Device::prepareWrite(int cpu, int index) +Device::prepareWrite(ContextID cpu, int index) { prepareIO(cpu, index); } @@ -220,7 +220,7 @@ Device::read(PacketPtr pkt) assert(config.command & PCI_CMD_MSE); assert(pkt->getAddr() >= BARAddrs[0] && pkt->getSize() < BARSize[0]); - int cpu = pkt->req->contextId(); + ContextID cpu = pkt->req->contextId(); Addr daddr = pkt->getAddr() - BARAddrs[0]; Addr index = daddr >> Regs::VirtualShift; Addr raddr = daddr & Regs::VirtualMask; @@ -270,7 +270,7 @@ Device::read(PacketPtr pkt) * IPR read of device register Fault -Device::iprRead(Addr daddr, int cpu, uint64_t &result) +Device::iprRead(Addr daddr, ContextID cpu, uint64_t &result) { if (!regValid(daddr)) panic("invalid address: da=%#x", daddr); @@ -305,7 +305,7 @@ Device::write(PacketPtr pkt) assert(config.command & PCI_CMD_MSE); assert(pkt->getAddr() >= BARAddrs[0] && pkt->getSize() < BARSize[0]); - int cpu = pkt->req->contextId(); + ContextID cpu = pkt->req->contextId(); Addr daddr = pkt->getAddr() - BARAddrs[0]; Addr index = daddr >> Regs::VirtualShift; Addr raddr = daddr & Regs::VirtualMask; |