From owner-trustedbsd-cvs@FreeBSD.ORG  Thu Apr 20 15:49:11 2006
Return-Path: <owner-trustedbsd-cvs@FreeBSD.ORG>
X-Original-To: trustedbsd-cvs@freebsd.org
Delivered-To: trustedbsd-cvs@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5BD6416A404
	for <trustedbsd-cvs@freebsd.org>; Thu, 20 Apr 2006 15:49:11 +0000 (UTC)
	(envelope-from owner-perforce@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8E8E843D46
	for <trustedbsd-cvs@freebsd.org>; Thu, 20 Apr 2006 15:49:10 +0000 (GMT)
	(envelope-from owner-perforce@freebsd.org)
Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119])
	by cyrus.watson.org (Postfix) with ESMTP id BCC3346C66
	for <trustedbsd-cvs@trustedbsd.org>;
	Thu, 20 Apr 2006 11:49:08 -0400 (EDT)
Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18])
	by mx2.freebsd.org (Postfix) with ESMTP id 0C9315663E;
	Thu, 20 Apr 2006 15:49:06 +0000 (GMT)
	(envelope-from owner-perforce@freebsd.org)
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 04EA716A409; Thu, 20 Apr 2006 15:49:06 +0000 (UTC)
X-Original-To: perforce@freebsd.org
Delivered-To: perforce@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BF69116A405
	for <perforce@freebsd.org>; Thu, 20 Apr 2006 15:49:05 +0000 (UTC)
	(envelope-from millert@freebsd.org)
Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 896AC43D48
	for <perforce@freebsd.org>; Thu, 20 Apr 2006 15:49:05 +0000 (GMT)
	(envelope-from millert@freebsd.org)
Received: from repoman.freebsd.org (localhost [127.0.0.1])
	by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3KFn5Vg096762
	for <perforce@freebsd.org>; Thu, 20 Apr 2006 15:49:05 GMT
	(envelope-from millert@freebsd.org)
Received: (from perforce@localhost)
	by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3KFn5DU096759
	for perforce@freebsd.org; Thu, 20 Apr 2006 15:49:05 GMT
	(envelope-from millert@freebsd.org)
Date: Thu, 20 Apr 2006 15:49:05 GMT
Message-Id: <200604201549.k3KFn5DU096759@repoman.freebsd.org>
X-Authentication-Warning: repoman.freebsd.org: perforce set sender to
	millert@freebsd.org using -f
From: Todd Miller <millert@FreeBSD.org>
To: Perforce Change Reviews <perforce@freebsd.org>
Cc: 
Subject: PERFORCE change 95690 for review
X-BeenThere: trustedbsd-cvs@FreeBSD.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: TrustedBSD CVS and Perforce commit message list
	<trustedbsd-cvs.FreeBSD.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/trustedbsd-cvs>, 
	<mailto:trustedbsd-cvs-request@FreeBSD.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/trustedbsd-cvs>
List-Post: <mailto:trustedbsd-cvs@FreeBSD.org>
List-Help: <mailto:trustedbsd-cvs-request@FreeBSD.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/trustedbsd-cvs>,
	<mailto:trustedbsd-cvs-request@FreeBSD.org?subject=subscribe>
X-List-Received-Date: Thu, 20 Apr 2006 15:49:11 -0000

http://perforce.freebsd.org/chv.cgi?CH=95690

Change 95690 by millert@millert_g5tower on 2006/04/20 15:48:36

	Use OSSwapInt* functions for byte swapping.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/linux-compat.h#17 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/linux-compat.h#17 (text+ko) ====

@@ -48,8 +48,11 @@
 
 #include <sys/types.h>			/* NOTE: mach sys/types, not BSD one. */
 #include <sys/lock.h>			/* For atomic operation protos */
-#include <machine/endian.h>		/* We need to explicitly include */
-#include <architecture/byte_order.h>	/* byte order includes for mach. */
+#ifdef KERNEL
+#include <libkern/OSByteOrder.h>
+#else
+#include <architecture/byte_order.h>
+#endif
 
 typedef u_int64_t u64;
 typedef u_int64_t __le64;
@@ -71,12 +74,12 @@
 #define	le32_to_cpu(x)	((__uint32_t)(x))
 #define	le64_to_cpu(x)	((__uint64_t)(x))
 #elif BYTE_ORDER == BIG_ENDIAN
-#define	cpu_to_le16(x)	NXSwapHostShortToLittle(x)
-#define	cpu_to_le32(x)	NXSwapHostLongToLittle(x)
-#define	cpu_to_le64(x)	NXSwapHostLongLongToLittle(x)
-#define	le16_to_cpu(x)	NXSwapLittleShortToHost(x)
-#define	le32_to_cpu(x)	NXSwapLittleLongToHost(x)
-#define	le64_to_cpu(x)	NXSwapLittleLongLongToHost(x)
+#define	cpu_to_le16(x)	OSSwapInt16(x)
+#define	cpu_to_le32(x)	OSSwapInt32(x)
+#define	cpu_to_le64(x)	OSSwapInt64(x)
+#define	le16_to_cpu(x)	OSSwapInt16(x)
+#define	le32_to_cpu(x)	OSSwapInt32(x)
+#define	le64_to_cpu(x)	OSSwapInt64(x)
 #else
 #error unsupported BYTE_ORDER
 #endif /* BYTE_ORDER */