diff options
author | jhb <jhb@FreeBSD.org> | 2008-09-10 18:42:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-09-10 18:42:19 +0000 |
commit | bc107b3828d742160ad1da66c6e2577731499014 (patch) | |
tree | c94bd5989f30ace0540e938d381fd7b6aa832d4c /sys/dev | |
parent | 70e9d3b33137a27e442dccec29f26e32c237e652 (diff) | |
download | FreeBSD-src-bc107b3828d742160ad1da66c6e2577731499014.zip FreeBSD-src-bc107b3828d742160ad1da66c6e2577731499014.tar.gz |
Disable the inline assembly crc32 routine and use the C version instead.
The assembly version is reported to be broken on 5.x+.
PR: kern/100425
Submitted by: Rashid N. Achilov shelton www.granch.ru
MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sbni/if_sbni.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index 19c6a04..8c8687c 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -87,8 +87,6 @@ __FBSDID("$FreeBSD$"); #include <dev/sbni/if_sbnireg.h> #include <dev/sbni/if_sbnivar.h> -#define ASM_CRC 1 - static void sbni_init(void *); static void sbni_init_locked(struct sbni_softc *); static void sbni_start(struct ifnet *); @@ -1202,88 +1200,6 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data) /* -------------------------------------------------------------------------- */ -#ifdef ASM_CRC - -static u_int32_t -calc_crc32(u_int32_t crc, caddr_t p, u_int len) -{ - register u_int32_t _crc __asm ("ax"); - _crc = crc; - - __asm __volatile ( - "xorl %%ebx, %%ebx\n" - "movl %1, %%esi\n" - "movl %2, %%ecx\n" - "movl $crc32tab, %%edi\n" - "shrl $2, %%ecx\n" - "jz 1f\n" - - ".align 4\n" - "0:\n" - "movb %%al, %%bl\n" - "movl (%%esi), %%edx\n" - "shrl $8, %%eax\n" - "xorb %%dl, %%bl\n" - "shrl $8, %%edx\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - - "movb %%al, %%bl\n" - "shrl $8, %%eax\n" - "xorb %%dl, %%bl\n" - "shrl $8, %%edx\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - - "movb %%al, %%bl\n" - "shrl $8, %%eax\n" - "xorb %%dl, %%bl\n" - "movb %%dh, %%dl\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - - "movb %%al, %%bl\n" - "shrl $8, %%eax\n" - "xorb %%dl, %%bl\n" - "addl $4, %%esi\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - - "decl %%ecx\n" - "jnz 0b\n" - - "1:\n" - "movl %2, %%ecx\n" - "andl $3, %%ecx\n" - "jz 2f\n" - - "movb %%al, %%bl\n" - "shrl $8, %%eax\n" - "xorb (%%esi), %%bl\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - - "decl %%ecx\n" - "jz 2f\n" - - "movb %%al, %%bl\n" - "shrl $8, %%eax\n" - "xorb 1(%%esi), %%bl\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - - "decl %%ecx\n" - "jz 2f\n" - - "movb %%al, %%bl\n" - "shrl $8, %%eax\n" - "xorb 2(%%esi), %%bl\n" - "xorl (%%edi,%%ebx,4), %%eax\n" - "2:\n" - : "=a" (_crc) - : "g" (p), "g" (len) - : "bx", "cx", "dx", "si", "di" - ); - - return (_crc); -} - -#else /* ASM_CRC */ - static u_int32_t calc_crc32(u_int32_t crc, caddr_t p, u_int len) { @@ -1293,9 +1209,6 @@ calc_crc32(u_int32_t crc, caddr_t p, u_int len) return (crc); } -#endif /* ASM_CRC */ - - static u_int32_t crc32tab[] __aligned(8) = { 0xD202EF8D, 0xA505DF1B, 0x3C0C8EA1, 0x4B0BBE37, 0xD56F2B94, 0xA2681B02, 0x3B614AB8, 0x4C667A2E, |