From owner-cvs-all Wed Feb 27 9:16:27 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BE8D837B402; Wed, 27 Feb 2002 09:16:18 -0800 (PST) Received: (from tmm@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1RHGIZ26036; Wed, 27 Feb 2002 09:16:18 -0800 (PST) (envelope-from tmm) Message-Id: <200202271716.g1RHGIZ26036@freefall.freebsd.org> From: Thomas Moestl Date: Wed, 27 Feb 2002 09:16:18 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libstand Makefile src/sys/alpha/include bus.h endian.h src/sys/conf files.alpha files.ia64 src/sys/dev/iir iir.h src/sys/i386/include bus.h endian.h src/sys/ia64/include bus.h endian.h src/sys/sys imgact_aout.h mchain.h param.h ... X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG tmm 2002/02/27 09:16:18 PST Modified files: lib/libstand Makefile sys/alpha/include bus.h endian.h sys/conf files.alpha files.ia64 sys/dev/iir iir.h sys/i386/include bus.h endian.h sys/ia64/include bus.h endian.h sys/sys imgact_aout.h mchain.h param.h sys/dev/usb ohci.c uhci.c usb_port.h sys/dev/wi if_wi.c sys/libkern/alpha byte_swap_2.S byte_swap_4.S sys/libkern/ia64 byte_swap_2.S byte_swap_4.S sys/powerpc/include endian.h sys/sparc64/include endian.h Added files: sys/libkern/alpha bswap16.S bswap32.S sys/libkern/ia64 bswap16.S bswap32.S Removed files: sys/libkern/alpha htonl.S htons.S ntohl.S ntohs.S sys/libkern/ia64 htonl.S htons.S ntohl.S ntohs.S Log: Add the following functions/macros to support byte order conversions and device drivers for bus system with other endinesses than the CPU (using interfaces compatible to NetBSD): - bwap16() and bswap32(). These have optimized implementations on some architectures; for those that don't, there exist generic implementations. - macros to convert from a certain byte order to host byte order and vice versa, using a naming scheme like le16toh(), htole16(). These are implemented using the bswap functions. - stream bus space access functions, which do not perform a byte order conversion (while the normal access functions would if the bus endianess differs from the CPU endianess). htons(), htonl(), ntohs() and ntohl() are implemented using the new functions above for kernel usage. None of the above interfaces is currently exported to user land. Make use of the new functions in a few places where local implementations of the same functionality existed. Reviewed by: mike, bde Tested on alpha by: mike Revision Changes Path 1.27 +4 -6 src/lib/libstand/Makefile 1.10 +65 -1 src/sys/alpha/include/bus.h 1.7 +8 -0 src/sys/alpha/include/endian.h 1.80 +2 -4 src/sys/conf/files.alpha 1.26 +2 -4 src/sys/conf/files.ia64 1.2 +2 -4 src/sys/dev/iir/iir.h 1.65 +0 -14 src/sys/dev/usb/ohci.c 1.84 +1 -1 src/sys/dev/usb/uhci.c 1.41 +0 -1 src/sys/dev/usb/usb_port.h 1.75 +2 -4 src/sys/dev/wi/if_wi.c 1.10 +65 -1 src/sys/i386/include/bus.h 1.31 +6 -19 src/sys/i386/include/endian.h 1.4 +65 -1 src/sys/ia64/include/bus.h 1.7 +17 -23 src/sys/ia64/include/endian.h 1.1 +35 -0 src/sys/libkern/alpha/bswap16.S (new) 1.1 +35 -0 src/sys/libkern/alpha/bswap32.S (new) 1.4 +2 -3 src/sys/libkern/alpha/byte_swap_2.S 1.4 +2 -3 src/sys/libkern/alpha/byte_swap_4.S 1.4 +0 -34 src/sys/libkern/alpha/htonl.S (dead) 1.4 +0 -34 src/sys/libkern/alpha/htons.S (dead) 1.4 +0 -34 src/sys/libkern/alpha/ntohl.S (dead) 1.4 +0 -34 src/sys/libkern/alpha/ntohs.S (dead) 1.1 +35 -0 src/sys/libkern/ia64/bswap16.S (new) 1.1 +35 -0 src/sys/libkern/ia64/bswap32.S (new) 1.4 +2 -3 src/sys/libkern/ia64/byte_swap_2.S 1.4 +2 -3 src/sys/libkern/ia64/byte_swap_4.S 1.3 +0 -34 src/sys/libkern/ia64/htonl.S (dead) 1.3 +0 -34 src/sys/libkern/ia64/htons.S (dead) 1.3 +0 -34 src/sys/libkern/ia64/ntohl.S (dead) 1.3 +0 -34 src/sys/libkern/ia64/ntohs.S (dead) 1.6 +0 -12 src/sys/powerpc/include/endian.h 1.6 +0 -5 src/sys/sparc64/include/endian.h 1.16 +4 -4 src/sys/sys/imgact_aout.h 1.3 +23 -0 src/sys/sys/mchain.h 1.115 +78 -14 src/sys/sys/param.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message