2020-06-04 20:00:45 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2023-10-07 00:38:53 +02:00
|
|
|
#include <zephyr/random/random.h>
|
2023-09-27 00:46:01 +02:00
|
|
|
#include <zephyr/internal/syscall_handler.h>
|
2020-06-04 20:00:45 +02:00
|
|
|
|
|
|
|
static inline void z_vrfy_sys_rand_get(void *dst, size_t len)
|
|
|
|
{
|
2023-09-27 13:20:28 +02:00
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(dst, len));
|
2020-06-04 20:00:45 +02:00
|
|
|
|
|
|
|
z_impl_sys_rand_get(dst, len);
|
|
|
|
}
|
2024-01-24 10:35:04 +01:00
|
|
|
#include <zephyr/syscalls/sys_rand_get_mrsh.c>
|
2020-06-04 20:00:45 +02:00
|
|
|
|
2023-09-22 23:28:08 +02:00
|
|
|
#ifdef CONFIG_CSPRNG_ENABLED
|
2020-06-04 20:00:45 +02:00
|
|
|
static inline int z_vrfy_sys_csrand_get(void *dst, size_t len)
|
|
|
|
{
|
2023-09-27 13:20:28 +02:00
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(dst, len));
|
2020-06-04 20:00:45 +02:00
|
|
|
|
|
|
|
return z_impl_sys_csrand_get(dst, len);
|
|
|
|
}
|
2024-01-24 10:35:04 +01:00
|
|
|
#include <zephyr/syscalls/sys_csrand_get_mrsh.c>
|
2020-06-04 20:00:45 +02:00
|
|
|
#endif
|