From 242011157f0d454bf5a57541ebeba2c17611298e Mon Sep 17 00:00:00 2001 From: pbrook Date: Mon, 13 Feb 2006 14:16:52 +0000 Subject: Fix Arm big-endian host bug. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1762 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/integratorcp.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/hw/integratorcp.c b/hw/integratorcp.c index 0e3d1e3f02..8f91b582f6 100644 --- a/hw/integratorcp.c +++ b/hw/integratorcp.c @@ -1135,22 +1135,22 @@ static void set_kernel_args(uint32_t ram_size, int initrd_size, p = (uint32_t *)(phys_ram_base + KERNEL_ARGS_ADDR); /* ATAG_CORE */ - *(p++) = 5; - *(p++) = 0x54410001; - *(p++) = 1; - *(p++) = 0x1000; - *(p++) = 0; + stl_raw(p++, 5); + stl_raw(p++, 0x54410001); + stl_raw(p++, 1); + stl_raw(p++, 0x1000); + stl_raw(p++, 0); /* ATAG_MEM */ - *(p++) = 4; - *(p++) = 0x54410002; - *(p++) = ram_size; - *(p++) = 0; + stl_raw(p++, 4); + stl_raw(p++, 0x54410002); + stl_raw(p++, ram_size); + stl_raw(p++, 0); if (initrd_size) { /* ATAG_INITRD2 */ - *(p++) = 4; - *(p++) = 0x54420005; - *(p++) = INITRD_LOAD_ADDR; - *(p++) = initrd_size; + stl_raw(p++, 4); + stl_raw(p++, 0x54420005); + stl_raw(p++, INITRD_LOAD_ADDR); + stl_raw(p++, initrd_size); } if (kernel_cmdline && *kernel_cmdline) { /* ATAG_CMDLINE */ @@ -1159,13 +1159,13 @@ static void set_kernel_args(uint32_t ram_size, int initrd_size, cmdline_size = strlen(kernel_cmdline); memcpy (p + 2, kernel_cmdline, cmdline_size + 1); cmdline_size = (cmdline_size >> 2) + 1; - *(p++) = cmdline_size + 2; - *(p++) = 0x54410009; + stl_raw(p++, cmdline_size + 2); + stl_raw(p++, 0x54410009); p += cmdline_size; } /* ATAG_END */ - *(p++) = 0; - *(p++) = 0; + stl_raw(p++, 0); + stl_raw(p++, 0); } /* Board init. */ @@ -1180,6 +1180,7 @@ static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device, icp_pic_state *pic; int kernel_size; int initrd_size; + int n; env = cpu_init(); bios_offset = ram_size + vga_ram_size; @@ -1234,7 +1235,8 @@ static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device, } bootloader[5] = KERNEL_ARGS_ADDR; bootloader[6] = KERNEL_LOAD_ADDR; - memcpy(phys_ram_base, bootloader, sizeof(bootloader)); + for (n = 0; n < sizeof(bootloader) / 4; n++) + stl_raw(phys_ram_base + (n * 4), bootloader[n]); set_kernel_args(ram_size, initrd_size, kernel_cmdline); } -- cgit v1.2.1