aboutsummaryrefslogtreecommitdiffstats
path: root/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-03-12 00:15:31 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-03-12 00:15:31 +0000
commitee53d3b8685245febda44ac761877871ec4cd0f4 (patch)
tree67e5392c3f16c0716b3ca8356cd93cd244b58d4b /xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S
parent7c2ffc6c5043e0a49fbe1b81f9da465ec68a9e64 (diff)
downloadxen-ee53d3b8685245febda44ac761877871ec4cd0f4.tar.gz
xen-ee53d3b8685245febda44ac761877871ec4cd0f4.tar.bz2
xen-ee53d3b8685245febda44ac761877871ec4cd0f4.zip
bitkeeper revision 1.122.1.5 (3e6e7c23wQxW8Ugs0UKsqigrHkcXQg)
mkbuildtree: new file .del-hypervisor-ifs~86b59453fcfcbc0d: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs .del-usercopy.c~a4e3819a4723317b: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/usercopy.c .del-sys_i386.c~ad2d4399a2d28db9: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/sys_i386.c .del-strstr.c~a59de40cfa231931: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/strstr.c .del-semaphore.c~e68c48eef7115b45: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/semaphore.c .del-pageattr.c~f12f3a2d4d9a5533: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/pageattr.c .del-old-checksum.c~f071ac0bcd5b2d9a: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/old-checksum.c .del-mmx.c~c322b85572d0e637: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/mmx.c .del-memcpy.c~40a930c62e045f5: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/memcpy.c .del-iodebug.c~23f7b78313546ddc: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/iodebug.c .del-getuser.S~b9140bdb7786f6dc: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/getuser.S .del-extable.c~d3064107fd4524e5: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/extable.c .del-dec_and_lock.c~702a868529eefccf: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/dec_and_lock.c .del-checksum.S~a821c465832e250c: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S .del-xor.h~998f147781a971b7: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/xor.h .del-vga.h~45c4f65abf0d3704: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/vga.h .del-user.h~dd2c2e4cf89a81: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/user.h .del-unistd.h~33920ed4177b943c: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/unistd.h .del-unaligned.h~535ed3d510980f67: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/unaligned.h .del-ucontext.h~217079ee95a5eb94: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ucontext.h .del-uaccess.h~3681b94ef8d5a0f4: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/uaccess.h .del-types.h~c4fb05b781c9652c: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/types.h .del-tlb.h~6ad1bd639fc9d921: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/tlb.h .del-timex.h~51d9b0c83c732bcc: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/timex.h .del-termios.h~ccfbd8bcc37ae57d: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/termios.h .del-termbits.h~438385b2cd8fd6b0: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/termbits.h .del-string.h~673ad5d9e7f34adc: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/string.h .del-string-486.h~365fff788bc1adf5: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/string-486.h .del-statfs.h~65d9b1d7c4114f2e: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/statfs.h .del-stat.h~c1aa8136a8e00c11: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/stat.h .del-spinlock.h~ec9397b86265414c: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/spinlock.h .del-softirq.h~587d767979e60f4a: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/softirq.h .del-sockios.h~30f6e946644b28a4: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sockios.h .del-socket.h~4b1ff6de54a2e75: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/socket.h .del-smplock.h~d5ea37028dfc0796: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smplock.h .del-signal.h~bff6ca682e48d282: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/signal.h .del-siginfo.h~6e147c4b81453d48: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/siginfo.h .del-sigcontext.h~15a1460eea0fc80d: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sigcontext.h .del-shmparam.h~97d1aa6d272dd55c: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmparam.h .del-shmbuf.h~d92a8c2e377edd83: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmbuf.h .del-setup.h~4250896c3e302c1d: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/setup.h .del-serial.h~584ec6aaea6b0efc: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/serial.h .del-sembuf.h~4fc6c36d718bc878: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sembuf.h .del-semaphore.h~90a0e3df1d186e71: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/semaphore.h .del-ptrace.c~5c3f8d1f817aa462: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ptrace.c .del-init_task.c~319ec38b798d3c7c: Delete: xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/init_task.c .del-scatterlist.h~1988430d982706fb: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/scatterlist.h .del-rwsem.h~548d272fd25fd023: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwsem.h .del-rwlock.h~75a3e9a0d5b70d88: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwlock.h .del-resource.h~4ac2e8ff9316f133: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/resource.h .del-posix_types.h~14d068cffd4b8776: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/posix_types.h .del-poll.h~15c1158844d735b: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/poll.h .del-parport.h~ce6ec6eea26a26f: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/parport.h .del-param.h~1fcb86dbbfaae433: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/param.h .del-namei.h~f25c9c58c76cddf4: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/namei.h .del-mtrr.h~375ef594799aeb34: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mtrr.h .del-msr.h~cbf3b3e52c9bed91: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msr.h .del-msgbuf.h~ab21bfe6a970c7d6: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msgbuf.h .del-mpspec.h~9a3c3e9cda38bf43: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mpspec.h .del-module.h~e271946131c6cf33: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/module.h .del-mmx.h~bc63c7c24adb85ea: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmx.h .del-mman.h~43ec3a0326f0d774: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mman.h .del-mca_dma.h~a4e495084d965428: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mca_dma.h .del-mc146818rtc.h~d7e968dbd77bc13a: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mc146818rtc.h .del-math_emu.h~fba78190435e5abd: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/math_emu.h .del-locks.h~e022163a8c6f92: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/locks.h .del-linux_logo.h~2034953cfe415a: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/linux_logo.h .del-ldt.h~191ca1efbffba82a: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ldt.h .del-kmap_types.h~517fab0f9758f3b: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/kmap_types.h .del-keyboard.h~b2a7fe4183f53eb0: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/keyboard.h .del-ipcbuf.h~cee91af271f4ead9: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipcbuf.h .del-ipc.h~f6063a09bec6a01e: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipc.h .del-ioctls.h~cc185671abf46a0a: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctls.h .del-ioctl.h~8603eb7a7f9acbad: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctl.h .del-io_apic.h~9f66b09afe289021: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io_apic.h .del-init.h~9d30d474b845bc1: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/init.h .del-ide.h~805c47c1a5ebf196: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ide.h .del-i387.h~3b360e96fea6fe7: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/i387.h .del-hdreg.h~c4bbd6ffab3763d6: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hdreg.h .del-hardirq.h~9b375250fe601395: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hardirq.h .del-floppy.h~d6f10807cbe15906: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/floppy.h .del-fcntl.h~ee3e644a21150dde: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fcntl.h .del-errno.h~bab55cfe5c4ff883: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/errno.h .del-elf.h~af645629b45e7fe7: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/elf.h .del-dma.h~938dff3f930de2e4: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/dma.h .del-div64.h~aa6562c04bfaf412: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/div64.h .del-delay.h~e3ba89df403d5622: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/delay.h .del-debugreg.h~b3975b26e222b6c3: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/debugreg.h .del-current.h~800e8314ee81c074: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/current.h .del-cpufeature.h~89666e396b49acdd: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cpufeature.h .del-checksum.h~82af6c19c8cc4ff3: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/checksum.h .del-cache.h~694ef1ffd8450db4: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cache.h .del-byteorder.h~f14ceb3575444d8a: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/byteorder.h .del-boot.h~83206c92a8649e3f: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/boot.h .del-bitops.h~e3c609f48d6cdb91: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bitops.h .del-atomic.h~328669154749bfad: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/atomic.h .del-apicdef.h~2f13a4cfaa79d855: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apicdef.h .del-apic.h~2690e76edadb6a8: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apic.h .del-a.out.h~b638f33fa82e889d: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/a.out.h
Diffstat (limited to 'xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S')
-rw-r--r--xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S496
1 files changed, 0 insertions, 496 deletions
diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S b/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S
deleted file mode 100644
index 94c7867ddc..0000000000
--- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * INET An implementation of the TCP/IP protocol suite for the LINUX
- * operating system. INET is implemented using the BSD Socket
- * interface as the means of communication with the user level.
- *
- * IP/TCP/UDP checksumming routines
- *
- * Authors: Jorge Cwik, <jorge@laser.satlink.net>
- * Arnt Gulbrandsen, <agulbra@nvg.unit.no>
- * Tom May, <ftom@netcom.com>
- * Pentium Pro/II routines:
- * Alexander Kjeldaas <astor@guardian.no>
- * Finn Arne Gangstad <finnag@guardian.no>
- * Lots of code moved from tcp.c and ip.c; see those files
- * for more names.
- *
- * Changes: Ingo Molnar, converted csum_partial_copy() to 2.1 exception
- * handling.
- * Andi Kleen, add zeroing on error
- * converted to pure assembler
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/config.h>
-#include <asm/errno.h>
-
-/*
- * computes a partial checksum, e.g. for TCP/UDP fragments
- */
-
-/*
-unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
- */
-
-.text
-.align 4
-.globl csum_partial
-
-#ifndef CONFIG_X86_USE_PPRO_CHECKSUM
-
- /*
- * Experiments with Ethernet and SLIP connections show that buff
- * is aligned on either a 2-byte or 4-byte boundary. We get at
- * least a twofold speedup on 486 and Pentium if it is 4-byte aligned.
- * Fortunately, it is easy to convert 2-byte alignment to 4-byte
- * alignment for the unrolled loop.
- */
-csum_partial:
- pushl %esi
- pushl %ebx
- movl 20(%esp),%eax # Function arg: unsigned int sum
- movl 16(%esp),%ecx # Function arg: int len
- movl 12(%esp),%esi # Function arg: unsigned char *buff
- testl $3, %esi # Check alignment.
- jz 2f # Jump if alignment is ok.
- testl $1, %esi # Check alignment.
- jz 10f # Jump if alignment is boundary of 2bytes.
-
- # buf is odd
- dec %ecx
- jl 8f
- movzbl (%esi), %ebx
- adcl %ebx, %eax
- roll $8, %eax
- inc %esi
- testl $2, %esi
- jz 2f
-10:
- subl $2, %ecx # Alignment uses up two bytes.
- jae 1f # Jump if we had at least two bytes.
- addl $2, %ecx # ecx was < 2. Deal with it.
- jmp 4f
-1: movw (%esi), %bx
- addl $2, %esi
- addw %bx, %ax
- adcl $0, %eax
-2:
- movl %ecx, %edx
- shrl $5, %ecx
- jz 2f
- testl %esi, %esi
-1: movl (%esi), %ebx
- adcl %ebx, %eax
- movl 4(%esi), %ebx
- adcl %ebx, %eax
- movl 8(%esi), %ebx
- adcl %ebx, %eax
- movl 12(%esi), %ebx
- adcl %ebx, %eax
- movl 16(%esi), %ebx
- adcl %ebx, %eax
- movl 20(%esi), %ebx
- adcl %ebx, %eax
- movl 24(%esi), %ebx
- adcl %ebx, %eax
- movl 28(%esi), %ebx
- adcl %ebx, %eax
- lea 32(%esi), %esi
- dec %ecx
- jne 1b
- adcl $0, %eax
-2: movl %edx, %ecx
- andl $0x1c, %edx
- je 4f
- shrl $2, %edx # This clears CF
-3: adcl (%esi), %eax
- lea 4(%esi), %esi
- dec %edx
- jne 3b
- adcl $0, %eax
-4: andl $3, %ecx
- jz 7f
- cmpl $2, %ecx
- jb 5f
- movw (%esi),%cx
- leal 2(%esi),%esi
- je 6f
- shll $16,%ecx
-5: movb (%esi),%cl
-6: addl %ecx,%eax
- adcl $0, %eax
-7:
- testl $1, 12(%esp)
- jz 8f
- roll $8, %eax
-8:
- popl %ebx
- popl %esi
- ret
-
-#else
-
-/* Version for PentiumII/PPro */
-
-csum_partial:
- pushl %esi
- pushl %ebx
- movl 20(%esp),%eax # Function arg: unsigned int sum
- movl 16(%esp),%ecx # Function arg: int len
- movl 12(%esp),%esi # Function arg: const unsigned char *buf
-
- testl $3, %esi
- jnz 25f
-10:
- movl %ecx, %edx
- movl %ecx, %ebx
- andl $0x7c, %ebx
- shrl $7, %ecx
- addl %ebx,%esi
- shrl $2, %ebx
- negl %ebx
- lea 45f(%ebx,%ebx,2), %ebx
- testl %esi, %esi
- jmp *%ebx
-
- # Handle 2-byte-aligned regions
-20: addw (%esi), %ax
- lea 2(%esi), %esi
- adcl $0, %eax
- jmp 10b
-25:
- testl $1, %esi
- jz 30f
- # buf is odd
- dec %ecx
- jl 90f
- movzbl (%esi), %ebx
- addl %ebx, %eax
- adcl $0, %eax
- roll $8, %eax
- inc %esi
- testl $2, %esi
- jz 10b
-
-30: subl $2, %ecx
- ja 20b
- je 32f
- addl $2, %ecx
- jz 80f
- movzbl (%esi),%ebx # csumming 1 byte, 2-aligned
- addl %ebx, %eax
- adcl $0, %eax
- jmp 80f
-32:
- addw (%esi), %ax # csumming 2 bytes, 2-aligned
- adcl $0, %eax
- jmp 80f
-
-40:
- addl -128(%esi), %eax
- adcl -124(%esi), %eax
- adcl -120(%esi), %eax
- adcl -116(%esi), %eax
- adcl -112(%esi), %eax
- adcl -108(%esi), %eax
- adcl -104(%esi), %eax
- adcl -100(%esi), %eax
- adcl -96(%esi), %eax
- adcl -92(%esi), %eax
- adcl -88(%esi), %eax
- adcl -84(%esi), %eax
- adcl -80(%esi), %eax
- adcl -76(%esi), %eax
- adcl -72(%esi), %eax
- adcl -68(%esi), %eax
- adcl -64(%esi), %eax
- adcl -60(%esi), %eax
- adcl -56(%esi), %eax
- adcl -52(%esi), %eax
- adcl -48(%esi), %eax
- adcl -44(%esi), %eax
- adcl -40(%esi), %eax
- adcl -36(%esi), %eax
- adcl -32(%esi), %eax
- adcl -28(%esi), %eax
- adcl -24(%esi), %eax
- adcl -20(%esi), %eax
- adcl -16(%esi), %eax
- adcl -12(%esi), %eax
- adcl -8(%esi), %eax
- adcl -4(%esi), %eax
-45:
- lea 128(%esi), %esi
- adcl $0, %eax
- dec %ecx
- jge 40b
- movl %edx, %ecx
-50: andl $3, %ecx
- jz 80f
-
- # Handle the last 1-3 bytes without jumping
- notl %ecx # 1->2, 2->1, 3->0, higher bits are masked
- movl $0xffffff,%ebx # by the shll and shrl instructions
- shll $3,%ecx
- shrl %cl,%ebx
- andl -128(%esi),%ebx # esi is 4-aligned so should be ok
- addl %ebx,%eax
- adcl $0,%eax
-80:
- testl $1, 12(%esp)
- jz 90f
- roll $8, %eax
-90:
- popl %ebx
- popl %esi
- ret
-
-#endif
-
-/*
-unsigned int csum_partial_copy_generic (const char *src, char *dst,
- int len, int sum, int *src_err_ptr, int *dst_err_ptr)
- */
-
-/*
- * Copy from ds while checksumming, otherwise like csum_partial
- *
- * The macros SRC and DST specify the type of access for the instruction.
- * thus we can call a custom exception handler for all access types.
- *
- * FIXME: could someone double-check whether I haven't mixed up some SRC and
- * DST definitions? It's damn hard to trigger all cases. I hope I got
- * them all but there's no guarantee.
- */
-
-#define SRC(y...) \
- 9999: y; \
- .section __ex_table, "a"; \
- .long 9999b, 6001f ; \
- .previous
-
-#define DST(y...) \
- 9999: y; \
- .section __ex_table, "a"; \
- .long 9999b, 6002f ; \
- .previous
-
-.align 4
-.globl csum_partial_copy_generic
-
-#ifndef CONFIG_X86_USE_PPRO_CHECKSUM
-
-#define ARGBASE 16
-#define FP 12
-
-csum_partial_copy_generic:
- subl $4,%esp
- pushl %edi
- pushl %esi
- pushl %ebx
- movl ARGBASE+16(%esp),%eax # sum
- movl ARGBASE+12(%esp),%ecx # len
- movl ARGBASE+4(%esp),%esi # src
- movl ARGBASE+8(%esp),%edi # dst
-
- testl $2, %edi # Check alignment.
- jz 2f # Jump if alignment is ok.
- subl $2, %ecx # Alignment uses up two bytes.
- jae 1f # Jump if we had at least two bytes.
- addl $2, %ecx # ecx was < 2. Deal with it.
- jmp 4f
-SRC(1: movw (%esi), %bx )
- addl $2, %esi
-DST( movw %bx, (%edi) )
- addl $2, %edi
- addw %bx, %ax
- adcl $0, %eax
-2:
- movl %ecx, FP(%esp)
- shrl $5, %ecx
- jz 2f
- testl %esi, %esi
-SRC(1: movl (%esi), %ebx )
-SRC( movl 4(%esi), %edx )
- adcl %ebx, %eax
-DST( movl %ebx, (%edi) )
- adcl %edx, %eax
-DST( movl %edx, 4(%edi) )
-
-SRC( movl 8(%esi), %ebx )
-SRC( movl 12(%esi), %edx )
- adcl %ebx, %eax
-DST( movl %ebx, 8(%edi) )
- adcl %edx, %eax
-DST( movl %edx, 12(%edi) )
-
-SRC( movl 16(%esi), %ebx )
-SRC( movl 20(%esi), %edx )
- adcl %ebx, %eax
-DST( movl %ebx, 16(%edi) )
- adcl %edx, %eax
-DST( movl %edx, 20(%edi) )
-
-SRC( movl 24(%esi), %ebx )
-SRC( movl 28(%esi), %edx )
- adcl %ebx, %eax
-DST( movl %ebx, 24(%edi) )
- adcl %edx, %eax
-DST( movl %edx, 28(%edi) )
-
- lea 32(%esi), %esi
- lea 32(%edi), %edi
- dec %ecx
- jne 1b
- adcl $0, %eax
-2: movl FP(%esp), %edx
- movl %edx, %ecx
- andl $0x1c, %edx
- je 4f
- shrl $2, %edx # This clears CF
-SRC(3: movl (%esi), %ebx )
- adcl %ebx, %eax
-DST( movl %ebx, (%edi) )
- lea 4(%esi), %esi
- lea 4(%edi), %edi
- dec %edx
- jne 3b
- adcl $0, %eax
-4: andl $3, %ecx
- jz 7f
- cmpl $2, %ecx
- jb 5f
-SRC( movw (%esi), %cx )
- leal 2(%esi), %esi
-DST( movw %cx, (%edi) )
- leal 2(%edi), %edi
- je 6f
- shll $16,%ecx
-SRC(5: movb (%esi), %cl )
-DST( movb %cl, (%edi) )
-6: addl %ecx, %eax
- adcl $0, %eax
-7:
-5000:
-
-# Exception handler:
-.section .fixup, "ax"
-
-6001:
- movl ARGBASE+20(%esp), %ebx # src_err_ptr
- movl $-EFAULT, (%ebx)
-
- # zero the complete destination - computing the rest
- # is too much work
- movl ARGBASE+8(%esp), %edi # dst
- movl ARGBASE+12(%esp), %ecx # len
- xorl %eax,%eax
- rep ; stosb
-
- jmp 5000b
-
-6002:
- movl ARGBASE+24(%esp), %ebx # dst_err_ptr
- movl $-EFAULT,(%ebx)
- jmp 5000b
-
-.previous
-
- popl %ebx
- popl %esi
- popl %edi
- popl %ecx # equivalent to addl $4,%esp
- ret
-
-#else
-
-/* Version for PentiumII/PPro */
-
-#define ROUND1(x) \
- SRC(movl x(%esi), %ebx ) ; \
- addl %ebx, %eax ; \
- DST(movl %ebx, x(%edi) ) ;
-
-#define ROUND(x) \
- SRC(movl x(%esi), %ebx ) ; \
- adcl %ebx, %eax ; \
- DST(movl %ebx, x(%edi) ) ;
-
-#define ARGBASE 12
-
-csum_partial_copy_generic:
- pushl %ebx
- pushl %edi
- pushl %esi
- movl ARGBASE+4(%esp),%esi #src
- movl ARGBASE+8(%esp),%edi #dst
- movl ARGBASE+12(%esp),%ecx #len
- movl ARGBASE+16(%esp),%eax #sum
-# movl %ecx, %edx
- movl %ecx, %ebx
- movl %esi, %edx
- shrl $6, %ecx
- andl $0x3c, %ebx
- negl %ebx
- subl %ebx, %esi
- subl %ebx, %edi
- lea -1(%esi),%edx
- andl $-32,%edx
- lea 3f(%ebx,%ebx), %ebx
- testl %esi, %esi
- jmp *%ebx
-1: addl $64,%esi
- addl $64,%edi
- SRC(movb -32(%edx),%bl) ; SRC(movb (%edx),%bl)
- ROUND1(-64) ROUND(-60) ROUND(-56) ROUND(-52)
- ROUND (-48) ROUND(-44) ROUND(-40) ROUND(-36)
- ROUND (-32) ROUND(-28) ROUND(-24) ROUND(-20)
- ROUND (-16) ROUND(-12) ROUND(-8) ROUND(-4)
-3: adcl $0,%eax
- addl $64, %edx
- dec %ecx
- jge 1b
-4: movl ARGBASE+12(%esp),%edx #len
- andl $3, %edx
- jz 7f
- cmpl $2, %edx
- jb 5f
-SRC( movw (%esi), %dx )
- leal 2(%esi), %esi
-DST( movw %dx, (%edi) )
- leal 2(%edi), %edi
- je 6f
- shll $16,%edx
-5:
-SRC( movb (%esi), %dl )
-DST( movb %dl, (%edi) )
-6: addl %edx, %eax
- adcl $0, %eax
-7:
-.section .fixup, "ax"
-6001: movl ARGBASE+20(%esp), %ebx # src_err_ptr
- movl $-EFAULT, (%ebx)
- # zero the complete destination (computing the rest is too much work)
- movl ARGBASE+8(%esp),%edi # dst
- movl ARGBASE+12(%esp),%ecx # len
- xorl %eax,%eax
- rep; stosb
- jmp 7b
-6002: movl ARGBASE+24(%esp), %ebx # dst_err_ptr
- movl $-EFAULT, (%ebx)
- jmp 7b
-.previous
-
- popl %esi
- popl %edi
- popl %ebx
- ret
-
-#undef ROUND
-#undef ROUND1
-
-#endif