2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) ARM Limited, 2014
7 * Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #ifndef _JAILHOUSE_ASM_IRQCHIP_H
14 #define _JAILHOUSE_ASM_IRQCHIP_H
16 #define MAX_PENDING_IRQS 256
18 #include <jailhouse/cell.h>
19 #include <jailhouse/mmio.h>
27 * Routing mode values:
28 * 0: use aff3.aff2.aff1.targets
29 * 1: all processors in the cell except this CPU
33 /* GICv2 only uses 8bit in targets, and no affinity routing */
36 /* Only available on 64-bit, when CTLR.A3V is 1 */
44 int (*cpu_init)(struct per_cpu *cpu_data);
45 int (*cell_init)(struct cell *cell);
46 void (*cell_exit)(struct cell *cell);
47 int (*cpu_reset)(struct per_cpu *cpu_data, bool is_shutdown);
49 int (*send_sgi)(struct sgi *sgi);
50 void (*handle_irq)(struct per_cpu *cpu_data);
51 void (*eoi_irq)(u32 irqn, bool deactivate);
52 int (*inject_irq)(struct per_cpu *cpu_data, u16 irq_id);
53 void (*enable_maint_irq)(bool enable);
55 int (*mmio_access)(struct mmio_access *access);
58 unsigned int irqchip_mmio_count_regions(struct cell *cell);
60 int irqchip_init(void);
61 int irqchip_cpu_init(struct per_cpu *cpu_data);
62 int irqchip_cpu_reset(struct per_cpu *cpu_data);
63 void irqchip_cpu_shutdown(struct per_cpu *cpu_data);
65 int irqchip_cell_init(struct cell *cell);
66 void irqchip_cell_exit(struct cell *cell);
67 void irqchip_root_cell_shrink(struct cell *cell);
69 int irqchip_send_sgi(struct sgi *sgi);
70 void irqchip_handle_irq(struct per_cpu *cpu_data);
71 void irqchip_eoi_irq(u32 irqn, bool deactivate);
73 void irqchip_inject_pending(struct per_cpu *cpu_data);
74 void irqchip_set_pending(struct per_cpu *cpu_data, u16 irq_id);
76 bool irqchip_irq_in_cell(struct cell *cell, unsigned int irq_id);
78 #endif /* __ASSEMBLY__ */
79 #endif /* _JAILHOUSE_ASM_IRQCHIP_H */