diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2011-07-31 16:54:50 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-15 15:04:11 -0400 |
| commit | 6133313b3bcbd0473feac85c8a8d7ef704ff2279 (patch) | |
| tree | 4bd67fe43b0e539eb14e4ace0890efd148accb61 /include/linux | |
| parent | 7b1cad628030b9bbdaaa4bb8ff73cabaab6e82c9 (diff) | |
random: Add support for architectural random hooks
commit 63d77173266c1791f1553e9e8ccea65dc87c4485 upstream.
Add support for architecture-specific hooks into the kernel-directed
random number generator interfaces. This patchset does not use the
architecture random number generator interfaces for the
userspace-directed interfaces (/dev/random and /dev/urandom), thus
eliminating the need to distinguish between them based on a pool
pointer.
Changes in version 3:
- Moved the hooks from extract_entropy() to get_random_bytes().
- Changes the hooks to inlines.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/random.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/random.h b/include/linux/random.h index d13059f3ea3..8f74538c96d 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
| @@ -91,6 +91,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed) | |||
| 91 | state->s3 = __seed(i, 15); | 91 | state->s3 = __seed(i, 15); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | #ifdef CONFIG_ARCH_RANDOM | ||
| 95 | # include <asm/archrandom.h> | ||
| 96 | #else | ||
| 97 | static inline int arch_get_random_long(unsigned long *v) | ||
| 98 | { | ||
| 99 | return 0; | ||
| 100 | } | ||
| 101 | static inline int arch_get_random_int(unsigned int *v) | ||
| 102 | { | ||
| 103 | return 0; | ||
| 104 | } | ||
| 105 | #endif | ||
| 106 | |||
| 94 | #endif /* __KERNEL___ */ | 107 | #endif /* __KERNEL___ */ |
| 95 | 108 | ||
| 96 | #endif /* _LINUX_RANDOM_H */ | 109 | #endif /* _LINUX_RANDOM_H */ |
