1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_UM_ARCHRANDOM_H__
3 #define __ASM_UM_ARCHRANDOM_H__
5 #include <linux/types.h>
7 /* This is from <os.h>, but better not to #include that in a global header here. */
8 ssize_t os_getrandom(void *buf, size_t len, unsigned int flags);
10 static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
14 ret = os_getrandom(v, max_longs * sizeof(*v), 0);
17 return ret / sizeof(*v);
20 static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)