Message ID | 1376294363-4650-3-git-send-email-rusty@rustcorp.com.au |
---|---|
State | New |
Headers | show |
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; +}
We base it on the OS endian, as reflected by the endianness of the interrupt vectors. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- target-ppc/misc_helper.c | 9 +++++++++ 1 file changed, 9 insertions(+)