freebsd-dev/sys/i386
David E. O'Brien 2e262ac39b Fix a bug in in_cksum_hdr w/o -O.
The C code assumes that the carry bit is always kept from the previous
operation. However, the pointer indexing requires another add operation.
Thus, the carry bit from the first operation is tromped over by the
"addl" operation that ends up following it, so the "adcl" that follows
that has no effect because the carry bit is cleared before it.
The result is checksum failure on received packets.

The larger issue is that there isn't any other way of preventing the compiler
inserting arbitrary instructions between different __asm statements (and
that the commit message in revision 1.13 of in_cksum.h is wrong on
this point).  From
http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/Extended-Asm.html
	---8<---8<---8<---
	You can't expect a sequence of volatile asm instructions to remain
	perfectly consecutive. If you want consecutive output, use a single
	asm.  Also, GCC will perform some optimizations across a volatile
	asm instruction; GCC does not "forget everything" when it encounters
	a volatile asm instruction the way some other compilers do.
	---8<---8<---8<---

Also, this change also makes the ASM code much easier to read.

PR:		69257
Submitted by:	Mike Bristow <mike@urgle.com>, Qing Li <qing.li@bluecoat.com>
2004-08-25 18:28:15 +00:00
..
acpica Be sure to always unlock the sx lock when exiting the sysctl function. 2004-08-24 17:53:25 +00:00
bios o Return ai_batteries as 0xffffffff instead of -1. This is a nop change, but 2004-06-16 20:27:50 +00:00
compile Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
conf My recent measurement shows that CPU_DISABLE_CMPXCHG is no longer necessary 2004-08-23 15:55:03 +00:00
cpufreq o Fix whitespace bug introduced in the previous commit. 2004-08-23 10:09:29 +00:00
i386 Commit Doug White and Alan Cox's fix for the cross-ipi smp deadlock. 2004-08-23 21:39:29 +00:00
ibcs2 Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
include Fix a bug in in_cksum_hdr w/o -O. 2004-08-25 18:28:15 +00:00
isa Optimize intr_execute_handlers() by combining the pic_disable_source() and 2004-08-02 15:31:10 +00:00
linux Correct the arguments to kern_sigaltstack() as they were reversed. 2004-08-24 20:52:52 +00:00
pci Consistently use __inline instead of __inline__ as the former is an empty macro 2004-07-04 16:11:03 +00:00
svr4 Attempt to make the proper changes here for the proc.h commit: 2004-01-05 00:29:00 +00:00
Makefile This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00