tests: kernel: arm_irq_vector_table: add clock ISR in the IRQ vector

This commit adds the Clock Control Interrupt Service
Routine into the customized vector table, when building
for nRF52X-based platforms. As a result, the interrupts
generated by the clock control will not interfere with
the test.

Fixes #13823.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-02-27 16:07:30 +01:00 committed by Anas Nashif
commit 1e74007606
2 changed files with 16 additions and 3 deletions

View file

@ -276,7 +276,15 @@ static inline void power_event_cb(nrf_power_event_t event)
}
#endif
static void _power_clock_isr(void *arg)
/* Note: this function has public linkage, and MUST have this
* particular name. The platform architecture itself doesn't care,
* but there is a test (tests/kernel/arm_irq_vector_table) that needs
* to find it to it can set it in a custom vector table. Should
* probably better abstract that at some point (e.g. query and reset
* it by pointer at runtime, maybe?) so we don't have this leaky
* symbol.
*/
void nrf_power_clock_isr(void *arg)
{
u8_t pof, hf_intenset, hf, lf_intenset, lf;
#if NRF_CLOCK_HAS_CALIBRATION
@ -437,7 +445,7 @@ static int _clock_control_init(struct device *dev)
*/
IRQ_CONNECT(DT_NORDIC_NRF_CLOCK_0_IRQ_0,
DT_NORDIC_NRF_CLOCK_0_IRQ_0_PRIORITY,
_power_clock_isr, 0, 0);
nrf_power_clock_isr, 0, 0);
irq_enable(DT_NORDIC_NRF_CLOCK_0_IRQ_0);

View file

@ -137,11 +137,16 @@ typedef void (*vth)(void); /* Vector Table Handler */
* to implement the Kernel system timer, instead of the ARM Cortex-M
* SysTick. Therefore, a pointer to the timer ISR needs to be added in
* the custom vector table to handle the timer "tick" interrupts.
*
* The same applies to the CLOCK Control peripheral, which may trigger
* IRQs that would need to be serviced.
*/
void rtc1_nrf_isr(void);
void nrf_power_clock_isr(void);
vth __irq_vector_table _irq_vector_table[RTC1_IRQn + 1] = {
nrf_power_clock_isr,
isr0, isr1, isr2,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
rtc1_nrf_isr
};
#else