From 5b67935dafb40c49ac1fbf0666cb223d08fcaae1 Mon Sep 17 00:00:00 2001 From: tanche <> Date: Fri, 17 Jan 2025 11:36:48 +0100 Subject: [PATCH] update IAR CM3 port to avoid including FreeRTOSConfig.h in portasm.s --- portable/IAR/ARM_CM3/port.c | 5 +++++ portable/IAR/ARM_CM3/portasm.s | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/portable/IAR/ARM_CM3/port.c b/portable/IAR/ARM_CM3/port.c index ef590cf95..5dcf92a3e 100644 --- a/portable/IAR/ARM_CM3/port.c +++ b/portable/IAR/ARM_CM3/port.c @@ -137,6 +137,11 @@ extern void vPortSVCHandler( void ); extern void xPortPendSVHandler( void ); /*-----------------------------------------------------------*/ +/* store Max Syscall Interrupt Priority to be able to get it + * in portasm.s without included FreeRTOSConfig.h + */ +const uint32_t portConfigMaxSyscallIntPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY; + /* Each task maintains its own interrupt status in the critical nesting * variable. */ static UBaseType_t uxCriticalNesting = 0xaaaaaaaa; diff --git a/portable/IAR/ARM_CM3/portasm.s b/portable/IAR/ARM_CM3/portasm.s index 7b2afde98..8c93ec05a 100644 --- a/portable/IAR/ARM_CM3/portasm.s +++ b/portable/IAR/ARM_CM3/portasm.s @@ -26,13 +26,13 @@ * */ -#include RSEG CODE:CODE(2) thumb EXTERN pxCurrentTCB EXTERN vTaskSwitchContext + EXTERN portConfigMaxSyscallIntPriority PUBLIC xPortPendSVHandler PUBLIC vPortSVCHandler @@ -52,7 +52,7 @@ xPortPendSVHandler: str r0, [r2] /* Save the new top of stack into the first member of the TCB. */ stmdb sp!, {r3, r14} - mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY + ldr r0, =portConfigMaxSyscallIntPriority msr basepri, r0 dsb isb