Feature: implement ticket spinlock

test config: ./tools/configure.sh -l qemu-armv8a:nsh_smp

Pass ostest

No matter big-endian or little-endian, ticket spinlock only check the
next and the owner is equal or not.

If they are equal, it means there is a task hold the lock or lock is
free.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
This commit is contained in:
TaiJu Wu
2023-10-05 19:19:08 +00:00
committed by Xiang Xiao
parent 643b9c1abf
commit ffba0d15a5
7 changed files with 119 additions and 17 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ static bool irq_waitlock(int cpu)
* for the deadlock condition.
*/
while (spin_trylock_wo_note(&g_cpu_irqlock) == SP_LOCKED)
while (!spin_trylock_wo_note(&g_cpu_irqlock))
{
/* Is a pause request pending? */