diff options
author | Michael Reifenberger <mr@FreeBSD.org> | 2006-07-13 09:15:14 +0000 |
---|---|---|
committer | Michael Reifenberger <mr@FreeBSD.org> | 2006-07-13 09:15:14 +0000 |
commit | 4fd58e10b2747a0287ebc067ae1d538d6a525faa (patch) | |
tree | cee61261dbcf6da04383f958c9af8a8565cb34e9 /sys/crypto/via | |
parent | 24af5900eb5a5a12a03bc000e3debb002adb8d44 (diff) | |
download | src-4fd58e10b2747a0287ebc067ae1d538d6a525faa.tar.gz src-4fd58e10b2747a0287ebc067ae1d538d6a525faa.zip |
Use the already stored VIA RNG probe information
instead of probing again.
Adjust style(9) somewhat in probe.c
Reviewed by: pjd
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=160325
Diffstat (limited to 'sys/crypto/via')
-rw-r--r-- | sys/crypto/via/padlock.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/crypto/via/padlock.c b/sys/crypto/via/padlock.c index 01eb916ce77a..95351af42e59 100644 --- a/sys/crypto/via/padlock.c +++ b/sys/crypto/via/padlock.c @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #if defined(__i386__) && !defined(PC98) #include <machine/cpufunc.h> #include <machine/cputypes.h> +#include <machine/md_var.h> +#include <machine/specialreg.h> #endif #include <opencrypto/cryptodev.h> @@ -160,24 +162,11 @@ padlock_init(void) { struct padlock_softc *sc; #if defined(__i386__) && !defined(PC98) - u_int regs[4]; - int has_ace = 0; - - if (cpu_class < CPUCLASS_586) - return (EINVAL); - do_cpuid(1, regs); - if ((regs[0] & 0xf) >= 3) { - do_cpuid(0xc0000000, regs); - if (regs[0] == 0xc0000001) { - do_cpuid(0xc0000001, regs); - if ((regs[3] & 0xc0) == 0xc0) - has_ace = 1; - } - } - if (!has_ace) { + if (!(via_feature_xcrypt & VIA_HAS_AES)) { printf("PADLOCK: No ACE support.\n"); return (EINVAL); - } + } else + printf("PADLOCK: HW support loaded.\n"); #else return (EINVAL); #endif |