diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h --- a/sys/arm/include/intr.h +++ b/sys/arm/include/intr.h @@ -39,14 +39,16 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#ifndef LOCORE #ifdef FDT #include #endif +void arm_irq_memory_barrier(uintptr_t); +#endif /* !LOCORE */ + #ifndef NIRQ #define NIRQ 1024 /* XXX - It should be an option. */ #endif -void arm_irq_memory_barrier(uintptr_t); - #endif /* _MACHINE_INTR_H */ diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -27,18 +27,20 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#ifndef LOCORE #ifdef FDT #include #endif -#ifndef NIRQ -#define NIRQ 16384 /* XXX - It should be an option. */ -#endif - static inline void arm_irq_memory_barrier(uintptr_t irq) { } +#endif /* !LOCORE */ + +#ifndef NIRQ +#define NIRQ 16384 /* XXX - It should be an option. */ +#endif #ifdef DEV_ACPI #define ACPI_INTR_XREF 1 diff --git a/sys/riscv/include/intr.h b/sys/riscv/include/intr.h --- a/sys/riscv/include/intr.h +++ b/sys/riscv/include/intr.h @@ -39,6 +39,7 @@ #define NIRQ 1024 #endif +#ifndef LOCORE enum { IRQ_SOFTWARE_USER, IRQ_SOFTWARE_SUPERVISOR, @@ -53,5 +54,6 @@ IRQ_EXTERNAL_HYPERVISOR, IRQ_EXTERNAL_MACHINE, }; +#endif /* !LOCORE */ #endif /* !_MACHINE_INTR_MACHDEP_H_ */ diff --git a/sys/sys/intr.h b/sys/sys/intr.h --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -33,14 +33,14 @@ #error Need INTRNG for this file #endif -#include - #include #define INTR_IRQ_INVALID 0xFFFFFFFF #define INTR_ROOT_IRQ 0 +#ifndef LOCORE + enum intr_map_data_type { INTR_MAP_DATA_ACPI = 0, INTR_MAP_DATA_FDT, @@ -171,4 +171,6 @@ /* Main interrupt handler called from asm on most archs except riscv. */ void intr_irq_handler(struct trapframe *tf, uint32_t rootnum); +#endif /* !LOCORE */ + #endif /* _SYS_INTR_H */