09dc929d41
We don't actually need spinlocks here. For user_copy(), we are checking that the pointer/size passed in from user mode represents an area that the thread can read or write to. Then we do a memcpy into the kernel-side buffer, which is used from then on. It's OK if another thread scribbles on the buffer contents during the copy, as we have not yet begun any examination of its contents yet. For the z_user_string*_copy() functions, it's also possible that another thread could scribble on the string contents, but we do no analysis of the string other than to establish a length. We just need to ensure that when these functions exit, the copied string is NULL terminated. For SMP, the spinlocks are removed as they will not prevent a thread running on another CPU from changing the buffer/string contents, we just need to safely deal with that possibility. For UP, the locks do prevent another thread from stepping in, but it's better to just safely deal with it rather than affect the interrupt latency of the system. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com> |
||
---|---|---|
.. | ||
include | ||
atomic_c.c | ||
CMakeLists.txt | ||
compiler_stack_protect.c | ||
device.c | ||
errno.c | ||
idle.c | ||
init.c | ||
int_latency_bench.c | ||
Kconfig | ||
Kconfig.power_mgmt | ||
mailbox.c | ||
mem_domain.c | ||
mem_slab.c | ||
mempool.c | ||
msg_q.c | ||
mutex.c | ||
pipes.c | ||
poll.c | ||
queue.c | ||
sched.c | ||
sem.c | ||
smp.c | ||
stack.c | ||
system_work_q.c | ||
thread.c | ||
thread_abort.c | ||
timeout.c | ||
timer.c | ||
userspace.c | ||
userspace_handler.c | ||
version.c | ||
work_q.c |