diff options
author | Steve Reinhardt <stever@gmail.com> | 2013-07-11 21:56:39 -0500 |
---|---|---|
committer | Steve Reinhardt <stever@gmail.com> | 2013-07-11 21:56:39 -0500 |
commit | 2737650a69f0c56d325c2d9cfd45eef099fbd581 (patch) | |
tree | 7e1a7030cdfb961d074729397b6f2c1e24f41e43 /src/dev/arm/amba_device.cc | |
parent | b0b1c0205c438d382aaec54ee4b79b92e1a5e285 (diff) | |
download | gem5-2737650a69f0c56d325c2d9cfd45eef099fbd581.tar.xz |
dev/arm: get rid of AmbaDev namespace
It was confusing having an AmbaDev namespace along with an
AmbaDevice class. The namespace stuff is now moved in to
a new base AmbaDevice class, which is a mixin for classes
AmbaPioDevice (the former AmbaDevice) and AmbaDmaDevice
to provide the readId function as an inherited member function.
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/dev/arm/amba_device.cc')
-rw-r--r-- | src/dev/arm/amba_device.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/dev/arm/amba_device.cc b/src/dev/arm/amba_device.cc index a9a163fd2..617a67d79 100644 --- a/src/dev/arm/amba_device.cc +++ b/src/dev/arm/amba_device.cc @@ -49,13 +49,13 @@ const uint64_t AmbaVendor = ULL(0xb105f00d00000000); -AmbaDevice::AmbaDevice(const Params *p) +AmbaPioDevice::AmbaPioDevice(const Params *p) : BasicPioDevice(p), ambaId(AmbaVendor | p->amba_id) { } AmbaIntDevice::AmbaIntDevice(const Params *p) - : AmbaDevice(p), intNum(p->int_num), gic(p->gic), intDelay(p->int_delay) + : AmbaPioDevice(p), intNum(p->int_num), gic(p->gic), intDelay(p->int_delay) { } @@ -68,9 +68,8 @@ AmbaDmaDevice::AmbaDmaDevice(const Params *p) { } -namespace AmbaDev { bool -readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr) +AmbaDevice::readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr) { Addr daddr = pkt->getAddr() - pio_addr; if (daddr < AMBA_PER_ID0 || daddr > AMBA_CEL_ID3) @@ -80,11 +79,10 @@ readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr) int byte = (daddr - AMBA_PER_ID0) << 1; // Too noisy right now - DPRINTF(AMBA, "Returning %#x for offset %#x(%d)\n", (amba_id >> byte) & 0xFF, + DPRINTF(AMBA, "Returning %#x for offset %#x(%d)\n", + (amba_id >> byte) & 0xFF, pkt->getAddr() - pio_addr, byte); assert(pkt->getSize() == 4); pkt->set<uint32_t>((amba_id >> byte) & 0xFF); return true; } - -} // namespace AmbaDev |