random: Add syscalls for random subsystem

Create syscalls to make possible using random APIs from user mode
threads. These APIs can have different implementations, like using
entropy driver or Xoroshiro128. Some of these implementations also have
some globals to preserve state between calls.

Make it run entire in user space would require user adding these globals
to their memeory domains and/or grant access to entropy device. Syscalls
simplify its usage.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2020-06-04 11:00:45 -07:00 committed by Anas Nashif
commit 6216c6cf5b
7 changed files with 48 additions and 11 deletions

View file

@ -4,6 +4,7 @@ if (CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR OR
CONFIG_TIMER_RANDOM_GENERATOR OR
CONFIG_XOROSHIRO_RANDOM_GENERATOR)
zephyr_library()
zephyr_library_sources_ifdef(CONFIG_USERSPACE rand32_handlers.c)
endif()
zephyr_library_sources_ifdef(CONFIG_TIMER_RANDOM_GENERATOR rand32_timer.c)