Merge tag 'linux-kselftest-kunit-fixes-5.11-rc3' of git://git.kernel.org/pub/scm...
[linux/fpc-iii.git] / arch / powerpc / include / asm / archrandom.h
blob9a53e29680f4162d8513fe2a9a00f3b3abbba4c9
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_ARCHRANDOM_H
3 #define _ASM_POWERPC_ARCHRANDOM_H
5 #ifdef CONFIG_ARCH_RANDOM
7 #include <asm/machdep.h>
9 static inline bool __must_check arch_get_random_long(unsigned long *v)
11 return false;
14 static inline bool __must_check arch_get_random_int(unsigned int *v)
16 return false;
19 static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
21 if (ppc_md.get_random_seed)
22 return ppc_md.get_random_seed(v);
24 return false;
27 static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
29 unsigned long val;
30 bool rc;
32 rc = arch_get_random_seed_long(&val);
33 if (rc)
34 *v = val;
36 return rc;
38 #endif /* CONFIG_ARCH_RANDOM */
40 #ifdef CONFIG_PPC_POWERNV
41 int powernv_hwrng_present(void);
42 int powernv_get_random_long(unsigned long *v);
43 int powernv_get_random_real_mode(unsigned long *v);
44 #else
45 static inline int powernv_hwrng_present(void) { return 0; }
46 static inline int powernv_get_random_real_mode(unsigned long *v) { return 0; }
47 #endif
49 #endif /* _ASM_POWERPC_ARCHRANDOM_H */