]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/arm/include/asm/irqchip.h
arm: GIC initialisation skeleton
[jailhouse.git] / hypervisor / arch / arm / include / asm / irqchip.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) ARM Limited, 2014
5  *
6  * Authors:
7  *  Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  */
12
13 #ifndef _JAILHOUSE_ASM_IRQCHIP_H
14 #define _JAILHOUSE_ASM_IRQCHIP_H
15
16 #include <asm/percpu.h>
17
18 #ifndef __ASSEMBLY__
19
20 struct sgi {
21         /*
22          * Routing mode values:
23          * 0: use aff3.aff2.aff1.targets
24          * 1: all processors in the cell except this CPU
25          * 2: only this CPU
26          */
27         u8      routing_mode;
28         /* GICv2 only uses 8bit in targets, and no affinity routing */
29         u8      aff1;
30         u8      aff2;
31         /* Only available on 64-bit, when CTLR.A3V is 1 */
32         u8      aff3;
33         u16     targets;
34         u16     id;
35 };
36
37 struct irqchip_ops {
38         int     (*init)(void);
39         int     (*cpu_init)(struct per_cpu *cpu_data);
40
41         int     (*send_sgi)(struct sgi *sgi);
42         void    (*handle_irq)(struct per_cpu *cpu_data);
43 };
44
45 int irqchip_init(void);
46 int irqchip_cpu_init(struct per_cpu *cpu_data);
47
48 int irqchip_send_sgi(struct sgi *sgi);
49 void irqchip_handle_irq(struct per_cpu *cpu_data);
50
51 #endif /* __ASSEMBLY__ */
52 #endif /* _JAILHOUSE_ASM_IRQCHIP_H */