sys_clock: Lock interrupts when processing announced ticks
Interrupts must be locked when processing announced ticks in _nano_sys_clock_tick_announce(). This prevents higher priority interrupts from interrupting the tick announcement and possibly corrupting the timeout and/or timer queues. Change-Id: I4e87fc5b3ad36161e0accb50b2691f975f5877e5 Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
parent
1b7b470cb0
commit
61e6f4a299
1 changed files with 4 additions and 0 deletions
|
@ -201,9 +201,13 @@ static inline void handle_expired_nano_timers(int ticks)
|
||||||
*/
|
*/
|
||||||
void _nano_sys_clock_tick_announce(int32_t ticks)
|
void _nano_sys_clock_tick_announce(int32_t ticks)
|
||||||
{
|
{
|
||||||
|
unsigned int key;
|
||||||
|
|
||||||
|
key = irq_lock();
|
||||||
_sys_clock_tick_count += ticks;
|
_sys_clock_tick_count += ticks;
|
||||||
handle_expired_nano_timeouts(ticks);
|
handle_expired_nano_timeouts(ticks);
|
||||||
handle_expired_nano_timers(ticks);
|
handle_expired_nano_timers(ticks);
|
||||||
|
irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get closest nano timers deadline expiry, (uint32_t)TICKS_UNLIMITED if none */
|
/* get closest nano timers deadline expiry, (uint32_t)TICKS_UNLIMITED if none */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue