From owner-p4-projects@FreeBSD.ORG Thu Apr 20 15:49:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@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 ; 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 ; 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 ; 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 To: Perforce Change Reviews Cc: Subject: PERFORCE change 95690 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2006 15:49:06 -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 /* NOTE: mach sys/types, not BSD one. */ #include /* For atomic operation protos */ -#include /* We need to explicitly include */ -#include /* byte order includes for mach. */ +#ifdef KERNEL +#include +#else +#include +#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 */