Commit 24201115 authored by pbrook's avatar pbrook
Browse files

Fix Arm big-endian host bug.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1762 c046a42c-6fe2-441c-8c8c-71466251a162
parent 2ae23e75
...@@ -1135,22 +1135,22 @@ static void set_kernel_args(uint32_t ram_size, int initrd_size, ...@@ -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); p = (uint32_t *)(phys_ram_base + KERNEL_ARGS_ADDR);
/* ATAG_CORE */ /* ATAG_CORE */
*(p++) = 5; stl_raw(p++, 5);
*(p++) = 0x54410001; stl_raw(p++, 0x54410001);
*(p++) = 1; stl_raw(p++, 1);
*(p++) = 0x1000; stl_raw(p++, 0x1000);
*(p++) = 0; stl_raw(p++, 0);
/* ATAG_MEM */ /* ATAG_MEM */
*(p++) = 4; stl_raw(p++, 4);
*(p++) = 0x54410002; stl_raw(p++, 0x54410002);
*(p++) = ram_size; stl_raw(p++, ram_size);
*(p++) = 0; stl_raw(p++, 0);
if (initrd_size) { if (initrd_size) {
/* ATAG_INITRD2 */ /* ATAG_INITRD2 */
*(p++) = 4; stl_raw(p++, 4);
*(p++) = 0x54420005; stl_raw(p++, 0x54420005);
*(p++) = INITRD_LOAD_ADDR; stl_raw(p++, INITRD_LOAD_ADDR);
*(p++) = initrd_size; stl_raw(p++, initrd_size);
} }
if (kernel_cmdline && *kernel_cmdline) { if (kernel_cmdline && *kernel_cmdline) {
/* ATAG_CMDLINE */ /* ATAG_CMDLINE */
...@@ -1159,13 +1159,13 @@ static void set_kernel_args(uint32_t ram_size, int initrd_size, ...@@ -1159,13 +1159,13 @@ static void set_kernel_args(uint32_t ram_size, int initrd_size,
cmdline_size = strlen(kernel_cmdline); cmdline_size = strlen(kernel_cmdline);
memcpy (p + 2, kernel_cmdline, cmdline_size + 1); memcpy (p + 2, kernel_cmdline, cmdline_size + 1);
cmdline_size = (cmdline_size >> 2) + 1; cmdline_size = (cmdline_size >> 2) + 1;
*(p++) = cmdline_size + 2; stl_raw(p++, cmdline_size + 2);
*(p++) = 0x54410009; stl_raw(p++, 0x54410009);
p += cmdline_size; p += cmdline_size;
} }
/* ATAG_END */ /* ATAG_END */
*(p++) = 0; stl_raw(p++, 0);
*(p++) = 0; stl_raw(p++, 0);
} }
/* Board init. */ /* Board init. */
...@@ -1180,6 +1180,7 @@ static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device, ...@@ -1180,6 +1180,7 @@ static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device,
icp_pic_state *pic; icp_pic_state *pic;
int kernel_size; int kernel_size;
int initrd_size; int initrd_size;
int n;
env = cpu_init(); env = cpu_init();
bios_offset = ram_size + vga_ram_size; 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, ...@@ -1234,7 +1235,8 @@ static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device,
} }
bootloader[5] = KERNEL_ARGS_ADDR; bootloader[5] = KERNEL_ARGS_ADDR;
bootloader[6] = KERNEL_LOAD_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); set_kernel_args(ram_size, initrd_size, kernel_cmdline);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment