xen/riscv: introduce register_intc_ops() and intc_hw_ops

Introduce the intc_hw_operations structure to encapsulate interrupt
controller-specific data and operations. This structure includes:
- A pointer to interrupt controller information (`intc_info`)
- Callbacks to initialize the controller and set IRQ type/priority
- A reference to an interupt controller descriptor (`host_irq_type`)
- number of interrupt controller irqs.

Add function register_intc_ops() to mentioned above structure.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Oleksii Kurochko authored and Jan Beulich committed 2025-06-16 10:15:41 +02:00
1 parent dc89505f80
commit 0aae2e3a91
2 files changed
+28

No files matched your search

+19
View File
@@ -14,11 +14,30 @@ enum intc_version {
INTC_APLIC,
};
struct irq_desc;
struct intc_info {
enum intc_version hw_version;
const struct dt_device_node *node;
};
struct intc_hw_operations {
/* Hold intc hw information */
const struct intc_info *info;
/* Initialize the intc and the boot CPU */
int (*init)(void);
/* hw_irq_controller to enable/disable/eoi host irq */
const struct hw_interrupt_type *host_irq_type;
/* Set IRQ type */
void (*set_irq_type)(struct irq_desc *desc, unsigned int type);
/* Set IRQ priority */
void (*set_irq_priority)(struct irq_desc *desc, unsigned int priority);
};
void intc_preinit(void);
void register_intc_ops(const struct intc_hw_operations *ops);
#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
+9
View File
@@ -5,6 +5,15 @@
#include <xen/init.h>
#include <xen/lib.h>
#include <asm/intc.h>
static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
void __init register_intc_ops(const struct intc_hw_operations *ops)
{
intc_hw_ops = ops;
}
void __init intc_preinit(void)
{
if ( acpi_disabled )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.