~ubuntu-branches/debian/jessie/qemu/jessie

« back to all changes in this revision

Viewing changes to hw/sun4u.c

  • Committer: Package Import Robot
  • Author(s): Vagrant Cascadian
  • Date: 2011-10-03 12:29:18 UTC
  • mfrom: (1.2.13) (10.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20111003122918-zc4kv6epchrbgdta
Tags: 0.15.0+dfsg-1
* New upstream version.
* Install new qemu-system, qemu-user and qemu-user-static variants: 
  lm32, microblazeel, s390x, unicore32
* Patch from upstream to set QEMU_INCLUDES before QEMU_CFLAGS.
* Update debian/watch to check http://qemu.org/download.

Show diffs side-by-side

added added

removed removed

Lines of Context:
298
298
{
299
299
    env->halted = 0;
300
300
    cpu_check_irqs(env);
 
301
    qemu_cpu_kick(env);
301
302
}
302
303
 
303
304
static void cpu_set_irq(void *opaque, int irq, int level)
306
307
 
307
308
    if (level) {
308
309
        CPUIRQ_DPRINTF("Raise CPU IRQ %d\n", irq);
309
 
        env->halted = 0;
310
310
        env->pil_in |= 1 << irq;
311
 
        cpu_check_irqs(env);
 
311
        cpu_kick_irq(env);
312
312
    } else {
313
313
        CPUIRQ_DPRINTF("Lower CPU IRQ %d\n", irq);
314
314
        env->pil_in &= ~(1 << irq);
352
352
    timer->disabled_mask = disabled_mask;
353
353
 
354
354
    timer->disabled = 1;
355
 
    timer->clock_offset = qemu_get_clock(vm_clock);
 
355
    timer->clock_offset = qemu_get_clock_ns(vm_clock);
356
356
 
357
 
    timer->qtimer = qemu_new_timer(vm_clock, cb, env);
 
357
    timer->qtimer = qemu_new_timer_ns(vm_clock, cb, env);
358
358
 
359
359
    return timer;
360
360
}
362
362
static void cpu_timer_reset(CPUTimer *timer)
363
363
{
364
364
    timer->disabled = 1;
365
 
    timer->clock_offset = qemu_get_clock(vm_clock);
 
365
    timer->clock_offset = qemu_get_clock_ns(vm_clock);
366
366
 
367
367
    qemu_del_timer(timer->qtimer);
368
368
}
457
457
    uint64_t real_count = count & ~timer->disabled_mask;
458
458
    uint64_t disabled_bit = count & timer->disabled_mask;
459
459
 
460
 
    int64_t vm_clock_offset = qemu_get_clock(vm_clock) -
 
460
    int64_t vm_clock_offset = qemu_get_clock_ns(vm_clock) -
461
461
                    cpu_to_timer_ticks(real_count, timer->frequency);
462
462
 
463
463
    TIMER_DPRINTF("%s set_count count=0x%016lx (%s) p=%p\n",
471
471
uint64_t cpu_tick_get_count(CPUTimer *timer)
472
472
{
473
473
    uint64_t real_count = timer_to_cpu_ticks(
474
 
                    qemu_get_clock(vm_clock) - timer->clock_offset,
 
474
                    qemu_get_clock_ns(vm_clock) - timer->clock_offset,
475
475
                    timer->frequency);
476
476
 
477
477
    TIMER_DPRINTF("%s get_count count=0x%016lx (%s) p=%p\n",
486
486
 
487
487
void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit)
488
488
{
489
 
    int64_t now = qemu_get_clock(vm_clock);
 
489
    int64_t now = qemu_get_clock_ns(vm_clock);
490
490
 
491
491
    uint64_t real_limit = limit & ~timer->disabled_mask;
492
492
    timer->disabled = (limit & timer->disabled_mask) ? 1 : 0;
553
553
{
554
554
    isa_bus_new(&s->qdev);
555
555
 
556
 
    pci_config_set_vendor_id(s->config, PCI_VENDOR_ID_SUN);
557
 
    pci_config_set_device_id(s->config, PCI_DEVICE_ID_SUN_EBUS);
558
556
    s->config[0x04] = 0x06; // command = bus master, pci mem
559
557
    s->config[0x05] = 0x00;
560
558
    s->config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error
561
559
    s->config[0x07] = 0x03; // status = medium devsel
562
 
    s->config[0x08] = 0x01; // revision
563
560
    s->config[0x09] = 0x00; // programming i/f
564
 
    pci_config_set_class(s->config, PCI_CLASS_BRIDGE_OTHER);
565
561
    s->config[0x0D] = 0x0a; // latency_timer
566
562
 
567
563
    pci_register_bar(s, 0, 0x1000000, PCI_BASE_ADDRESS_SPACE_MEMORY,
575
571
    .qdev.name = "ebus",
576
572
    .qdev.size = sizeof(PCIDevice),
577
573
    .init = pci_ebus_init1,
 
574
    .vendor_id = PCI_VENDOR_ID_SUN,
 
575
    .device_id = PCI_DEVICE_ID_SUN_EBUS,
 
576
    .revision = 0x01,
 
577
    .class_id = PCI_CLASS_BRIDGE_OTHER,
578
578
};
579
579
 
580
580
static void pci_ebus_register(void)
793
793
    for(i = 0; i < nb_nics; i++)
794
794
        pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL);
795
795
 
796
 
    if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
797
 
        fprintf(stderr, "qemu: too many IDE bus\n");
798
 
        exit(1);
799
 
    }
800
 
    for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
801
 
        hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS,
802
 
                          i % MAX_IDE_DEVS);
803
 
    }
 
796
    ide_drive_get(hd, MAX_IDE_BUS);
804
797
 
805
798
    pci_cmd646_ide_init(pci_bus, hd, 1);
806
799