use also the ticket lock workaround for irq save spinlocks
This commit is contained in:
parent
2acd2a2f57
commit
298670b0db
1 changed files with 8 additions and 0 deletions
|
@ -183,10 +183,14 @@ inline static int spinlock_irqsave_lock(spinlock_irqsave_t* s) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
ticket = atomic_int32_inc(&s->queue);
|
||||
while (atomic_int32_read(&s->dequeue) != ticket) {
|
||||
NOP1;
|
||||
}
|
||||
#else
|
||||
while( atomic_int32_test_and_set(&s->dequeue,0) );
|
||||
#endif
|
||||
|
||||
s->coreid = CORE_ID;
|
||||
s->flags = flags;
|
||||
|
@ -211,7 +215,11 @@ inline static int spinlock_irqsave_unlock(spinlock_irqsave_t* s) {
|
|||
flags = s->flags;
|
||||
s->coreid = (uint32_t) -1;
|
||||
s->flags = 0;
|
||||
#if 0
|
||||
atomic_int32_inc(&s->dequeue);
|
||||
#else
|
||||
atomic_int32_set(&s->dequeue,1);
|
||||
#endif
|
||||
irq_nested_enable(flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue