From 053347375bc00a490ce08fe2b9d78a65183ce95a Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 11 Jun 2024 17:44:13 +0200 Subject: [PATCH] arch: arm: Fix missing include for sys_define_gpr_with_alias The sys_define_gpr_with_alias macro was defined by arch.h, but was used by the two exception.h files that did not include it. Attempting to include arch.h from exception.h would resolve in a recursive include, so the macro was simply moved to the files that used it. An alternative could have been to define a new file that defined it, that could have been included by exception.h Signed-off-by: Emil Gydesen --- include/zephyr/arch/arm/arch.h | 3 --- include/zephyr/arch/arm/cortex_a_r/exception.h | 3 +++ include/zephyr/arch/arm/cortex_m/exception.h | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/zephyr/arch/arm/arch.h b/include/zephyr/arch/arm/arch.h index 804e1d23dbdd51..2da9e7f3d81ca9 100644 --- a/include/zephyr/arch/arm/arch.h +++ b/include/zephyr/arch/arm/arch.h @@ -19,9 +19,6 @@ /* Add include for DTS generated information */ #include -/* ARM GPRs are often designated by two different names */ -#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; } - #include #include #include diff --git a/include/zephyr/arch/arm/cortex_a_r/exception.h b/include/zephyr/arch/arm/cortex_a_r/exception.h index cd8377bc3a70c5..8fcc6d0eb01a0d 100644 --- a/include/zephyr/arch/arm/cortex_a_r/exception.h +++ b/include/zephyr/arch/arm/cortex_a_r/exception.h @@ -54,6 +54,9 @@ struct __extra_esf_info { }; #endif /* CONFIG_EXTRA_EXCEPTION_INFO */ +/* ARM GPRs are often designated by two different names */ +#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; } + struct arch_esf { #if defined(CONFIG_EXTRA_EXCEPTION_INFO) struct __extra_esf_info extra_info; diff --git a/include/zephyr/arch/arm/cortex_m/exception.h b/include/zephyr/arch/arm/cortex_m/exception.h index 2deed9bdf832df..6f60317891d9a8 100644 --- a/include/zephyr/arch/arm/cortex_m/exception.h +++ b/include/zephyr/arch/arm/cortex_m/exception.h @@ -98,6 +98,9 @@ struct __extra_esf_info { }; #endif /* CONFIG_EXTRA_EXCEPTION_INFO */ +/* ARM GPRs are often designated by two different names */ +#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; } + struct arch_esf { struct __basic_sf { sys_define_gpr_with_alias(a1, r0);