Skip to content
Commit 4cc97398 authored by Peter Mitsis's avatar Peter Mitsis Committed by Henrik Brix Andersen
Browse files

arch: Update arch_is_in_isr() SMP implementations



Fixes a flaw in implementations of arch_is_in_isr() that could manifest
on SMP systems. If the reading of the current CPU's nested interrupt
count is not fully atomic on an SMP system, then an ill-timed context
switch could occur leaving the caller reading the nested interrupt
count of a different CPU.

This also applies a little defensive programming to cortex_a_r's
arch_is_in_nested_exception(). Although this routine is presently
only called with interrupts locked (which will prevent the thread
from migrating), switching to use _current_cpu instead of
arch_curr_cpu() is safer as should the routine ever be called
without meeting the locking criteria, it can be detected and fixed.

Signed-off-by: default avatarPeter Mitsis <peter.mitsis@intel.com>
parent 85b8ae9b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment