Skip to contentSkip to conversation

PPC little-endian mode support

Qemu-devel J. Mayer 2 participants 2 messages Apr 18, 2005 – Apr 22, 2005

lore
Share & tools
lore

J. Mayer

author
#0 lore raw

This patch adds little-endian mode support to PPC emulation. This is needed by OS/2 and Windows NT and some programs like VirtualPC. This patch have been tested using OS/2 bootloader (thanks to Tero Kaarlela).

Signature · 2 lines
J. Mayer <[email protected]>
Never organized

Index: cpu-exec.c
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-exec.c,v
retrieving revision 1.53

cpu-exec.c +2 -1
diff -u -d -w -B -b -d -p -r1.53 cpu-exec.c
@@ -364,7 +364,8 @@ int cpu_exec(CPUState *env1)
                 cs_base = env->npc;
                 pc = env->pc;
 #elif defined(TARGET_PPC)
-                flags = (msr_pr << MSR_PR) | (msr_fp << MSR_FP) | (msr_se << MSR_SE);
+                flags = (msr_pr << MSR_PR) | (msr_fp << MSR_FP) |
+                    (msr_se << MSR_SE) | (msr_le << MSR_LE);
                 cs_base = 0;
                 pc = env->nip;
 #else

Index: disas.c
===================================================================
RCS file: /cvsroot/qemu/qemu/disas.c,v
retrieving revision 1.20

disas.c +2 -0
diff -u -d -w -B -b -d -p -r1.20 disas.c
@@ -141,6 +141,8 @@ void target_disas(FILE *out, target_ulon
 #elif defined(TARGET_SPARC)
     print_insn = print_insn_sparc;
 #elif defined(TARGET_PPC)
+    if (cpu_single_env->msr[MSR_LE])
+        disasm_info.endian = BFD_ENDIAN_LITTLE;
     print_insn = print_insn_ppc;
 #else
     fprintf(out, "0x" TARGET_FMT_lx

Index: target-ppc/op_helper_mem.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper_mem.h,v retrieving revision 1.3

op_helper_mem.h +49 -0

53 lines not on this page · raw message

Index: target-ppc/op_mem.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/op_mem.h,v retrieving revision 1.6

op_mem.h +180 -0

255 lines not on this page · raw message

Index: target-ppc/translate.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v retrieving revision 1.28

translate.c +98 -26

227 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · On Mon, 18 Apr 2005 10:36:38 +0200 "J. Mayer" <[email protected]> wrote:

This patch adds little-endian mode support to PPC emulation. This is needed by OS/2 and Windows NT and some programs like VirtualPC. This patch have been tested using OS/2 bootloader (thanks to Tero Kaarlela).

Thanks for doing little-endian support.

Signature · 5 lines
Here's a simple experiment. Stand on a train track between two locomotives
which are pushing on you with equal force in opposite directions. You will
exhibit no net motion. None the less, you may soon begin to notice that
something important is happening.
-- Robert Stirniman