diff options
author | Gabe Black <gabeblack@google.com> | 2018-10-12 04:57:29 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-12 23:44:38 +0000 |
commit | 413b4e7431b20d9b29dbf66d6677a60205ddd357 (patch) | |
tree | 8fb40a98f4b5b14e78240e2a3f5907344ff83658 /src/arch | |
parent | 2b979bd8913450355006fc9d9ccfa9dda21bbbb3 (diff) | |
download | gem5-413b4e7431b20d9b29dbf66d6677a60205ddd357.tar.xz |
x86: Use little endian packet accessors.
We know data is little endian, so we can use those accessors
explicitly.
Change-Id: I09aa7f1e525ad1346e932ce4a772b64bf59dc350
Reviewed-on: https://gem5-review.googlesource.com/c/13456
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/interrupts.cc | 2 | ||||
-rw-r--r-- | src/arch/x86/intmessage.hh | 2 | ||||
-rw-r--r-- | src/arch/x86/memhelpers.hh | 10 | ||||
-rw-r--r-- | src/arch/x86/pagetable_walker.cc | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/arch/x86/interrupts.cc b/src/arch/x86/interrupts.cc index 0ef79a472..8ba181948 100644 --- a/src/arch/x86/interrupts.cc +++ b/src/arch/x86/interrupts.cc @@ -312,7 +312,7 @@ X86ISA::Interrupts::recvMessage(PacketPtr pkt) { case 0: { - TriggerIntMessage message = pkt->get<TriggerIntMessage>(); + TriggerIntMessage message = pkt->getRaw<TriggerIntMessage>(); DPRINTF(LocalApic, "Got Trigger Interrupt message with vector %#x.\n", message.vector); diff --git a/src/arch/x86/intmessage.hh b/src/arch/x86/intmessage.hh index 83d80bb94..8ec60b2aa 100644 --- a/src/arch/x86/intmessage.hh +++ b/src/arch/x86/intmessage.hh @@ -94,7 +94,7 @@ namespace X86ISA buildIntRequest(const uint8_t id, T payload, Addr offset, Addr size) { PacketPtr pkt = prepIntRequest(id, offset, size); - pkt->set<T>(payload); + pkt->setRaw<T>(payload); return pkt; } diff --git a/src/arch/x86/memhelpers.hh b/src/arch/x86/memhelpers.hh index aa3617b43..416439b9e 100644 --- a/src/arch/x86/memhelpers.hh +++ b/src/arch/x86/memhelpers.hh @@ -56,16 +56,16 @@ getMem(PacketPtr pkt, uint64_t &mem, unsigned dataSize, { switch (dataSize) { case 1: - mem = pkt->get<uint8_t>(); + mem = pkt->getLE<uint8_t>(); break; case 2: - mem = pkt->get<uint16_t>(); + mem = pkt->getLE<uint16_t>(); break; case 4: - mem = pkt->get<uint32_t>(); + mem = pkt->getLE<uint32_t>(); break; case 8: - mem = pkt->get<uint64_t>(); + mem = pkt->getLE<uint64_t>(); break; default: panic("Unhandled size in getMem.\n"); @@ -78,7 +78,7 @@ template <typename T, size_t N> static void getPackedMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize) { - std::array<T, N> real_mem = pkt->get<std::array<T, N> >(); + std::array<T, N> real_mem = pkt->getLE<std::array<T, N> >(); for (int i = 0; i < N; i++) mem[i] = real_mem[i]; } diff --git a/src/arch/x86/pagetable_walker.cc b/src/arch/x86/pagetable_walker.cc index 11ec12245..4a405f25f 100644 --- a/src/arch/x86/pagetable_walker.cc +++ b/src/arch/x86/pagetable_walker.cc @@ -279,9 +279,9 @@ Walker::WalkerState::stepWalk(PacketPtr &write) write = NULL; PageTableEntry pte; if (dataSize == 8) - pte = read->get<uint64_t>(); + pte = read->getLE<uint64_t>(); else - pte = read->get<uint32_t>(); + pte = read->getLE<uint32_t>(); VAddr vaddr = entry.vaddr; bool uncacheable = pte.pcd; Addr nextRead = 0; @@ -522,7 +522,7 @@ Walker::WalkerState::stepWalk(PacketPtr &write) // value back to memory. if (doWrite) { write = oldRead; - write->set<uint64_t>(pte); + write->setLE<uint64_t>(pte); write->cmd = MemCmd::WriteReq; } else { write = NULL; |