Revision 44654490 hw/ppc_oldworld.c

b/hw/ppc_oldworld.c
138 138
    int index;
139 139
    void *fw_cfg;
140 140
    void *dbdma;
141
    uint8_t *vga_bios_ptr;
141 142

  
142 143
    linux_boot = (kernel_filename != NULL);
143 144

  
......
187 188

  
188 189
    /* allocate and load VGA BIOS */
189 190
    vga_bios_offset = qemu_ram_alloc(VGA_BIOS_SIZE);
191
    vga_bios_ptr = qemu_get_ram_ptr(vga_bios_offset);
190 192
    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME);
191
    vga_bios_size = load_image(buf, phys_ram_base + vga_bios_offset + 8);
193
    vga_bios_size = load_image(buf, vga_bios_ptr + 8);
192 194
    if (vga_bios_size < 0) {
193 195
        /* if no bios is present, we can still work */
194 196
        fprintf(stderr, "qemu: warning: could not load VGA bios '%s'\n", buf);
......
196 198
    } else {
197 199
        /* set a specific header (XXX: find real Apple format for NDRV
198 200
           drivers) */
199
        phys_ram_base[vga_bios_offset] = 'N';
200
        phys_ram_base[vga_bios_offset + 1] = 'D';
201
        phys_ram_base[vga_bios_offset + 2] = 'R';
202
        phys_ram_base[vga_bios_offset + 3] = 'V';
203
        cpu_to_be32w((uint32_t *)(phys_ram_base + vga_bios_offset + 4),
204
                     vga_bios_size);
201
        vga_bios_ptr[0] = 'N';
202
        vga_bios_ptr[1] = 'D';
203
        vga_bios_ptr[2] = 'R';
204
        vga_bios_ptr[3] = 'V';
205
        cpu_to_be32w((uint32_t *)(vga_bios_ptr + 4), vga_bios_size);
205 206
        vga_bios_size += 8;
206 207
    }
207 208

  

Also available in: Unified diff