git: d64442a89896 - main - arm{,64}: use genassym for INTR_ROOT_* values
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 24 Oct 2024 03:58:19 UTC
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d64442a89896d616eb1225eea43ed64dc736f74d commit d64442a89896d616eb1225eea43ed64dc736f74d Author: Elliott Mitchell <ehem+freebsd@m5p.com> AuthorDate: 2024-10-24 03:55:21 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2024-10-24 03:55:21 +0000 arm{,64}: use genassym for INTR_ROOT_* values Rather than keeping the entire machine interrupt header assembly-safe, switch to use of the existing genassym.c program to generate them. This will be handier in the long-term, most of the header never needs to be exposed to assembly-language. --- sys/arm/arm/exception.S | 3 +-- sys/arm/arm/genassym.c | 2 ++ sys/arm64/arm64/exception.S | 3 +-- sys/arm64/arm64/genassym.c | 5 +++++ sys/arm64/include/intr.h | 3 --- sys/sys/intr.h | 4 ---- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/arm/arm/exception.S b/sys/arm/arm/exception.S index a17898a53d49..3df91d6e3c1e 100644 --- a/sys/arm/arm/exception.S +++ b/sys/arm/arm/exception.S @@ -48,12 +48,11 @@ #include "assym.inc" -#include <sys/intr.h> - #include <machine/asm.h> #include <machine/armreg.h> #include <machine/asmacros.h> #include <machine/trap.h> + #ifdef KDTRACE_HOOKS .bss .align 4 diff --git a/sys/arm/arm/genassym.c b/sys/arm/arm/genassym.c index b7c3512dcb16..2cf1861b1178 100644 --- a/sys/arm/arm/genassym.c +++ b/sys/arm/arm/genassym.c @@ -131,6 +131,8 @@ ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size)); ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask)); +ASSYM(INTR_ROOT_IRQ, INTR_ROOT_IRQ); + /* * Emit the LOCORE_MAP_MB option as a #define only if the option was set. */ diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index b3f2a3931e08..d8c024d01921 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -26,11 +26,10 @@ */ #include <sys/elf_common.h> -#include <sys/intr.h> #include <machine/asm.h> #include <machine/armreg.h> -#include <machine/intr.h> + #include "assym.inc" .text diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c index 8cbafba45a7d..db076e1ebf48 100644 --- a/sys/arm64/arm64/genassym.c +++ b/sys/arm64/arm64/genassym.c @@ -28,10 +28,12 @@ #include <sys/param.h> #include <sys/assym.h> +#include <sys/bus.h> #include <sys/pcpu.h> #include <sys/proc.h> #include <machine/frame.h> +#include <machine/intr.h> #include <machine/machdep.h> #include <machine/pcb.h> @@ -77,3 +79,6 @@ ASSYM(TF_ELR, offsetof(struct trapframe, tf_elr)); ASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr)); ASSYM(TF_ESR, offsetof(struct trapframe, tf_esr)); ASSYM(TF_X, offsetof(struct trapframe, tf_x)); + +ASSYM(INTR_ROOT_IRQ, INTR_ROOT_IRQ); +ASSYM(INTR_ROOT_FIQ, INTR_ROOT_FIQ); diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h index f7aa2de0ee00..99b4d15ccc1c 100644 --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -27,7 +27,6 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ -#ifndef LOCORE #ifdef FDT #include <dev/ofw/openfirm.h> #endif @@ -49,8 +48,6 @@ arm_irq_memory_barrier(uintptr_t irq) #define ACPI_GPIO_XREF 3 #endif -#endif /* !LOCORE */ - #define INTR_ROOT_FIQ 1 #define INTR_ROOT_NUM 2 diff --git a/sys/sys/intr.h b/sys/sys/intr.h index 54e838e5015a..c1e440a9fa93 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -33,15 +33,12 @@ #error Need INTRNG for this file #endif -#ifndef LOCORE #include <sys/systm.h> -#endif #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, @@ -172,5 +169,4 @@ void intr_ipi_dispatch(u_int ipi); /* 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 */