walnux/sched/semaphore
Ville Juven 4959e269d6 sched/sem_waitirq: Move kmm_map() call to sem_wait()
The kernel mapping should be performed in sem_wait (thread level) as
virtual memory mappings cannot be added from interrupt, at least for now.

The reason?

kmm_map() depends on mm_map_add(), which in turn uses a mutex for mutual
exclusion. Using mutexes from interrupt level is not permitted.

Mapping tcb->waitobj into kernel virtual memory directly in sem_wait()
makes sense, since accessing tcb->waitobj via a user virtual address can
lead to unexpected results (the wrong mappings can be in place).
2025-03-13 12:28:22 +08:00
..
CMakeLists.txt cmake:refine nuttx cmake build system fix CMake build missing part 2024-10-13 02:25:06 +08:00
Make.defs sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sem_clockwait.c sem: use wd_start_realtime/abstime to replace wd_start 2024-10-09 13:54:29 +08:00
sem_destroy.c sem: change sem wait to atomic operation 2024-12-10 22:00:42 +08:00
sem_holder.c nxsem_destroyholder: Use critical section when destroying holder(s) 2024-12-27 00:28:34 +08:00
sem_initialize.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sem_post.c sem: change sem wait to atomic operation 2024-12-10 22:00:42 +08:00
sem_protect.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sem_recover.c sched/sem_waitirq: Move kmm_map() call to sem_wait() 2025-03-13 12:28:22 +08:00
sem_reset.c sem: change sem wait to atomic operation 2024-12-10 22:00:42 +08:00
sem_rw.c Revert "shced:sem: replace mutex with spinlock" 2024-10-29 23:01:39 +08:00
sem_setprotocol.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sem_tickwait.c sched/semaphore: tick wait 0 timeout should be safe in interrupt context 2024-12-30 12:02:34 +08:00
sem_timedwait.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sem_timeout.c sched: change xx_timeout param from pid to tcb 2024-09-29 18:18:01 +08:00
sem_trywait.c sem: remove the additional assignment. 2024-12-12 22:01:50 +08:00
sem_wait.c sched/sem_waitirq: Move kmm_map() call to sem_wait() 2025-03-13 12:28:22 +08:00
sem_waitirq.c sched/sem_waitirq: Move kmm_map() call to sem_wait() 2025-03-13 12:28:22 +08:00
semaphore.h sem: change sem wait to atomic operation 2024-12-10 22:00:42 +08:00