libc/semaphore: Move fast mutex wait/post paths to libc

This avoids unnecessary syscalls in memory protected builds, when mutex
lock/unlock can be done with only atomic counter access

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen
2025-03-21 10:26:42 +02:00
committed by Xiang Xiao
parent 73ee052b3f
commit 19a8e2403f
10 changed files with 212 additions and 192 deletions
+3 -3
View File
@@ -92,13 +92,13 @@
"nxsem_destroy","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_getprioceiling","nuttx/semaphore.h","defined(CONFIG_PRIORITY_PROTECT)","int","FAR const sem_t *","FAR int *"
"nxsem_open","nuttx/semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR sem_t **","FAR const char *","int","...","mode_t","unsigned int"
"nxsem_post","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_post_slow","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_set_protocol","nuttx/semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t *","int"
"nxsem_setprioceiling","nuttx/semaphore.h","defined(CONFIG_PRIORITY_PROTECT)","int","FAR sem_t *","int","FAR int *"
"nxsem_timedwait","nuttx/semaphore.h","","int","FAR sem_t *","FAR const struct timespec *"
"nxsem_trywait","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_trywait_slow","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_unlink","nuttx/semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR const char *"
"nxsem_wait","nuttx/semaphore.h","","int","FAR sem_t *"
"nxsem_wait_slow","nuttx/semaphore.h","","int","FAR sem_t *"
"open","fcntl.h","","int","FAR const char *","int","...","mode_t"
"pgalloc", "nuttx/arch.h", "defined(CONFIG_BUILD_KERNEL)", "uintptr_t", "uintptr_t", "unsigned int"
"pipe2","unistd.h","defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0","int","int [2]|FAR int *","int"
1 _assert assert.h void FAR const char * int FAR const char * FAR void *
92 nxsem_destroy nuttx/semaphore.h int FAR sem_t *
93 nxsem_getprioceiling nuttx/semaphore.h defined(CONFIG_PRIORITY_PROTECT) int FAR const sem_t * FAR int *
94 nxsem_open nuttx/semaphore.h defined(CONFIG_FS_NAMED_SEMAPHORES) int FAR sem_t ** FAR const char * int ...
95 nxsem_post nxsem_post_slow nuttx/semaphore.h int FAR sem_t *
96 nxsem_set_protocol nuttx/semaphore.h defined(CONFIG_PRIORITY_INHERITANCE) int FAR sem_t * int
97 nxsem_setprioceiling nuttx/semaphore.h defined(CONFIG_PRIORITY_PROTECT) int FAR sem_t * int FAR int *
98 nxsem_timedwait nuttx/semaphore.h int FAR sem_t * FAR const struct timespec *
99 nxsem_trywait nxsem_trywait_slow nuttx/semaphore.h int FAR sem_t *
100 nxsem_unlink nuttx/semaphore.h defined(CONFIG_FS_NAMED_SEMAPHORES) int FAR const char *
101 nxsem_wait nxsem_wait_slow nuttx/semaphore.h int FAR sem_t *
102 open fcntl.h int FAR const char * int ... mode_t
103 pgalloc nuttx/arch.h defined(CONFIG_BUILD_KERNEL) uintptr_t uintptr_t unsigned int
104 pipe2 unistd.h defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0 int int [2]|FAR int * int