Skip to content

Commit e22ca6b

Browse files
tagunildanieldegrasse
authored andcommitted
libc: arcmwdt: grant all threads access to stdio locks
Some of the locks are created in supervisor mode (i.e. stdout one), but should be accessed from user mode too. Unfortunately, there is no way to distinguish these locks, so grant the access to all of them as the actual reads and writes should end up as syscalls anyway. Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
1 parent bba6491 commit e22ca6b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/libc/arcmwdt/threading.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ void _mwmutex_create(_lock_t *mutex_ptr)
4040
k_panic();
4141
}
4242

43+
#ifdef CONFIG_USERSPACE
44+
/* Some of the locks are shared across the library */
45+
k_object_access_all_grant(*mutex_ptr);
46+
#endif
47+
4348
k_mutex_init((struct k_mutex *)*mutex_ptr);
4449
}
4550

0 commit comments

Comments
 (0)