@@ -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)
@@ -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);
+}
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- configure | 1 + target-ppc/misc_helper.c | 8 ++++++++ 2 files changed, 9 insertions(+)