#ifndef _JAILHOUSE_ASM_IRQCHIP_H
#define _JAILHOUSE_ASM_IRQCHIP_H
-/*
- * Since there is no finer-grained allocation than page-alloc for the moment,
- * and it is very complicated to predict the total size needed at
- * initialisation, each cpu is allocated one page of pending irqs.
- * This allows for 256 pending IRQs, which should be sufficient.
- */
-#define MAX_PENDING_IRQS (PAGE_SIZE / sizeof(struct pending_irq))
+#define MAX_PENDING_IRQS 256
#include <jailhouse/cell.h>
#include <jailhouse/mmio.h>
-#include <asm/percpu.h>
#ifndef __ASSEMBLY__
+struct per_cpu;
+
struct sgi {
/*
* Routing mode values:
int (*cell_init)(struct cell *cell);
void (*cell_exit)(struct cell *cell);
int (*cpu_reset)(struct per_cpu *cpu_data, bool is_shutdown);
+ void (*adjust_irq_target)(struct cell *cell, u16 irq_id);
int (*send_sgi)(struct sgi *sgi);
void (*handle_irq)(struct per_cpu *cpu_data);
void (*eoi_irq)(u32 irqn, bool deactivate);
- int (*inject_irq)(struct per_cpu *cpu_data,
- struct pending_irq *irq);
+ int (*inject_irq)(struct per_cpu *cpu_data, u16 irq_id);
+ void (*enable_maint_irq)(bool enable);
int (*mmio_access)(struct mmio_access *access);
};
-/* Virtual interrupts waiting to be injected */
-struct pending_irq {
- u32 virt_id;
-
- struct pending_irq *next;
- struct pending_irq *prev;
-} __attribute__((packed));
-
unsigned int irqchip_mmio_count_regions(struct cell *cell);
int irqchip_init(void);
int irqchip_cell_init(struct cell *cell);
void irqchip_cell_exit(struct cell *cell);
-void irqchip_root_cell_shrink(struct cell *cell);
int irqchip_send_sgi(struct sgi *sgi);
void irqchip_handle_irq(struct per_cpu *cpu_data);
void irqchip_eoi_irq(u32 irqn, bool deactivate);
void irqchip_inject_pending(struct per_cpu *cpu_data);
-int irqchip_insert_pending(struct per_cpu *cpu_data, struct pending_irq *irq);
-int irqchip_remove_pending(struct per_cpu *cpu_data, struct pending_irq *irq);
-int irqchip_set_pending(struct per_cpu *cpu_data, u32 irq_id, bool try_inject);
+void irqchip_set_pending(struct per_cpu *cpu_data, u16 irq_id);
-bool spi_in_cell(struct cell *cell, unsigned int spi);
+bool irqchip_irq_in_cell(struct cell *cell, unsigned int irq_id);
#endif /* __ASSEMBLY__ */
#endif /* _JAILHOUSE_ASM_IRQCHIP_H */