~fboudra/qemu-linaro/new-upstream-release-1.2.0-2012.09-0ubuntu1

« back to all changes in this revision

Viewing changes to hw/arm_pic.c

  • Committer: Fathi Boudra
  • Author(s): Fathi Boudra
  • Date: 2012-08-21 06:47:11 UTC
  • mfrom: (0.1.16)
  • Revision ID: fathi.boudra@linaro.org-20120821064711-7yxmubp2v8a44xce
Tags: 1.1.50-2012.08-0ubuntu1
* New upstream release.
  - support emulated systems with more than 2G of memory. (LP: #1030588)
* Drop powerpc-missing-include.patch - merged upstream.
* Update debian/control: 
  - drop perl build dependency.
  - add libfdt-dev build dependency.
* Update debian/qemu-keymaps.install file.
* Update debian/rules:
  - update QEMU_CPU for ARM architecture: armv4l -> armv7l.
  - update conf_audio_drv: default to PulseAudio since PA is the default on
    Ubuntu.
  - enable KVM on ARM architecture.
  - enable flat device tree support (--enable-fdt). (LP: #1030594)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
/* Input 0 is IRQ and input 1 is FIQ.  */
15
15
static void arm_pic_cpu_handler(void *opaque, int irq, int level)
16
16
{
17
 
    CPUState *env = (CPUState *)opaque;
 
17
    ARMCPU *cpu = opaque;
 
18
    CPUARMState *env = &cpu->env;
 
19
 
18
20
    switch (irq) {
19
21
    case ARM_PIC_CPU_IRQ:
20
22
        if (level)
31
33
    default:
32
34
        hw_error("arm_pic_cpu_handler: Bad interrupt line %d\n", irq);
33
35
    }
34
 
 
35
 
    if (kvm_enabled())
36
 
            kvm_arch_interrupt(env, irq, level);
37
 
}
38
 
 
39
 
qemu_irq *arm_pic_init_cpu(CPUState *env)
40
 
{
41
 
    return qemu_allocate_irqs(arm_pic_cpu_handler, env, 2);
 
36
}
 
37
 
 
38
#ifdef CONFIG_KVM
 
39
static void kvm_arm_pic_cpu_handler(void *opaque, int irq, int level)
 
40
{
 
41
    ARMCPU *cpu = opaque;
 
42
    CPUARMState *env = &cpu->env;
 
43
    int kvm_irq;
 
44
 
 
45
    switch (irq) {
 
46
    case ARM_PIC_CPU_IRQ:
 
47
        kvm_irq = KVM_ARM_IRQ_LINE;
 
48
        break;
 
49
    case ARM_PIC_CPU_FIQ:
 
50
        kvm_irq = KVM_ARM_FIQ_LINE;
 
51
        break;
 
52
    default:
 
53
        hw_error("kvm_arm_pic_cpu_handler: Bad interrupt line %d\n", irq);
 
54
    }
 
55
    kvm_irq |= (env->cpu_index << 1);
 
56
    kvm_set_irq(kvm_state, kvm_irq, level ? 1 : 0);
 
57
}
 
58
#endif
 
59
 
 
60
qemu_irq *arm_pic_init_cpu(ARMCPU *cpu)
 
61
{
 
62
#ifdef CONFIG_KVM
 
63
    if (kvm_enabled()) {
 
64
        return qemu_allocate_irqs(kvm_arm_pic_cpu_handler, cpu, 2);
 
65
    }
 
66
#endif
 
67
    return qemu_allocate_irqs(arm_pic_cpu_handler, cpu, 2);
42
68
}