Skip to content

Commit

Permalink
arch/arm/rp23xx: Set priority for svcall exception
Browse files Browse the repository at this point in the history
Fixes apache#15503.

Signed-off-by: Ian Douglas Scott <[email protected]>
  • Loading branch information
ids1024 authored and linguini1 committed Jan 16, 2025
1 parent 33e4d6f commit 1526b55
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions arch/arm/src/rp23xx/rp23xx_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,27 @@ static int rp23xx_reserved(int irq, void *context, void *arg)
}
#endif

/****************************************************************************
* Name: rp23xx_prioritize_syscall
*
* Description:
* Set the priority of an exception. This function may be needed
* internally even if support for prioritized interrupts is not enabled.
*
****************************************************************************/

static inline void rp23xx_prioritize_syscall(int priority)
{
uint32_t regval;

/* SVCALL is system handler 11 */

regval = getreg32(NVIC_SYSH8_11_PRIORITY);
regval &= ~NVIC_SYSH_PRIORITY_PR11_MASK;
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY);
}

/****************************************************************************
* Name: rp23xx_clrpend
*
Expand Down Expand Up @@ -276,6 +297,8 @@ void up_irqinitialize(void)
irq_attach(RP23XX_IRQ_SVCALL, arm_svcall, NULL);
irq_attach(RP23XX_IRQ_HARDFAULT, arm_hardfault, NULL);

rp23xx_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);

/* Attach all other processor exceptions (except reset and sys tick) */

#ifdef CONFIG_DEBUG_FEATURES
Expand Down

0 comments on commit 1526b55

Please sign in to comment.