[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] target-ppc: ppc64 targets can be either endian.
From: |
Rusty Russell |
Subject: |
[Qemu-devel] [PATCH 2/7] target-ppc: ppc64 targets can be either endian. |
Date: |
Thu, 8 Aug 2013 14:45:43 +0930 |
Signed-off-by: Rusty Russell <address@hidden>
---
configure | 1 +
target-ppc/misc_helper.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/configure b/configure
index ad32f87..cee32af 100755
--- a/configure
+++ b/configure
@@ -4217,6 +4217,7 @@ case "$target_name" in
ppc64)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
+ echo "TARGET_VIRTIO_SWAPENDIAN=y" >> $config_target_mak
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml
power-spe.xml"
;;
ppc64abi32)
diff --git a/target-ppc/misc_helper.c b/target-ppc/misc_helper.c
index 616aab6..b031586 100644
--- a/target-ppc/misc_helper.c
+++ b/target-ppc/misc_helper.c
@@ -20,6 +20,7 @@
#include "helper.h"
#include "helper_regs.h"
+#include "hw/virtio/virtio-access.h"
/*****************************************************************************/
/* SPR accesses */
@@ -116,3 +117,10 @@ void ppc_store_msr(CPUPPCState *env, target_ulong value)
{
hreg_store_msr(env, value, 0);
}
+
+/* Our virtio accesses are LE if the first CPU is LE when they touch
+ * it. We assume endian doesn't change after that! */
+bool virtio_swap_endian(void)
+{
+ return first_cpu->hflags & (1 << MSR_LE);
+}
--
1.8.1.2
- [Qemu-devel] [PATCH 0/7] Virtio support for endian-curious guests., Rusty Russell, 2013/08/08
- [Qemu-devel] [PATCH 3/7] hw/net/virtio-net: use virtio wrappers to access headers., Rusty Russell, 2013/08/08
- [Qemu-devel] [PATCH 7/7] hw/char/virtio-serial-bus: use virtio wrappers to access headers., Rusty Russell, 2013/08/08
- [Qemu-devel] [PATCH 2/7] target-ppc: ppc64 targets can be either endian.,
Rusty Russell <=
- [Qemu-devel] [PATCH 4/7] hw/net/virtio-balloon: use virtio wrappers to access page frame numbers., Rusty Russell, 2013/08/08
- [Qemu-devel] [PATCH 6/7] hw/scsi/virtio-scsi: use virtio wrappers to access headers., Rusty Russell, 2013/08/08
- [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access, Rusty Russell, 2013/08/08