are some good reasons for not doing this, even if the linting of
the code breaks.
1) If lint were ever to understand the stuff inside the macros,
that would break the checks.
2) There are ways to use __GNUC__ to exclude overly specific
code.
3) (Not yet practical) Lint(1) needs to properlyu understand
all of te code we actually run.
Complained about by: bde
Education by: jake, jhb, eivind
as inline functions, renaming them to __uint16_swap_uint32,
__uint8_swap_uint32 and __uint8_swap_uint16.
Doing it properly suggested by: msmith
Reviewed by: msmith
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.
properly. Simply don't use the gcc macros if we're not gcc, and
declare prototypes for the byte-swapping functions in case the
macro versions are not used. The previous fix was wrong and broke
libpcap, which abuses -Dlint.
Don't pollute the namespace if _POSIX_SOURCE is defined. This is
broken - it makes almost everything in <machine/endian.h> inaccessible
if _POSIX_SOURCE is defined, yet <machine/endian.h> is not a POSIX
header. Other systems don't do it any better.
Removed always-false `BYTE_ORDER == BIG_ENDIAN' ifdef.
Obtained from: partly from Lite(2?) and NetBSD
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.
ACTUALLY_LKM_NOT_KERNEL until the real fix comes through. Whatever
flag that is used to indicate building LKMs will have be be substituted
in the future. This allows proper selection of the usage of the
efficient, single instruction in the kernel, but alas, doesn't allow
for use in userland or LKMs :-(. Them's the breaks!!!
with one of the following (I486_CPU,I586_CPU,I686_CPU) so it can take
advantage of the very quick bswap insn. This keeps LKMs from being
built to take advantage of the insn, but also makes sure that the LKMs
can be run on all CPUs. (The LKMs don't pick up the CPU options :-( ).
registers.) Also clean up some namespace pollution, and remove
gcc-1 support (nothing really works with it anymore anyway.)
Submitted by: Bruce Evans <bde@freebsd.org> and me.
Per Wayne Scott of Intel, the old sequence took 20cycles!!! on a P6.
Another nice side-benefit is that the kernel is about 3K smaller!!!
Submitted by: Wayne Scott <wscott@ichips.intel.com>
following warning:
warning: ANSI C forbids braced-groups within expressions
Adding __extension__ before the statement-expression seems to work right.
Submitted by: bde (a *long* time ago)