2022-05-31 18:04:11 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
|
|
|
|
*/
|
|
|
|
#ifndef _ASM_HARDIRQ_H
|
|
|
|
#define _ASM_HARDIRQ_H
|
|
|
|
|
|
|
|
#include <linux/cache.h>
|
|
|
|
#include <linux/threads.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
|
|
|
|
extern void ack_bad_irq(unsigned int irq);
|
|
|
|
#define ack_bad_irq ack_bad_irq
|
|
|
|
|
2024-08-23 18:39:33 +08:00
|
|
|
#define NR_IPI 4
|
2022-05-31 18:04:11 +08:00
|
|
|
|
2024-05-06 22:00:46 +08:00
|
|
|
enum ipi_msg_type {
|
|
|
|
IPI_RESCHEDULE,
|
|
|
|
IPI_CALL_FUNCTION,
|
2024-07-20 22:40:58 +08:00
|
|
|
IPI_IRQ_WORK,
|
2024-08-23 18:39:33 +08:00
|
|
|
IPI_CLEAR_VECTOR,
|
2024-05-06 22:00:46 +08:00
|
|
|
};
|
|
|
|
|
2022-05-31 18:04:11 +08:00
|
|
|
typedef struct {
|
|
|
|
unsigned int ipi_irqs[NR_IPI];
|
|
|
|
unsigned int __softirq_pending;
|
2024-05-06 22:00:47 +08:00
|
|
|
atomic_t message ____cacheline_aligned_in_smp;
|
2022-05-31 18:04:11 +08:00
|
|
|
} ____cacheline_aligned irq_cpustat_t;
|
|
|
|
|
LoongArch: Fix the !CONFIG_SMP build
1, We assume arch/loongarch/include/asm/smp.h be included in include/
linux/smp.h is valid and the reverse inclusion isn't. So remove the
<linux/smp.h> in arch/loongarch/include/asm/smp.h.
2, arch/loongarch/include/asm/smp.h is only needed when CONFIG_SMP,
and setup.c include it only because it need plat_smp_setup(). So,
reorganize setup.c & smp.h, and then remove <asm/smp.h> in setup.c.
3, Fix cacheinfo.c and percpu.h build error by adding the missing header
files when !CONFIG_SMP.
4, Fix acpi.c build error by adding CONFIG_SMP guards.
5, Move irq_stat definition from smp.c to irq.c and fix its declaration.
6, Select CONFIG_SMP for CONFIG_NUMA, similar as other architectures do.
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2022-06-05 16:19:53 +08:00
|
|
|
DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
|
2022-05-31 18:04:11 +08:00
|
|
|
|
2022-05-31 18:04:12 +08:00
|
|
|
#define __ARCH_IRQ_STAT
|
|
|
|
|
2022-05-31 18:04:11 +08:00
|
|
|
#endif /* _ASM_HARDIRQ_H */
|