Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
Changing types from unsigned {long,short} to u_int{32,16}_t causes problems
in a lot of userlevel code because those types aren't defined when machine/
endian.h is included. And IMO including sys/types.h in machine/endian.h
is clearly wrong.
XPG4.2 defines new types in_addr_t and in_port_t for the {h,n}to{n,h}{l,s}
functions. But we don't have time to figure out the implementation issues
given the current release schedule.
faster (on the i486 & i586) rorw $8, %w1. The inline assembly for GCC 1.X
already used rorw. Using rorw is one byte longer, but we wouldn't be
inlining at all if we weren't optimizing for speed.
Use GCC's inline assembly iff we are using GCC.
Use bswap instruction if using gcc and defined(KERNEL) &&
((defined(I486_CPU) || defined(I586_CPU)) && !defined(I386_CPU))