1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_ARCHRANDOM_H
3 #define _ASM_POWERPC_ARCHRANDOM_H
4 
5 #include <asm/machdep.h>
6 
7 static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
8 {
9 	return 0;
10 }
11 
12 static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
13 {
14 	if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
15 		return 1;
16 	return 0;
17 }
18 
19 #ifdef CONFIG_PPC_POWERNV
20 int powernv_hwrng_present(void);
21 int powernv_get_random_long(unsigned long *v);
22 int powernv_get_random_real_mode(unsigned long *v);
23 #else
24 static inline int powernv_hwrng_present(void) { return 0; }
25 static inline int powernv_get_random_real_mode(unsigned long *v) { return 0; }
26 #endif
27 
28 #endif /* _ASM_POWERPC_ARCHRANDOM_H */
29