diff options
author | H. Peter Anvin <hpa@zytor.com> | 2011-07-31 13:54:50 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-07-31 13:54:50 -0700 |
commit | 63d77173266c1791f1553e9e8ccea65dc87c4485 (patch) | |
tree | 81c69a2f30a9bd8302d690000215b474886d0152 /include/linux/random.h | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) | |
download | op-kernel-dev-63d77173266c1791f1553e9e8ccea65dc87c4485.zip op-kernel-dev-63d77173266c1791f1553e9e8ccea65dc87c4485.tar.gz |
random: Add support for architectural random hooks
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>
Diffstat (limited to 'include/linux/random.h')
-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 fb7ab9d..079cbba 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -102,6 +102,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed) state->s3 = __seed(i, 15); } +#ifdef CONFIG_ARCH_RANDOM +# include <asm/archrandom.h> +#else +static inline int arch_get_random_long(unsigned long *v) +{ + return 0; +} +static inline int arch_get_random_int(unsigned int *v) +{ + return 0; +} +#endif + #endif /* __KERNEL___ */ #endif /* _LINUX_RANDOM_H */ |