summaryrefslogtreecommitdiff
path: root/src/dev/i2c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-12 05:06:26 -0700
committerGabe Black <gabeblack@google.com>2018-10-17 20:17:44 +0000
commit2bcb2b031d4419e87337b25936a09228955dc715 (patch)
tree1da2953b4764a66bca23dfcf1656f4af205206d5 /src/dev/i2c
parent2701fcb2ffe76e2cb087807e87a9114d0009b7db (diff)
downloadgem5-2bcb2b031d4419e87337b25936a09228955dc715.tar.xz
dev: Explicitly specify the endianness for packet accessors.
Generally speaking, the endianness of the data devices provide or accept is dependent on the device and not the ISA the system executes. This change makes the devices in dev pick an endianness rather than using the guest's. For the ISA bus and the UART, accesses are byte sized and so endianness doesn't matter. The ISA and PCI busses and the devices which use them are defined to be little endian. Change-Id: Ib0aa70f192e1d6f3b886d9f3ad41ae03bddb583f Reviewed-on: https://gem5-review.googlesource.com/c/13462 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/dev/i2c')
-rw-r--r--src/dev/i2c/bus.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dev/i2c/bus.cc b/src/dev/i2c/bus.cc
index bf8cb8701..ede9d525b 100644
--- a/src/dev/i2c/bus.cc
+++ b/src/dev/i2c/bus.cc
@@ -72,7 +72,7 @@ I2CBus::read(PacketPtr pkt)
{
assert(pkt->getAddr() == pioAddr + SB_CONTROLS);
- pkt->set<uint8_t>((sda << 1) | scl);
+ pkt->setRaw<uint8_t>((sda << 1) | scl);
pkt->makeAtomicResponse();
return pioDelay;
}
@@ -172,7 +172,7 @@ I2CBus::write(PacketPtr pkt)
void
I2CBus::updateSignals(PacketPtr pkt)
{
- uint8_t msg = pkt->get<uint8_t>();
+ uint8_t msg = pkt->getRaw<uint8_t>();
Addr daddr = pkt->getAddr() - pioAddr;
switch (daddr) {
@@ -192,7 +192,7 @@ I2CBus::updateSignals(PacketPtr pkt)
bool
I2CBus::isClockSet(PacketPtr pkt) const
{
- uint8_t msg = pkt->get<uint8_t>();
+ uint8_t msg = pkt->getRaw<uint8_t>();
Addr daddr = pkt->getAddr() - pioAddr;
return daddr == SB_CONTROLS && (msg & 1);
}
@@ -200,7 +200,7 @@ I2CBus::isClockSet(PacketPtr pkt) const
bool
I2CBus::isStart(PacketPtr pkt) const
{
- uint8_t msg = pkt->get<uint8_t>();
+ uint8_t msg = pkt->getRaw<uint8_t>();
Addr daddr = pkt->getAddr() - pioAddr;
return scl && (msg & 2) && daddr == SB_CONTROLC;
}
@@ -208,7 +208,7 @@ I2CBus::isStart(PacketPtr pkt) const
bool
I2CBus::isEnd(PacketPtr pkt) const
{
- uint8_t msg = pkt->get<uint8_t>();
+ uint8_t msg = pkt->getRaw<uint8_t>();
Addr daddr = pkt->getAddr() - pioAddr;
return scl && (msg & 2) && daddr == SB_CONTROLS;
}