freebsd-dev/sys/i386/include
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
..
pc - Use the correct devclass name ("acpi" vs "ACPI") to detect if acpi0 is 2004-06-10 20:43:04 +00:00
_inttypes.h
_limits.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
_stdint.h <stdint.h> should define WINT_M{AX,IN} independent from whether WCHAR_MIN is 2004-05-18 16:04:57 +00:00
_types.h Introduce the cpumask_t type. The purpose of the type is to create a 2004-03-20 20:41:40 +00:00
acpica_machdep.h Add an MI implementation of the ACPI global lock routines and retire the 2004-05-05 20:04:14 +00:00
apicreg.h Delete old and unused APIC_IRQ defines. 2003-12-10 21:33:07 +00:00
apicvar.h Various cleanups in support of a future ioapic_config_intr() function: 2004-06-23 15:29:20 +00:00
apm_bios.h
apm_segments.h
asm.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
asmacros.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
atomic.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
bootinfo.h Libdisk does not need to include <sys/diskslice.h> any more. 2003-04-04 16:35:16 +00:00
bus_at386.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
bus_dma.h Document the lockfunc and lockfuncarg arguments to bus_dma_tag_create() in 2003-11-07 23:29:42 +00:00
bus_memio.h
bus_pc98.h Increase BUS_SPACE_IAT_MAXSIZE to 33 for the ed driver. 2004-05-04 06:38:13 +00:00
bus_pio.h
bus.h
clock.h - Move manipulation of td_intr_nesting_level out of assembly interrupt 2003-11-12 18:13:57 +00:00
comstats.h
cpu.h Instead of calling ia32_pause() conditionally on __i386__ or __amd64__ 2004-08-03 18:44:27 +00:00
cpufunc.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
cputypes.h The NatSemi (now AMD) Geode SC1100 needs special treatment here and there 2004-06-03 21:14:53 +00:00
critical.h Pass a thread argument into cpu_critical_{enter,exit}() rather than 2004-07-27 16:41:01 +00:00
cserial.h Updated cx driver commit part 1: bring in the new kernel driver. 2003-12-03 07:29:38 +00:00
db_machdep.h Mega update for the KDB framework: turn DDB into a KDB backend. 2004-07-10 23:47:20 +00:00
elan_mmcr.h Add struct definition of the Elan MMCR registers (from jb@) 2004-01-05 12:00:59 +00:00
elf.h Add definitions for TLS relocations. 2004-08-02 19:12:17 +00:00
endian.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
exec.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
float.h Make FLT_ROUNDS correctly reflect the dynamic rounding mode. 2004-07-19 08:17:25 +00:00
floatingpoint.h o Move the contents of <machine/floatingpoint.h> over to 2003-01-19 06:01:33 +00:00
frame.h Update for the KDB framework: 2004-07-10 22:11:14 +00:00
gdb_machdep.h Introduce the GDB debugger backend for the new KDB framework. The 2004-07-10 17:47:22 +00:00
i4b_cause.h
i4b_debug.h
i4b_ioctl.h add support properly displaying and logging incoming telephone numbers (MSNs) 2002-08-12 07:53:55 +00:00
i4b_rbch_ioctl.h
i4b_tel_ioctl.h
i4b_trace.h
ieeefp.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
if_wl_wavelan.h
in_cksum.h Fix a bug in in_cksum_hdr w/o -O. 2004-08-25 18:28:15 +00:00
intr_machdep.h Optimize intr_execute_handlers() by combining the pic_disable_source() and 2004-08-02 15:31:10 +00:00
ioctl_bt848.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
ioctl_meteor.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
iodev.h Break out the MI part of the /dev/[k]mem and /dev/io drivers into 2004-08-01 11:40:54 +00:00
kdb.h Introduce the KDB debugger frontend. The frontend provides a framework 2004-07-10 18:40:12 +00:00
legacyvar.h Make the legacy_pcib_attach() function static. 2004-05-03 14:49:43 +00:00
limits.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
md_var.h Remove atdevbase and replace it's remaining uses with direct references to 2004-06-10 20:31:00 +00:00
memdev.h Break out the MI part of the /dev/[k]mem and /dev/io drivers into 2004-08-01 11:40:54 +00:00
metadata.h Slight reorg and added AMD64 support. A couple of the MODINFOMD_* values 2003-05-01 03:31:18 +00:00
mp_watchdog.h Add an "options MP_WATCHDOG" to i386. This option allows one of the 2004-08-15 18:02:09 +00:00
mptable.h Convert a couple of pointers to integers for source compatability with 2003-11-14 22:23:30 +00:00
mtpr.h
mutex.h
npx.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
param.h Turn off PREEMPTION by default while it gets debugged. It's been causing 2004-08-01 14:31:45 +00:00
pcaudioio.h
pcb_ext.h
pcb.h Implement makectx(). The makectx() function is used by KDB to create 2004-07-10 19:56:00 +00:00
pci_cfgreg.h - Create a pir0 psuedo device as a child of legacy0 if we attach a legacy 2004-05-04 21:17:52 +00:00
pcpu.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
pcvt_ioctl.h Add just enough of i386/include/pcvt_ioctl.h to amd64/include/pcvt_ioctl.h 2003-12-10 02:49:17 +00:00
pecoff_machdep.h
perfmon.h
pmap.h Reduce the size of pv entries by 15%. This saves 1MB of KVA for mapping 2004-06-29 15:57:05 +00:00
privatespace.h
proc.h bde points out that this can't do anything useful. The full patch has 2004-06-28 05:37:22 +00:00
profile.h Moved i386 asms to an i386 header. The asms are for calibration of 2004-05-20 16:12:19 +00:00
psl.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
ptrace.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
reg.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
reloc.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
resource.h
runq.h
segments.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
setjmp.h Fix namespace issues by using visibility conditionals from 2002-10-05 05:47:56 +00:00
sf_buf.h Don't remove the virtual-to-physical mapping when an sf_buf is freed. 2003-12-07 22:49:25 +00:00
sigframe.h Split 4.x and 5.x signal handling so that we can keep 4.x signal 2002-10-25 19:10:58 +00:00
signal.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
smapi.h Use __packed; 2003-03-24 20:44:39 +00:00
smp.h - Add the mp_topology() function to mp_machdep.c. This function builds up 2003-12-11 03:48:31 +00:00
smptests.h Localized the cy driver's locking. 2003-11-16 00:55:54 +00:00
speaker.h Very minor whitespace/style nit. 2002-10-23 10:14:30 +00:00
specialreg.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
stdarg.h These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
sysarch.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
trap.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
tss.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
ucontext.h Align the FPU state in the ucontext and sigcontext to 16 bytes 2002-12-02 19:58:55 +00:00
varargs.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
vm86.h 1.Fix smp race between kernel vm86 BIOS calling and userland vm86 mode code, 2002-11-07 01:34:23 +00:00
vmparam.h Increase the scaling of VM_KMEM_SIZE_MAX. 2004-08-16 08:35:22 +00:00