nuttx/sched/semaphore
Ville Juven b7b0a17682 sched/sem_holder.c: When accessing SEM_WAITLIST, use holder's addrenv
If the semaphore is shared, the holder has put its own mmapped address
to pholder->sem. This means we must switch to the holder's address
environment when going through the held semaphores list.

A better option would be to get the kernel mapped address for the
semaphore's physical page, but that mechanism is not functional yet.

This fixes a full system crash when CONFIG_PRIORITY_INHERITANCE=y and
CONFIG_BUILD_KERNEL=y and user makes shared semaphore via:

int semfd  = shm_open("sem", O_CREAT | O_RDWR, 0666);
sem_t *sem = mmap(0, sizeof(sem_t), PROT_READ | PROT_WRITE, MAP_SHARED, semfd, 0);
2023-11-15 03:45:15 -08:00
..
CMakeLists.txt Feature: implement ticket spinlock 2023-10-07 01:38:37 +08:00
Make.defs
sem_clockwait.c sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
sem_destroy.c style: fix style issues found during code review 2023-06-11 12:54:52 +08:00
sem_holder.c sched/sem_holder.c: When accessing SEM_WAITLIST, use holder's addrenv 2023-11-15 03:45:15 -08:00
sem_initialize.c add the startup process tracepoint 2023-08-19 21:50:08 +08:00
sem_post.c Revert "Assert if a thread attempts to post a semaphore incorrectly." 2023-04-11 17:01:14 +09:00
sem_recover.c sem: don't clear waitobj when do sem recover 2022-10-11 16:31:54 +09:00
sem_reset.c
sem_setprotocol.c sem: Remove PRIOINHERIT_FLAGS_ENABLE and use SEM_PRIO_INHERIT instead 2023-01-11 17:35:28 +02:00
sem_tickwait.c sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
sem_timedwait.c
sem_timeout.c
sem_trywait.c sched/semaphore: Remove restriction to use nxsem_trywait from ISR 2023-08-14 23:47:41 +08:00
sem_wait.c sem: Remove PRIOINHERIT_FLAGS_ENABLE and use SEM_PRIO_INHERIT instead 2023-01-11 17:35:28 +02:00
sem_waitirq.c sched/addrenv.c: Implement re-entrancy for addrenv_select() 2023-04-25 14:33:19 +02:00
semaphore.h Revert "Assert if a thread attempts to post a semaphore incorrectly." 2023-04-11 17:01:14 +09:00
spinlock.c sched/semaphore/spinlock.c: cosmetics 2023-11-05 12:11:28 +08:00