root / hw / cris_pic_cpu.c @ b31442c3
History | View | Annotate | Download (1.7 kB)
1 | fd6dc90b | Edgar E. Iglesias | /*
|
---|---|---|---|
2 | fd6dc90b | Edgar E. Iglesias | * QEMU CRIS CPU interrupt wrapper logic.
|
3 | fd6dc90b | Edgar E. Iglesias | *
|
4 | fd6dc90b | Edgar E. Iglesias | * Copyright (c) 2009 Edgar E. Iglesias, Axis Communications AB.
|
5 | fd6dc90b | Edgar E. Iglesias | *
|
6 | fd6dc90b | Edgar E. Iglesias | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | fd6dc90b | Edgar E. Iglesias | * of this software and associated documentation files (the "Software"), to deal
|
8 | fd6dc90b | Edgar E. Iglesias | * in the Software without restriction, including without limitation the rights
|
9 | fd6dc90b | Edgar E. Iglesias | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | fd6dc90b | Edgar E. Iglesias | * copies of the Software, and to permit persons to whom the Software is
|
11 | fd6dc90b | Edgar E. Iglesias | * furnished to do so, subject to the following conditions:
|
12 | fd6dc90b | Edgar E. Iglesias | *
|
13 | fd6dc90b | Edgar E. Iglesias | * The above copyright notice and this permission notice shall be included in
|
14 | fd6dc90b | Edgar E. Iglesias | * all copies or substantial portions of the Software.
|
15 | fd6dc90b | Edgar E. Iglesias | *
|
16 | fd6dc90b | Edgar E. Iglesias | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | fd6dc90b | Edgar E. Iglesias | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | fd6dc90b | Edgar E. Iglesias | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | fd6dc90b | Edgar E. Iglesias | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | fd6dc90b | Edgar E. Iglesias | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | fd6dc90b | Edgar E. Iglesias | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | fd6dc90b | Edgar E. Iglesias | * THE SOFTWARE.
|
23 | fd6dc90b | Edgar E. Iglesias | */
|
24 | fd6dc90b | Edgar E. Iglesias | |
25 | fd6dc90b | Edgar E. Iglesias | #include "hw.h" |
26 | fd6dc90b | Edgar E. Iglesias | #include "pc.h" |
27 | fd6dc90b | Edgar E. Iglesias | #include "etraxfs.h" |
28 | fd6dc90b | Edgar E. Iglesias | |
29 | fd6dc90b | Edgar E. Iglesias | #define D(x)
|
30 | fd6dc90b | Edgar E. Iglesias | |
31 | fd6dc90b | Edgar E. Iglesias | void pic_info(Monitor *mon)
|
32 | fd6dc90b | Edgar E. Iglesias | {} |
33 | fd6dc90b | Edgar E. Iglesias | void irq_info(Monitor *mon)
|
34 | fd6dc90b | Edgar E. Iglesias | {} |
35 | fd6dc90b | Edgar E. Iglesias | |
36 | fd6dc90b | Edgar E. Iglesias | static void cris_pic_cpu_handler(void *opaque, int irq, int level) |
37 | fd6dc90b | Edgar E. Iglesias | { |
38 | fd6dc90b | Edgar E. Iglesias | CPUState *env = (CPUState *)opaque; |
39 | fd6dc90b | Edgar E. Iglesias | int type = irq ? CPU_INTERRUPT_NMI : CPU_INTERRUPT_HARD;
|
40 | fd6dc90b | Edgar E. Iglesias | |
41 | fd6dc90b | Edgar E. Iglesias | if (level)
|
42 | fd6dc90b | Edgar E. Iglesias | cpu_interrupt(env, type); |
43 | fd6dc90b | Edgar E. Iglesias | else
|
44 | fd6dc90b | Edgar E. Iglesias | cpu_reset_interrupt(env, type); |
45 | fd6dc90b | Edgar E. Iglesias | } |
46 | fd6dc90b | Edgar E. Iglesias | |
47 | fd6dc90b | Edgar E. Iglesias | qemu_irq *cris_pic_init_cpu(CPUState *env) |
48 | fd6dc90b | Edgar E. Iglesias | { |
49 | fd6dc90b | Edgar E. Iglesias | return qemu_allocate_irqs(cris_pic_cpu_handler, env, 2); |
50 | fd6dc90b | Edgar E. Iglesias | } |