]>
Commit | Line | Data |
---|---|---|
a4da0d50 ME |
1 | #ifndef _ASM_POWERPC_ARCHRANDOM_H |
2 | #define _ASM_POWERPC_ARCHRANDOM_H | |
3 | ||
4 | #ifdef CONFIG_ARCH_RANDOM | |
5 | ||
6 | #include <asm/machdep.h> | |
7 | ||
8 | static inline int arch_get_random_long(unsigned long *v) | |
9 | { | |
a4da0d50 ME |
10 | return 0; |
11 | } | |
12 | ||
13 | static inline int arch_get_random_int(unsigned int *v) | |
01c9348c PM |
14 | { |
15 | return 0; | |
16 | } | |
17 | ||
18 | static inline int arch_get_random_seed_long(unsigned long *v) | |
19 | { | |
20 | if (ppc_md.get_random_seed) | |
21 | return ppc_md.get_random_seed(v); | |
22 | ||
23 | return 0; | |
24 | } | |
25 | static inline int arch_get_random_seed_int(unsigned int *v) | |
a4da0d50 ME |
26 | { |
27 | unsigned long val; | |
28 | int rc; | |
29 | ||
30 | rc = arch_get_random_long(&val); | |
31 | if (rc) | |
32 | *v = val; | |
33 | ||
34 | return rc; | |
35 | } | |
36 | ||
7b878d4b | 37 | static inline int arch_has_random(void) |
d20f78d2 PA |
38 | { |
39 | return 0; | |
40 | } | |
01c9348c | 41 | |
7b878d4b PA |
42 | static inline int arch_has_random_seed(void) |
43 | { | |
01c9348c | 44 | return !!ppc_md.get_random_seed; |
7b878d4b | 45 | } |
a4da0d50 ME |
46 | #endif /* CONFIG_ARCH_RANDOM */ |
47 | ||
e928e9cb ME |
48 | #ifdef CONFIG_PPC_POWERNV |
49 | int powernv_hwrng_present(void); | |
50 | int powernv_get_random_long(unsigned long *v); | |
51 | int powernv_get_random_real_mode(unsigned long *v); | |
52 | #else | |
53 | static inline int powernv_hwrng_present(void) { return 0; } | |
54 | static inline int powernv_get_random_real_mode(unsigned long *v) { return 0; } | |
55 | #endif | |
56 | ||
a4da0d50 | 57 | #endif /* _ASM_POWERPC_ARCHRANDOM_H */ |