diff options
author | obrien <obrien@FreeBSD.org> | 2013-07-31 17:21:18 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2013-07-31 17:21:18 +0000 |
commit | 7999076e3e464a2dd3a7abc86d14b874da837ec0 (patch) | |
tree | 0214e6338a2fb9904fb96b90f6c2f84d17e742a0 /sys/dev/random/nehemiah.c | |
parent | a8df631d0527c68753a33443af52e11b08ebde5d (diff) | |
download | FreeBSD-src-7999076e3e464a2dd3a7abc86d14b874da837ec0.zip FreeBSD-src-7999076e3e464a2dd3a7abc86d14b874da837ec0.tar.gz |
Back out r253779 & r253786.
Diffstat (limited to 'sys/dev/random/nehemiah.c')
-rw-r--r-- | sys/dev/random/nehemiah.c | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/sys/dev/random/nehemiah.c b/sys/dev/random/nehemiah.c index e811115..f3afa89 100644 --- a/sys/dev/random/nehemiah.c +++ b/sys/dev/random/nehemiah.c @@ -28,20 +28,19 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_cpu.h" + +#ifdef PADLOCK_RNG + #include <sys/param.h> #include <sys/time.h> #include <sys/lock.h> #include <sys/mutex.h> -#include <sys/module.h> #include <sys/selinfo.h> #include <sys/systm.h> -#include <sys/kernel.h> #include <machine/pcb.h> -#include <machine/md_var.h> -#include <machine/specialreg.h> -#include <dev/random/random_adaptors.h> #include <dev/random/randomdev.h> #define RANDOM_BLOCK_SIZE 256 @@ -51,7 +50,7 @@ static void random_nehemiah_init(void); static void random_nehemiah_deinit(void); static int random_nehemiah_read(void *, int); -struct random_adaptor random_nehemiah = { +struct random_systat random_nehemiah = { .ident = "Hardware, VIA Nehemiah", .init = random_nehemiah_init, .deinit = random_nehemiah_deinit, @@ -209,33 +208,4 @@ random_nehemiah_read(void *buf, int c) return (c); } -static int -nehemiah_modevent(module_t mod, int type, void *unused) -{ - - switch (type) { - case MOD_LOAD: - if (via_feature_rng & VIA_HAS_RNG) { - random_adaptor_register("nehemiah", &random_nehemiah); - EVENTHANDLER_INVOKE(random_adaptor_attach, - &random_nehemiah); - return (0); - } else { -#ifndef KLD_MODULE - if (bootverbose) #endif - printf( - "%s: VIA RNG feature is not present on this CPU\n", - random_nehemiah.ident); -#ifdef KLD_MODULE - return (ENXIO); -#else - return (0); -#endif - } - } - - return (EINVAL); -} - -RANDOM_ADAPTOR_MODULE(nehemiah, nehemiah_modevent, 1); |