• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_UM_ARCHRANDOM_H__
3 #define __ASM_UM_ARCHRANDOM_H__
4 
5 #include <linux/types.h>
6 
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);
9 
arch_get_random_long(unsigned long * v)10 static inline bool __must_check arch_get_random_long(unsigned long *v)
11 {
12 	return os_getrandom(v, sizeof(*v), 0) == sizeof(*v);
13 }
14 
arch_get_random_int(unsigned int * v)15 static inline bool __must_check arch_get_random_int(unsigned int *v)
16 {
17 	return os_getrandom(v, sizeof(*v), 0) == sizeof(*v);
18 }
19 
arch_get_random_seed_long(unsigned long * v)20 static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
21 {
22 	return false;
23 }
24 
arch_get_random_seed_int(unsigned int * v)25 static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
26 {
27 	return false;
28 }
29 
30 #endif
31