]> git.proxmox.com Git - qemu.git/blame - hw/arm_pic.c
LSI53C895A: Introduce CASE_GET_REG24
[qemu.git] / hw / arm_pic.c
CommitLineData
5fafdf24 1/*
cdbdb648
PB
2 * Generic ARM Programmable Interrupt Controller support.
3 *
4 * Copyright (c) 2006 CodeSourcery.
5 * Written by Paul Brook
6 *
7 * This code is licenced under the LGPL
8 */
9
87ecb68b
PB
10#include "hw.h"
11#include "arm-misc.h"
cdbdb648
PB
12
13/* Stub functions for hardware that doesn't exist. */
cdbdb648
PB
14void pic_info(void)
15{
16}
17
18void irq_info(void)
19{
20}
21
22
d537cf6c 23/* Input 0 is IRQ and input 1 is FIQ. */
cdbdb648
PB
24static void arm_pic_cpu_handler(void *opaque, int irq, int level)
25{
d537cf6c 26 CPUState *env = (CPUState *)opaque;
cdbdb648
PB
27 switch (irq) {
28 case ARM_PIC_CPU_IRQ:
29 if (level)
d537cf6c 30 cpu_interrupt(env, CPU_INTERRUPT_HARD);
cdbdb648 31 else
d537cf6c 32 cpu_reset_interrupt(env, CPU_INTERRUPT_HARD);
cdbdb648
PB
33 break;
34 case ARM_PIC_CPU_FIQ:
35 if (level)
d537cf6c 36 cpu_interrupt(env, CPU_INTERRUPT_FIQ);
cdbdb648 37 else
d537cf6c 38 cpu_reset_interrupt(env, CPU_INTERRUPT_FIQ);
cdbdb648
PB
39 break;
40 default:
d537cf6c 41 cpu_abort(env, "arm_pic_cpu_handler: Bad interrput line %d\n", irq);
cdbdb648
PB
42 }
43}
44
d537cf6c 45qemu_irq *arm_pic_init_cpu(CPUState *env)
cdbdb648 46{
d537cf6c 47 return qemu_allocate_irqs(arm_pic_cpu_handler, env, 2);
cdbdb648 48}