alpha: Convert htog and gtoh to htole and letoh.
authorGabe Black <gabeblack@google.com>
Tue, 29 Oct 2019 23:01:17 +0000 (16:01 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 31 Oct 2019 01:28:59 +0000 (01:28 +0000)
When within the Alpha arch, we know the guest endianness already.

Change-Id: Iee22a33451a06c6e6a5c7d1e8c71f0b00e98ae3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22367
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/arch/alpha/linux/process.cc
src/arch/alpha/linux/system.cc
src/arch/alpha/process.cc
src/arch/alpha/system.cc

index 322a5b9fecfd7e85777953b3bfa703be615a5764..1ac53a5a0f64a365d0a73d1439a294d739dbde3a 100644 (file)
@@ -141,7 +141,7 @@ osf_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
           // I don't think this exactly matches the HW FPCR
           fpcr.copyIn(tc->getVirtProxy());
           DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): "
-                   " setting FPCR to 0x%x\n", gtoh(*(uint64_t*)fpcr));
+                   " setting FPCR to 0x%x\n", letoh(*(uint64_t*)fpcr));
           return 0;
       }
 
index 89d18f6f661db2dc6ff8e71546ab168c4622204f..b699d6d1ccfb1b12ddb6044af886987f63ce8e0b 100644 (file)
@@ -110,7 +110,7 @@ LinuxAlphaSystem::initState()
      * 255 ASNs.
      */
     if (kernelSymtab->findAddress("dp264_mv", addr))
-        virtProxy.write(addr + 0x18, LittleEndianGuest::htog((uint32_t)127));
+        virtProxy.write(addr + 0x18, htole((uint32_t)127));
     else
         panic("could not find dp264_mv\n");
 
index 11fa187b134c565f1e9cf211398752bae5d7c82f..314769535a3ea0f9b283cdab0c9d44c2602aa90f 100644 (file)
@@ -148,9 +148,9 @@ AlphaProcess::argsInit(int intSize, int pageSize)
     // write contents to stack
     uint64_t argc = argv.size();
     if (intSize == 8)
-        argc = htog((uint64_t)argc);
+        argc = htole((uint64_t)argc);
     else if (intSize == 4)
-        argc = htog((uint32_t)argc);
+        argc = htole((uint32_t)argc);
     else
         panic("Unknown int size");
 
index a7a47036a63d120a744a8f0496406a872b5b54b8..ca4551f6062b5d3534a56f7f5012803d80ddc00d 100644 (file)
@@ -129,9 +129,9 @@ AlphaSystem::initState()
      */
     if (consoleSymtab->findAddress("m5_rpb", addr)) {
         uint64_t data;
-        data = htog(params()->system_type);
+        data = htole(params()->system_type);
         virtProxy.write(addr+0x50, data);
-        data = htog(params()->system_rev);
+        data = htole(params()->system_rev);
         virtProxy.write(addr+0x58, data);
     } else
         panic("could not find hwrpb\n");
@@ -212,7 +212,7 @@ AlphaSystem::setAlphaAccess(Addr access)
 {
     Addr addr = 0;
     if (consoleSymtab->findAddress("m5AlphaAccess", addr)) {
-        virtProxy.write(addr, htog(Phys2K0Seg(access)));
+        virtProxy.write(addr, htole(Phys2K0Seg(access)));
     } else {
         panic("could not find m5AlphaAccess\n");
     }