aesni(4): Properly align the context memory using out kmalloc(9) feature
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 2 Aug 2011 04:11:12 +0000 (12:11 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 2 Aug 2011 04:11:12 +0000 (12:11 +0800)
commit35b7857839738a2813bd18f098ebc725254a70a8
tree612af155c15876caacf6f226a776a875e6de47e4
parentd9e919c4a944691757e7717860c2055b2dbbc975
aesni(4): Properly align the context memory using out kmalloc(9) feature

DragonFly's kmalloc(9) will return 2^n aligned memory if the allocation
size is 2^n; use this feature instead of using a local hack.

While I'm here, release the spinlock and call kmalloc(9) w/ M_WAITOK;
the check/free race is absolutely acceptable here, but the failure
of kmalloc(9) w/ M_NOWAIT is probably not accetable on the init path.
sys/dev/crypto/aesni/aesni.c
sys/dev/crypto/aesni/aesni.h