aboutsummaryrefslogtreecommitdiff
path: root/hw/sun4u.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-01-24 21:18:00 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-01-24 21:18:00 +0000
commit6908d9ce4c26a8bc00e3616bc0764bbb292d6bfd (patch)
tree269889ea8cebfa31b2d6d953fc859867cd5c3409 /hw/sun4u.c
parente9cbbcacb65c6868b58ca5a586ea657cdd2a9e92 (diff)
downloadqemu-6908d9ce4c26a8bc00e3616bc0764bbb292d6bfd.zip
qemu-6908d9ce4c26a8bc00e3616bc0764bbb292d6bfd.tar.gz
qemu-6908d9ce4c26a8bc00e3616bc0764bbb292d6bfd.tar.bz2
Sparc64: fix initrd
Fix HdrS offsets for Sparc64. The initrd address must be offset by KERNBASE. Use rom_ptr mechanism to actually write to the kernel image. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/sun4u.c')
-rw-r--r--hw/sun4u.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c
index a39b28e..c1530a6 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -169,6 +169,7 @@ static unsigned long sun4u_load_kernel(const char *kernel_filename,
int linux_boot;
unsigned int i;
long kernel_size;
+ uint8_t *ptr;
linux_boot = (kernel_filename != NULL);
@@ -211,9 +212,10 @@ static unsigned long sun4u_load_kernel(const char *kernel_filename,
}
if (*initrd_size > 0) {
for (i = 0; i < 64 * TARGET_PAGE_SIZE; i += TARGET_PAGE_SIZE) {
- if (ldl_phys(KERNEL_LOAD_ADDR + i) == 0x48647253) { // HdrS
- stl_phys(KERNEL_LOAD_ADDR + i + 16, INITRD_LOAD_ADDR);
- stl_phys(KERNEL_LOAD_ADDR + i + 20, *initrd_size);
+ ptr = rom_ptr(KERNEL_LOAD_ADDR + i);
+ if (ldl_p(ptr + 8) == 0x48647253) { /* HdrS */
+ stl_p(ptr + 24, INITRD_LOAD_ADDR + KERNEL_LOAD_ADDR - 0x4000);
+ stl_p(ptr + 28, *initrd_size);
break;
}
}