We base it on the OS endian, as reflected by the endianness of the
interrupt vectors.

Suggested-by: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Signed-off-by: Rusty Russell <ru...@rustcorp.com.au>
---
 target-ppc/misc_helper.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target-ppc/misc_helper.c b/target-ppc/misc_helper.c
index 616aab6..6c97c81 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.h"
 
 /*****************************************************************************/
 /* SPR accesses */
@@ -116,3 +117,11 @@ void ppc_store_msr(CPUPPCState *env, target_ulong value)
 {
     hreg_store_msr(env, value, 0);
 }
+
+bool virtio_get_byteswap(void)
+{
+    PowerPCCPU *cp = POWERPC_CPU(first_cpu);
+    CPUPPCState *env = &cp->env;
+
+    return env->spr[SPR_LPCR] & LPCR_ILE;
+}
-- 
1.8.1.2


Reply via email to