Revision 20c9f095 hw/sun4u.c

b/hw/sun4u.c
282 282
static void main_cpu_reset(void *opaque)
283 283
{
284 284
    CPUState *env = opaque;
285

  
285 286
    cpu_reset(env);
287
    ptimer_set_limit(env->tick, 0x7fffffffffffffffULL, 1);
288
    ptimer_run(env->tick, 0);
289
    ptimer_set_limit(env->stick, 0x7fffffffffffffffULL, 1);
290
    ptimer_run(env->stick, 0);
291
    ptimer_set_limit(env->hstick, 0x7fffffffffffffffULL, 1);
292
    ptimer_run(env->hstick, 0);
293
}
294

  
295
void tick_irq(void *opaque)
296
{
297
    CPUState *env = opaque;
298

  
299
    cpu_interrupt(env, CPU_INTERRUPT_TIMER);
300
}
301

  
302
void stick_irq(void *opaque)
303
{
304
    CPUState *env = opaque;
305

  
306
    cpu_interrupt(env, CPU_INTERRUPT_TIMER);
307
}
308

  
309
void hstick_irq(void *opaque)
310
{
311
    CPUState *env = opaque;
312

  
313
    cpu_interrupt(env, CPU_INTERRUPT_TIMER);
286 314
}
287 315

  
288 316
static const int ide_iobase[2] = { 0x1f0, 0x170 };
......
311 339
    long prom_offset, initrd_size, kernel_size;
312 340
    PCIBus *pci_bus;
313 341
    const sparc_def_t *def;
342
    QEMUBH *bh;
314 343

  
315 344
    linux_boot = (kernel_filename != NULL);
316 345

  
......
324 353
    }
325 354
    env = cpu_init();
326 355
    cpu_sparc_register(env, def);
356
    bh = qemu_bh_new(tick_irq, env);
357
    env->tick = ptimer_init(bh);
358
    ptimer_set_period(env->tick, 1ULL);
359

  
360
    bh = qemu_bh_new(stick_irq, env);
361
    env->stick = ptimer_init(bh);
362
    ptimer_set_period(env->stick, 1ULL);
363

  
364
    bh = qemu_bh_new(hstick_irq, env);
365
    env->hstick = ptimer_init(bh);
366
    ptimer_set_period(env->hstick, 1ULL);
327 367
    register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
328 368
    qemu_register_reset(main_cpu_reset, env);
369
    main_cpu_reset(env);
329 370

  
330 371
    /* allocate RAM */
331 372
    cpu_register_physical_memory(0, ram_size, 0);

Also available in: Unified diff