Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rp23xx_irq.c: fix regression from https://github.com/apache/nuttx/pull/15073 #15505

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions arch/arm/src/rp23xx/rp23xx_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,27 @@ static inline void rp23xx_clrpend(int irq)
}
}

/****************************************************************************
* 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_function 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);
}

/****************************************************************************
* Public Functions
****************************************************************************/
Expand Down Expand Up @@ -276,6 +297,10 @@ void up_irqinitialize(void)
irq_attach(RP23XX_IRQ_SVCALL, arm_svcall, NULL);
irq_attach(RP23XX_IRQ_HARDFAULT, arm_hardfault, NULL);

/* Set the priority of the SVCall interrupt */

rp23xx_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);

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

#ifdef CONFIG_DEBUG_FEATURES
Expand Down
Loading