Changeset View
Changeset View
Standalone View
Standalone View
sys/crypto/aesni/aesni.c
Show All 30 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/domainset.h> | |||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/kobj.h> | #include <sys/kobj.h> | ||||
#include <sys/libkern.h> | #include <sys/libkern.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | aesni_attach(device_t dev) | ||||
} | } | ||||
ctx_mtx = malloc(sizeof *ctx_mtx * (mp_maxid + 1), M_AESNI, | ctx_mtx = malloc(sizeof *ctx_mtx * (mp_maxid + 1), M_AESNI, | ||||
M_WAITOK|M_ZERO); | M_WAITOK|M_ZERO); | ||||
ctx_fpu = malloc(sizeof *ctx_fpu * (mp_maxid + 1), M_AESNI, | ctx_fpu = malloc(sizeof *ctx_fpu * (mp_maxid + 1), M_AESNI, | ||||
M_WAITOK|M_ZERO); | M_WAITOK|M_ZERO); | ||||
CPU_FOREACH(i) { | CPU_FOREACH(i) { | ||||
ctx_fpu[i] = fpu_kern_alloc_ctx(0); | ctx_fpu[i] = fpu_kern_alloc_ctx_domainset( | ||||
DOMAINSET_PREF(pcpu_find(i)->pc_domain), FPU_KERN_NORMAL); | |||||
mtx_init(&ctx_mtx[i], "anifpumtx", NULL, MTX_DEF|MTX_NEW); | mtx_init(&ctx_mtx[i], "anifpumtx", NULL, MTX_DEF|MTX_NEW); | ||||
} | } | ||||
detect_cpu_features(&sc->has_aes, &sc->has_sha); | detect_cpu_features(&sc->has_aes, &sc->has_sha); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 662 Lines • Show Last 20 Lines |