mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 07:59:07 +08:00
Update to FreeBSD head 2017-10-01
Git mirror commit b2f0376b45428f13151d229c5ae9d4d8f74acbd1. Update #3472.
This commit is contained in:
@@ -48,6 +48,8 @@
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/libkern.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
@@ -59,6 +61,7 @@ __FBSDID("$FreeBSD$");
|
||||
#if defined(__aarch64__)
|
||||
#include <machine/cpu.h>
|
||||
#endif
|
||||
#endif /* _KERNEL */
|
||||
|
||||
const uint32_t crc32_tab[] = {
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
|
||||
@@ -761,6 +764,7 @@ calculate_crc32c(uint32_t crc32c,
|
||||
const unsigned char *buffer,
|
||||
unsigned int length)
|
||||
{
|
||||
#ifdef _KERNEL
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
if ((cpu_feature2 & CPUID2_SSE42) != 0) {
|
||||
return (sse42_crc32c(crc32c, buffer, length));
|
||||
@@ -778,6 +782,7 @@ calculate_crc32c(uint32_t crc32c,
|
||||
return (armv8_crc32c(crc32c, buffer, length));
|
||||
} else
|
||||
#endif
|
||||
#endif /* _KERNEL */
|
||||
if (length < 4) {
|
||||
return (singletable_crc32c(crc32c, buffer, length));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user