]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
irqchip/loongarch-avec: Prepare for interrupt redirection support
authorTianyang Zhang <zhangtianyang@loongson.cn>
Wed, 13 May 2026 01:28:33 +0000 (09:28 +0800)
committerThomas Gleixner <tglx@kernel.org>
Wed, 3 Jun 2026 20:28:11 +0000 (22:28 +0200)
Interrupt redirection support requires a new interrupt chip, which needs
to share data structures, constants and functions with the AVECINTC code.

So move them to the header file and make the required functions public.

Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://patch.msgid.link/20260513012839.2856463-3-zhangtianyang@loongson.cn
drivers/irqchip/irq-loongarch-avec.c
drivers/irqchip/irq-loongson.h

index 758262fd5bd6097a8b0d35c43d4d881ae39cd4c9..2817339e10806f0ef56276e6876b962016d06c92 100644 (file)
@@ -24,7 +24,6 @@
 #define VECTORS_PER_REG                64
 #define IRR_VECTOR_MASK                0xffUL
 #define IRR_INVALID_MASK       0x80000000UL
-#define AVEC_MSG_OFFSET                0x100000
 
 #ifdef CONFIG_SMP
 struct pending_list {
@@ -47,15 +46,6 @@ struct avecintc_chip {
 
 static struct avecintc_chip loongarch_avec;
 
-struct avecintc_data {
-       struct list_head        entry;
-       unsigned int            cpu;
-       unsigned int            vec;
-       unsigned int            prev_cpu;
-       unsigned int            prev_vec;
-       unsigned int            moving;
-};
-
 static inline void avecintc_enable(void)
 {
 #ifdef CONFIG_MACH_LOONGSON64
@@ -87,7 +77,7 @@ static inline void pending_list_init(int cpu)
        INIT_LIST_HEAD(&plist->head);
 }
 
-static void avecintc_sync(struct avecintc_data *adata)
+void avecintc_sync(struct avecintc_data *adata)
 {
        struct pending_list *plist;
 
index 11fa138d1f4434ebdfb2ae49e5b781dee913c5ba..f0b6767f39b304e1af912c0e4503452bdc7ac325 100644 (file)
@@ -6,6 +6,17 @@
 #ifndef _DRIVERS_IRQCHIP_IRQ_LOONGSON_H
 #define _DRIVERS_IRQCHIP_IRQ_LOONGSON_H
 
+#define AVEC_MSG_OFFSET                0x100000
+
+struct avecintc_data {
+       struct list_head        entry;
+       unsigned int            cpu;
+       unsigned int            vec;
+       unsigned int            prev_cpu;
+       unsigned int            prev_vec;
+       unsigned int            moving;
+};
+
 int find_pch_pic(u32 gsi);
 
 int liointc_acpi_init(struct irq_domain *parent,
@@ -24,4 +35,6 @@ int pch_msi_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_msi_pic *acpi_pchmsi);
 int pch_msi_acpi_init_avec(struct irq_domain *parent);
 
+void avecintc_sync(struct avecintc_data *adata);
+
 #endif /* _DRIVERS_IRQCHIP_IRQ_LOONGSON_H */