Fwd: [Bochs-developers] [PATCH] bochs does not run properly on big endian ARM
Upstream is fixing some ARM-related bugs in Bochs, just to make sure
you don't duplicate their work by error:
On Mon, Sep 01, 2003 at 01:58:47PM +1000, Steve Bennett wrote:
> Please find enclosed some small patches for bugs I found
> when running on a big endian ARM platform.
>
> 1. Packing of registers is not correct, which meant that the 32bit
> registers were not overlapping the 16 bit registers.
> 2. --disable-fpu leads to compile errors
> 3. Enabling the debugger produces a compile error
> 4. Enabling both X and RFB (VNC) display GUIs causes a global symbol clash.
>
> --
> Steve Bennett http://www.SnapGear.com/
> steveb@snapgear.com Custom Embedded Solutions + Security
>
> Index: cpu/cpu.h
> ===================================================================
> RCS file: /cvsroot/bochs/bochs/cpu/cpu.h,v
> retrieving revision 1.143
> diff -u -r1.143 cpu.h
> --- cpu/cpu.h 17 Aug 2003 18:55:16 -0000 1.143
> +++ cpu/cpu.h 1 Sep 2003 03:30:27 -0000
> @@ -1091,14 +1091,14 @@
> struct {
> Bit8u rh;
> Bit8u rl;
> - } byte;
> - };
> - } word;
> + } __attribute__((packed)) byte;
> + } __attribute__((packed));
> + } __attribute__((packed)) word;
> Bit64u rrx;
> struct {
> Bit32u hrx; // hi 32 bits
> Bit32u erx; // low 32 bits
> - } dword;
> + } __attribute__((packed)) word;
> };
> } bx_gen_reg_t;
> #else
> @@ -1141,9 +1141,9 @@
> struct {
> Bit8u rh;
> Bit8u rl;
> - } byte;
> + } __attribute__((packed)) byte;
> };
> - } word;
> + } __attribute__((packed)) word;
> };
> } bx_gen_reg_t;
>
> Index: cpu/fpu.cc
> ===================================================================
> RCS file: /cvsroot/bochs/bochs/cpu/fpu.cc,v
> retrieving revision 1.2
> diff -u -r1.2 fpu.cc
> --- cpu/fpu.cc 1 Aug 2003 09:32:33 -0000 1.2
> +++ cpu/fpu.cc 1 Sep 2003 03:30:27 -0000
> @@ -51,9 +51,9 @@
>
> void BX_CPU_C::ESC0(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC0 not implemented, use --enable-fpu"));
> @@ -62,9 +62,9 @@
>
> void BX_CPU_C::ESC1(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC1 not implemented, use --enable-fpu"));
> @@ -73,9 +73,9 @@
>
> void BX_CPU_C::ESC2(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC2 not implemented, use --enable-fpu"));
> @@ -84,9 +84,9 @@
>
> void BX_CPU_C::ESC3(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC3 not implemented, use --enable-fpu"));
> @@ -95,9 +95,9 @@
>
> void BX_CPU_C::ESC4(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC4 not implemented, use --enable-fpu"));
> @@ -106,9 +106,9 @@
>
> void BX_CPU_C::ESC5(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC5 not implemented, use --enable-fpu"));
> @@ -117,9 +117,9 @@
>
> void BX_CPU_C::ESC6(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC6 not implemented, use --enable-fpu"));
> @@ -128,9 +128,9 @@
>
> void BX_CPU_C::ESC7(bxInstruction_c *i)
> {
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> fpu_execute(i);
> #else
> BX_INFO(("FPU: ESC7 not implemented, use --enable-fpu"));
> @@ -146,9 +146,9 @@
> BX_PANIC(("FWAIT: not implemented for < 386"));
> #else // BX_CPU_LEVEL >= 3
>
> +#if BX_SUPPORT_FPU
> BX_CPU_THIS_PTR prepareFPU();
>
> -#if BX_SUPPORT_FPU
> if (FPU_PARTIAL_STATUS & FPU_SW_SUMMARY)
> exception(BX_MF_EXCEPTION, 0, 0);
> #else
> Index: debug/debug.h
> ===================================================================
> RCS file: /cvsroot/bochs/bochs/debug/debug.h,v
> retrieving revision 1.19
> diff -u -r1.19 debug.h
> --- debug/debug.h 4 Aug 2003 16:03:09 -0000 1.19
> +++ debug/debug.h 1 Sep 2003 03:30:27 -0000
> @@ -98,7 +98,7 @@
> bx_num_range make_num_range (Bit64s from, Bit64s to);
> char* bx_dbg_symbolic_address(Bit32u context, Bit32u eip, Bit32u base);
> char* bx_dbg_disasm_symbolic_address(Bit32u eip, Bit32u base);
> -Bit32u bx_dbg_get_symbol_value(char *Symbol);
> +Bit32u bx_dbg_get_symbol_value(const char *Symbol);
> void bx_dbg_symbol_command(char* filename, bx_bool global, Bit32u offset);
> void bx_dbg_trace_on_command(void);
> void bx_dbg_trace_off_command(void);
> Index: gui/x.cc
> ===================================================================
> RCS file: /cvsroot/bochs/bochs/gui/x.cc,v
> retrieving revision 1.76
> diff -u -r1.76 x.cc
> --- gui/x.cc 11 Aug 2003 19:27:57 -0000 1.76
> +++ gui/x.cc 1 Sep 2003 03:30:30 -0000
> @@ -146,7 +146,7 @@
>
>
>
> -Bit32u ascii_to_key_event[0x5f] = {
> +static Bit32u ascii_to_key_event[0x5f] = {
> // !"#$%&'
> BX_KEY_SPACE,
> BX_KEY_1,
>
--
Robert Millan
"[..] but the delight and pride of Aule is in the deed of making, and in the
thing made, and neither in possession nor in his own mastery; wherefore he
gives and hoards not, and is free from care, passing ever on to some new work."
-- J.R.R.T, Ainulindale (Silmarillion)
Reply to: