summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
Diffstat (limited to 'kern')
-rw-r--r--kern/freebsd/freebsd_system.cc5
-rw-r--r--kern/linux/linux_system.cc3
2 files changed, 5 insertions, 3 deletions
diff --git a/kern/freebsd/freebsd_system.cc b/kern/freebsd/freebsd_system.cc
index 283713d40..f3fe84e00 100644
--- a/kern/freebsd/freebsd_system.cc
+++ b/kern/freebsd/freebsd_system.cc
@@ -39,6 +39,7 @@
#include "mem/functional/memory_control.hh"
#include "mem/functional/physical.hh"
#include "sim/builder.hh"
+#include "sim/byteswap.hh"
#include "targetarch/vtophys.hh"
#define TIMER_FREQUENCY 1193180
@@ -82,8 +83,8 @@ FreebsdSystem::doCalibrateClocks(ExecContext *xc)
uint8_t *ppc = physmem->dma_addr(ppc_paddr, sizeof(uint32_t));
uint8_t *timer = physmem->dma_addr(timer_paddr, sizeof(uint32_t));
- *(uint32_t *)ppc = htog((uint32_t)Clock::Frequency);
- *(uint32_t *)timer = htog((uint32_t)TIMER_FREQUENCY);
+ *(uint32_t *)ppc = LittleEndianGuest::htog((uint32_t)Clock::Frequency);
+ *(uint32_t *)timer = LittleEndianGuest::htog((uint32_t)TIMER_FREQUENCY);
}
diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc
index 1144b9bdd..26a4c0d3e 100644
--- a/kern/linux/linux_system.cc
+++ b/kern/linux/linux_system.cc
@@ -44,6 +44,7 @@
#include "mem/functional/memory_control.hh"
#include "mem/functional/physical.hh"
#include "sim/builder.hh"
+#include "sim/byteswap.hh"
#include "dev/platform.hh"
#include "targetarch/arguments.hh"
#include "targetarch/vtophys.hh"
@@ -100,7 +101,7 @@ LinuxSystem::LinuxSystem(Params *p)
char *dp264_mv = (char *)physmem->dma_addr(paddr, sizeof(uint64_t));
if (dp264_mv) {
- *(uint32_t*)(dp264_mv+0x18) = htog((uint32_t)127);
+ *(uint32_t*)(dp264_mv+0x18) = LittleEndianGuest::htog((uint32_t)127);
} else
panic("could not translate dp264_mv addr\n");