Revision 22548760 hw/sun4u.c

b/hw/sun4u.c
45 45
#define NVRAM_SIZE           0x2000
46 46
#define MAX_IDE_BUS          2
47 47

  
48
/* TSC handling */
49

  
50
uint64_t cpu_get_tsc()
51
{
52
    return qemu_get_clock(vm_clock);
53
}
54

  
55 48
int DMA_get_channel_mode (int nchan)
56 49
{
57 50
    return 0;
......
164 157
    return 0;
165 158
}
166 159

  
167
void pic_info()
160
void pic_info(void)
168 161
{
169 162
}
170 163

  
171
void irq_info()
164
void irq_info(void)
172 165
{
173 166
}
174 167

  
......
189 182
    ptimer_run(env->hstick, 0);
190 183
}
191 184

  
192
void tick_irq(void *opaque)
185
static void tick_irq(void *opaque)
193 186
{
194 187
    CPUState *env = opaque;
195 188

  
196 189
    cpu_interrupt(env, CPU_INTERRUPT_TIMER);
197 190
}
198 191

  
199
void stick_irq(void *opaque)
192
static void stick_irq(void *opaque)
200 193
{
201 194
    CPUState *env = opaque;
202 195

  
203 196
    cpu_interrupt(env, CPU_INTERRUPT_TIMER);
204 197
}
205 198

  
206
void hstick_irq(void *opaque)
199
static void hstick_irq(void *opaque)
207 200
{
208 201
    CPUState *env = opaque;
209 202

  
......
227 220
static fdctrl_t *floppy_controller;
228 221

  
229 222
/* Sun4u hardware initialisation */
230
static void sun4u_init(ram_addr_t ram_size, int vga_ram_size,
223
static void sun4u_init(ram_addr_t RAM_size, int vga_ram_size,
231 224
                       const char *boot_devices, DisplayState *ds,
232 225
                       const char *kernel_filename, const char *kernel_cmdline,
233 226
                       const char *initrd_filename, const char *cpu_model)
......
241 234
    PCIBus *pci_bus;
242 235
    QEMUBH *bh;
243 236
    qemu_irq *irq;
244
    int index;
237
    int drive_index;
245 238
    BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
246 239
    BlockDriverState *fd[MAX_FD];
247 240

  
......
271 264
    main_cpu_reset(env);
272 265

  
273 266
    /* allocate RAM */
274
    cpu_register_physical_memory(0, ram_size, 0);
267
    cpu_register_physical_memory(0, RAM_size, 0);
275 268

  
276
    prom_offset = ram_size + vga_ram_size;
269
    prom_offset = RAM_size + vga_ram_size;
277 270
    cpu_register_physical_memory(PROM_ADDR,
278 271
                                 (PROM_SIZE_MAX + TARGET_PAGE_SIZE) & TARGET_PAGE_MASK,
279 272
                                 prom_offset | IO_MEM_ROM);
......
325 318
    }
326 319
    pci_bus = pci_apb_init(APB_SPECIAL_BASE, APB_MEM_BASE, NULL);
327 320
    isa_mem_base = VGA_BASE;
328
    pci_cirrus_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size, vga_ram_size);
321
    pci_cirrus_vga_init(pci_bus, ds, phys_ram_base + RAM_size, RAM_size, vga_ram_size);
329 322

  
330 323
    for(i = 0; i < MAX_SERIAL_PORTS; i++) {
331 324
        if (serial_hds[i]) {
......
352 345
        exit(1);
353 346
    }
354 347
    for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
355
        index = drive_get_index(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
356
       if (index != -1)
357
           hd[i] = drives_table[index].bdrv;
348
        drive_index = drive_get_index(IF_IDE, i / MAX_IDE_DEVS,
349
                                      i % MAX_IDE_DEVS);
350
       if (drive_index != -1)
351
           hd[i] = drives_table[drive_index].bdrv;
358 352
       else
359 353
           hd[i] = NULL;
360 354
    }
......
364 358
    /* FIXME: wire up interrupts.  */
365 359
    i8042_init(NULL/*1*/, NULL/*12*/, 0x60);
366 360
    for(i = 0; i < MAX_FD; i++) {
367
        index = drive_get_index(IF_FLOPPY, 0, i);
368
       if (index != -1)
369
           fd[i] = drives_table[index].bdrv;
361
        drive_index = drive_get_index(IF_FLOPPY, 0, i);
362
       if (drive_index != -1)
363
           fd[i] = drives_table[drive_index].bdrv;
370 364
       else
371 365
           fd[i] = NULL;
372 366
    }
373 367
    floppy_controller = fdctrl_init(NULL/*6*/, 2, 0, 0x3f0, fd);
374 368
    nvram = m48t59_init(NULL/*8*/, 0, 0x0074, NVRAM_SIZE, 59);
375
    sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", ram_size, boot_devices,
369
    sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", RAM_size, boot_devices,
376 370
                         KERNEL_LOAD_ADDR, kernel_size,
377 371
                         kernel_cmdline,
378 372
                         INITRD_LOAD_ADDR, initrd_size,

Also available in: Unified diff