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
+4
View File
@@ -40,4 +40,8 @@ if(CONFIG_SPINLOCK)
list(APPEND CSRCS spinlock.c)
endif()
if(CONFIG_TICKET_SPINLOCK)
list(APPEND CSRCS spinlock.c)
endif()
target_sources(sched PRIVATE ${CSRCS})