|
|
|
@ -209,7 +209,7 @@ static int kinetis_reserved(int irq, FAR void *context)
@@ -209,7 +209,7 @@ static int kinetis_reserved(int irq, FAR void *context)
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
|
* Name: up_prioritize_irq |
|
|
|
|
* Name: kinetis_prioritize_syscall |
|
|
|
|
* |
|
|
|
|
* Description: |
|
|
|
|
* Set the priority of an exception. This function may be needed |
|
|
|
@ -217,23 +217,17 @@ static int kinetis_reserved(int irq, FAR void *context)
@@ -217,23 +217,17 @@ static int kinetis_reserved(int irq, FAR void *context)
|
|
|
|
|
* |
|
|
|
|
****************************************************************************/ |
|
|
|
|
|
|
|
|
|
#if !defined(CONFIG_ARCH_IRQPRIO) && defined(CONFIG_ARMV7M_USEBASEPRI) |
|
|
|
|
static int up_prioritize_irq(int irq, int priority) |
|
|
|
|
#ifdef CONFIG_ARMV7M_USEBASEPRI |
|
|
|
|
static inline void kinetis_prioritize_syscall(int priority) |
|
|
|
|
{ |
|
|
|
|
uint32_t regaddr; |
|
|
|
|
uint32_t regval; |
|
|
|
|
int shift; |
|
|
|
|
|
|
|
|
|
irq -= 4; |
|
|
|
|
regaddr = NVIC_SYSH_PRIORITY(irq); |
|
|
|
|
regval = getreg32(regaddr); |
|
|
|
|
shift = ((irq & 3) << 3); |
|
|
|
|
regval &= ~(0xff << shift); |
|
|
|
|
regval |= (priority << shift); |
|
|
|
|
putreg32(regval, regaddr); |
|
|
|
|
/* SVCALL is system handler 11 */ |
|
|
|
|
|
|
|
|
|
stm32_dumpnvic("prioritize", irq); |
|
|
|
|
return OK; |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -389,7 +383,7 @@ void up_irqinitialize(void)
@@ -389,7 +383,7 @@ void up_irqinitialize(void)
|
|
|
|
|
/* up_prioritize_irq(KINETIS_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ |
|
|
|
|
#endif |
|
|
|
|
#ifdef CONFIG_ARMV7M_USEBASEPRI |
|
|
|
|
up_prioritize_irq(KINETIS_IRQ_SVCALL, NVIC_SYSH_SVCALL_PRIORITY); |
|
|
|
|
kinetis_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* If the MPU is enabled, then attach and enable the Memory Management
|
|
|
|
@ -528,11 +522,17 @@ int up_prioritize_irq(int irq, int priority)
@@ -528,11 +522,17 @@ int up_prioritize_irq(int irq, int priority)
|
|
|
|
|
|
|
|
|
|
if (irq < KINETIS_IRQ_EXTINT) |
|
|
|
|
{ |
|
|
|
|
irq -= 4; |
|
|
|
|
/* NVIC_SYSH_PRIORITY() maps {0..15} to one of three priority
|
|
|
|
|
* registers (0-3 are invalid) |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
regaddr = NVIC_SYSH_PRIORITY(irq); |
|
|
|
|
irq -= 4; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
/* NVIC_IRQ_PRIORITY() maps {0..} to one of many priority registers */ |
|
|
|
|
|
|
|
|
|
irq -= KINETIS_IRQ_EXTINT; |
|
|
|
|
regaddr = NVIC_IRQ_PRIORITY(irq); |
|
|
|
|
} |
|
|
|
|