Changeset View
Changeset View
Standalone View
Standalone View
sys/libkern/x86/crc32_sse42.c
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | |||||
crc32c_init_hw(void) | crc32c_init_hw(void) | ||||
{ | { | ||||
crc32c_zeros(crc32c_long, LONG); | crc32c_zeros(crc32c_long, LONG); | ||||
crc32c_zeros(crc32c_2long, 2 * LONG); | crc32c_zeros(crc32c_2long, 2 * LONG); | ||||
crc32c_zeros(crc32c_short, SHORT); | crc32c_zeros(crc32c_short, SHORT); | ||||
crc32c_zeros(crc32c_2short, 2 * SHORT); | crc32c_zeros(crc32c_2short, 2 * SHORT); | ||||
} | } | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
SYSINIT(crc32c_sse42, SI_SUB_LOCK, SI_ORDER_ANY, crc32c_init_hw, NULL); | SYSINIT(crc32c_sse42, SI_SUB_LOCK, SI_ORDER_ANY, crc32c_init_hw); | ||||
#endif | #endif | ||||
/* Compute CRC-32C using the Intel hardware instruction. */ | /* Compute CRC-32C using the Intel hardware instruction. */ | ||||
uint32_t | uint32_t | ||||
sse42_crc32c(uint32_t crc, const unsigned char *buf, unsigned len) | sse42_crc32c(uint32_t crc, const unsigned char *buf, unsigned len) | ||||
{ | { | ||||
#ifdef __amd64__ | #ifdef __amd64__ | ||||
const size_t align = 8; | const size_t align = 8; | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |