30 #include <sys/cdefs.h>
33 #include <sys/libkern.h>
34 #include <machine/endian.h>
36 typedef const void *
cvp;
38 typedef unsigned long ul;
39 typedef const unsigned long *
culp;
47 register
size_t length;
49 #if BYTE_ORDER == LITTLE_ENDIAN
60 int shl, shr, len = length;
70 while ((
long)p1 & (
sizeof(
long) - 1)) {
81 shr = (long)p2 & (
sizeof(
long) - 1);
85 shl = (
sizeof(long) << 3) - shr;
90 while ((len -=
sizeof(
long)) >= 0) {
93 if (*(
culp)p1 != (va >> shr | vb << shl))
102 if (!(len +=
sizeof(
long)))
112 return ((((va >> shr | ((shl < len) ? *(
culp)p2 << shl : 0)) ^
113 *(
culp)p1) & ((1
L << len) - 1)) != 0);
116 while ((len -=
sizeof(
long)) >= 0) {
127 if (!(len +=
sizeof(
long)))
131 & ((1
L << (len << 3)) - 1)) != 0);
const unsigned char * ustring
int bcmp(void *b1, void *b2, size_t length) const
const unsigned long * culp