Introduce "xen-save-devices-state"
[qemu/ar7.git] / hw / arm_pic.c
bloba2e8a733014db6c5c0896e0eefc2c8f79626bb73
1 /*
2 * Generic ARM Programmable Interrupt Controller support.
4 * Copyright (c) 2006 CodeSourcery.
5 * Written by Paul Brook
7 * This code is licensed under the LGPL
8 */
10 #include "hw.h"
11 #include "arm-misc.h"
13 /* Input 0 is IRQ and input 1 is FIQ. */
14 static void arm_pic_cpu_handler(void *opaque, int irq, int level)
16 CPUState *env = (CPUState *)opaque;
17 switch (irq) {
18 case ARM_PIC_CPU_IRQ:
19 if (level)
20 cpu_interrupt(env, CPU_INTERRUPT_HARD);
21 else
22 cpu_reset_interrupt(env, CPU_INTERRUPT_HARD);
23 break;
24 case ARM_PIC_CPU_FIQ:
25 if (level)
26 cpu_interrupt(env, CPU_INTERRUPT_FIQ);
27 else
28 cpu_reset_interrupt(env, CPU_INTERRUPT_FIQ);
29 break;
30 default:
31 hw_error("arm_pic_cpu_handler: Bad interrupt line %d\n", irq);
35 qemu_irq *arm_pic_init_cpu(CPUState *env)
37 return qemu_allocate_irqs(arm_pic_cpu_handler, env, 2);