Commit Graph

13 Commits

Author SHA1 Message Date
John Polstra
d5de6c2a5f Fix several bugs in the i386 asm statements used to speed up Internet
checksumming.  These bugs could possibly cause bad code to be
generated at elevated optimization levels.

First, eliminate the use of preprocessor magic to form the address
fields of asm instructions.  It hid the actual addresses being
referenced from the compiler.  Without knowledge of all the data
dependencies, the compiler might possibly use optimizations which
would result in incorrect code.

Use "__asm __volatile" rather than "__asm" for instruction sequences
that pass information through the condition codes (the carry bit, in
this case).  Without __volatile, the compiler might add unrelated
code between consecutive __asm instructions, modifying the condition
codes.  I have seen GCC insert stack pointer adjustments in this
way, for example.  Unfortunately, GCC doesn't provide a way to
specify dependencies on the condition codes.  You can specify that
they are clobbered, but not that you are going to use them as input.

Finally, simplify the LOAD macro.  This macro is used as a poor
man's prefetch.  The simpler version gives the compiler more leeway
about just how it performs the prefetch.

MFC after:	1 week
2002-06-22 22:35:53 +00:00
Alfred Perlstein
b63dc6ad47 Remove __P. 2002-03-20 05:48:58 +00:00
John Baldwin
3f9a462fb9 Various assembly fixes mostly in the form of using the "+" modifier for
output operands to mark them as both input and output rather than listing
operands twice.

Reviewed by:	bde
2001-12-18 08:54:39 +00:00
Alfred Perlstein
d28632c097 These files are mpsafe. 2000-11-25 03:01:05 +00:00
Jonathan Lemon
cb1a6557e1 Make in_cksum() a macro call to in_cksum_skip(), since it provides the
same functionality.  Sharing code should help cache issues.

Remove in_cksum_partial, since its not being used, and we now have
a way to compute partial checksums on mbuf chains.
2000-05-06 18:18:32 +00:00
Jonathan Lemon
db4f9cc703 Add support for offloading IP/TCP/UDP checksums to NIC hardware which
supports them.
2000-03-27 19:14:27 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Garrett Wollman
57bf258e3d Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs.  (Socket buffers are the one exception.)  A number
of kernel APIs needed to get fixed in order to make this happen.  Also,
fix three protocol families which kept PCBs in mbufs to not malloc them
instead.  Delete some old compatibility cruft while we're at it, and add
some new routines in the in_cksum family.
1997-08-16 19:16:27 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Garrett Wollman
f66e235a13 Add an incremental checksum update routine. Perhaps some i386 assembly
guru out there can find a way to take advantage of little-endianness to
make this computation more efficient.  (I am certain that it can be done,
but haven't managed to make it work myself.)
1996-05-23 20:11:48 +00:00
Garrett Wollman
97f588a78b Add an inline function to compute the common-case IP header checksum. 1996-04-18 15:39:27 +00:00