Verified Commit fb49965e authored by Felix Kopp's avatar Felix Kopp
Browse files

atomic_enter: actually mask interrupts

parent 27939716
......@@ -7,12 +7,14 @@ static ATOM(atomic_context);
void atomic_enter(void)
{
atom_get(&atomic_context);
if (atom_get(&atomic_context) == 1)
__asm__ volatile("cpsid i");
}
void atomic_leave(void)
{
atom_put(&atomic_context);
if (atom_put(&atomic_context) == 0)
__asm__ volatile("cpsie i");
}
int is_atomic(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment