ee6bcf1223
CRC logic to a new function: crc32_raw() that obtains the initial CRC value as well as leaves any post-processing to the caller. As such, it can be used when the initial CRC value is not ~0U or when the final CRC value does need to be inverted (bitwise). It also means that crc32_raw() can be called repeatedly when the data is not available as a single block, such as for scatter/gather lists and the likes. Avoid the additional call overhead incured by the refactoring by moving the implementation off crc32() to sys/systm.h and making it inlinable. Since crc32_raw() is itself trivial and since it may be used in loops that iterate over fragments, having it available for inlining can be beneficial. Hence, move its implementation to sys/systm.h as well. Keep the original implementation of crc32() in libkern/crc32.c for documentation purposes (as a comment of course). Triggered by: Jose M Rodriguez (josemi at freebsd dot jazztel dot es) Discussed on: current@ Tested on: amd64, ia64 (BVO having GPT partitions) Jargon file candidate: BVO = By Virtue Of :-) |
||
---|---|---|
.. | ||
alpha | ||
arm | ||
ia64 | ||
arc4random.c | ||
ashldi3.c | ||
ashrdi3.c | ||
bcd.c | ||
bcmp.c | ||
bsearch.c | ||
crc32.c | ||
divdi3.c | ||
ffs.c | ||
ffsl.c | ||
fls.c | ||
flsl.c | ||
fnmatch.c | ||
gets.c | ||
iconv_converter_if.m | ||
iconv_xlat16.c | ||
iconv_xlat.c | ||
iconv.c | ||
index.c | ||
inet_ntoa.c | ||
lshrdi3.c | ||
mcount.c | ||
moddi3.c | ||
qdivrem.c | ||
qsort_r.c | ||
qsort.c | ||
quad.h | ||
random.c | ||
rindex.c | ||
scanc.c | ||
skpc.c | ||
strcat.c | ||
strcmp.c | ||
strcpy.c | ||
strdup.c | ||
strlcat.c | ||
strlcpy.c | ||
strlen.c | ||
strncmp.c | ||
strncpy.c | ||
strsep.c | ||
strspn.c | ||
strtol.c | ||
strtoq.c | ||
strtoul.c | ||
strtouq.c | ||
strvalid.c | ||
ucmpdi2.c | ||
udivdi3.c | ||
umoddi3.c |