]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/arm/include/asm/gic_common.h
162595363a879e7926a037ee351f4ccfdcc4e0fd
[jailhouse.git] / hypervisor / arch / arm / include / asm / gic_common.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_GIC_COMMON_H
14 #define _JAILHOUSE_ASM_GIC_COMMON_H
15
16 #include <jailhouse/mmio.h>
17 #include <jailhouse/types.h>
18
19 #define GICD_CTLR                       0x0000
20 #define GICD_TYPER                      0x0004
21 #define GICD_IIDR                       0x0008
22 #define GICD_IGROUPR                    0x0080
23 #define GICD_ISENABLER                  0x0100
24 #define GICD_ICENABLER                  0x0180
25 #define GICD_ISPENDR                    0x0200
26 #define GICD_ICPENDR                    0x0280
27 #define GICD_ISACTIVER                  0x0300
28 #define GICD_ICACTIVER                  0x0380
29 #define GICD_IPRIORITYR                 0x0400
30 #define GICD_ITARGETSR                  0x0800
31 #define GICD_ICFGR                      0x0c00
32 #define GICD_NSACR                      0x0e00
33 #define GICD_SGIR                       0x0f00
34 #define GICD_CPENDSGIR                  0x0f10
35 #define GICD_SPENDSGIR                  0x0f20
36 #define GICD_IROUTER                    0x6000
37
38 #define GICD_PIDR2_ARCH(pidr)           (((pidr) & 0xf0) >> 4)
39
40 #define is_sgi(irqn)                    ((u32)(irqn) < 16)
41 #define is_ppi(irqn)                    ((irqn) > 15 && (irqn) < 32)
42 #define is_spi(irqn)                    ((irqn) > 31 && (irqn) < 1020)
43
44 #ifndef __ASSEMBLY__
45
46 struct cell;
47 struct arm_mmio_access;
48 struct per_cpu;
49 struct sgi;
50
51 int gic_probe_cpu_id(unsigned int cpu);
52 enum mmio_result gic_handle_dist_access(void *arg, struct mmio_access *mmio);
53 enum mmio_result gic_handle_irq_route(struct mmio_access *mmio,
54                                       unsigned int irq);
55 void gic_handle_sgir_write(struct sgi *sgi, bool virt_input);
56 void gic_handle_irq(struct per_cpu *cpu_data);
57 void gic_target_spis(struct cell *config_cell, struct cell *dest_cell);
58 bool gic_targets_in_cell(struct cell *cell, u8 targets);
59
60 #endif /* !__ASSEMBLY__ */
61 #endif /* !_JAILHOUSE_ASM_GIC_COMMON_H */