Revision 6908d9ce hw/sun4u.c

b/hw/sun4u.c
169 169
    int linux_boot;
170 170
    unsigned int i;
171 171
    long kernel_size;
172
    uint8_t *ptr;
172 173

  
173 174
    linux_boot = (kernel_filename != NULL);
174 175

  
......
211 212
        }
212 213
        if (*initrd_size > 0) {
213 214
            for (i = 0; i < 64 * TARGET_PAGE_SIZE; i += TARGET_PAGE_SIZE) {
214
                if (ldl_phys(KERNEL_LOAD_ADDR + i) == 0x48647253) { // HdrS
215
                    stl_phys(KERNEL_LOAD_ADDR + i + 16, INITRD_LOAD_ADDR);
216
                    stl_phys(KERNEL_LOAD_ADDR + i + 20, *initrd_size);
215
                ptr = rom_ptr(KERNEL_LOAD_ADDR + i);
216
                if (ldl_p(ptr + 8) == 0x48647253) { /* HdrS */
217
                    stl_p(ptr + 24, INITRD_LOAD_ADDR + KERNEL_LOAD_ADDR - 0x4000);
218
                    stl_p(ptr + 28, *initrd_size);
217 219
                    break;
218 220
                }
219 221
            }

Also available in: Unified diff