Skip to content

Commit f3afa88

Browse files
tagunilnashif
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> (cherry picked from commit e22ca6b)
1 parent 9cd8d8f commit f3afa88

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
@@ -37,6 +37,11 @@ void _mwmutex_create(_lock_t *mutex_ptr)
3737
k_panic();
3838
}
3939

40+
#ifdef CONFIG_USERSPACE
41+
/* Some of the locks are shared across the library */
42+
k_object_access_all_grant(*mutex_ptr);
43+
#endif
44+
4045
k_mutex_init((struct k_mutex *)*mutex_ptr);
4146
}
4247

0 commit comments

Comments
 (0)