arch: arm: cortex_r/a: Fix multiple use of ARCH_EXCEPT in same scope

Pull the register variable into the private scope that ARCH_EXCEPT
creates so that the macro can be used multiple times in the same caller
scope. This can happen via k_panic(), e.g. in subsys/fs/ext2/ext2_impl.c.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2024-10-05 15:50:40 +02:00 committed by Benjamin Cabé
parent da91dbdd52
commit fa66a9be57

View file

@ -53,8 +53,8 @@ do {\
* z_check_stack_sentinel call if it is not stacked before the svc.
*/
#define ARCH_EXCEPT(reason_p) \
register uint32_t r0 __asm__("r0") = reason_p; \
do { \
register uint32_t r0 __asm__("r0") = reason_p; \
__asm__ volatile ( \
"push {lr}\n\t" \
"cpsie i\n\t" \