From 2737650a69f0c56d325c2d9cfd45eef099fbd581 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 11 Jul 2013 21:56:39 -0500 Subject: 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 --- src/dev/arm/amba_device.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/dev/arm/amba_device.cc') 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((amba_id >> byte) & 0xFF); return true; } - -} // namespace AmbaDev -- cgit v1.2.3