From 53057f65e47101a7fa8072e03c49217401148969 Mon Sep 17 00:00:00 2001 From: Jeff Tenney Date: Tue, 25 Aug 2026 18:15:48 -0700 Subject: [PATCH] Optimize SVCall priority on ARMv8-M --- portable/ARMv8M/non_secure/port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portable/ARMv8M/non_secure/port.c b/portable/ARMv8M/non_secure/port.c index c0cb54008..e5837f98d 100644 --- a/portable/ARMv8M/non_secure/port.c +++ b/portable/ARMv8M/non_secure/port.c @@ -103,6 +103,7 @@ typedef void ( * portISR_t )( void ); #define portMIN_INTERRUPT_PRIORITY ( 255UL ) #define portNVIC_PENDSV_PRI ( portMIN_INTERRUPT_PRIORITY << 16UL ) #define portNVIC_SYSTICK_PRI ( portMIN_INTERRUPT_PRIORITY << 24UL ) +#define portNVIC_SVC_PRI ( ( ( uint32_t ) configMAX_SYSCALL_INTERRUPT_PRIORITY - 1UL ) << 24UL ) /*-----------------------------------------------------------*/ /** @@ -2286,7 +2287,7 @@ void vPortConfigureInterruptPriorities( void ) /* PRIVILEGED_FUNCTION */ * the highest priority. */ portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI; portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI; - portNVIC_SHPR2_REG = 0; + portNVIC_SHPR2_REG = portNVIC_SVC_PRI; } /*-----------------------------------------------------------*/