From owner-freebsd-sparc64@FreeBSD.ORG Wed Mar 23 17:08:33 2005 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4C2B16A4CE for ; Wed, 23 Mar 2005 17:08:33 +0000 (GMT) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id C367743D1D for ; Wed, 23 Mar 2005 17:08:31 +0000 (GMT) (envelope-from avg@icyb.net.ua) Received: from [212.40.38.87] (oddity-e.topspin.kiev.ua [212.40.38.87]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA27979 for ; Wed, 23 Mar 2005 19:08:28 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4241A28C.4060309@icyb.net.ua> Date: Wed, 23 Mar 2005 19:08:28 +0200 From: Andriy Gapon User-Agent: Mozilla Thunderbird 1.0 (X11/20050319) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-sparc64@freebsd.org References: <42415375.4080107@icyb.net.ua> In-Reply-To: <42415375.4080107@icyb.net.ua> Content-Type: multipart/mixed; boundary="------------030109070305070303040201" Subject: udfclient-0.3.3_1 failed on sparc64: bswap.h X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2005 17:08:33 -0000 This is a multi-part message in MIME format. --------------030109070305070303040201 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Volunteers with big endian hardware, could you please test the attached patch to sysutils/udfclient port? At least that it compiles, it is only a few .c files. -- Andriy Gapon --------------030109070305070303040201 Content-Type: text/plain; name="sparc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sparc.patch" --- ./work/UDFclient.0.3.3/udf_bswap.h.orig Wed Mar 23 18:00:36 2005 +++ ./work/UDFclient.0.3.3/udf_bswap.h Wed Mar 23 19:00:10 2005 @@ -52,8 +52,33 @@ /* rest only relevant for big endian machines */ #if (BYTE_ORDER == BIG_ENDIAN) +#if !defined(__FreeBSD__) #include #include +#else +#if !defined(bswap16) +/* this version of FreeBSD does not provide bswap*() functions */ +static __inline u_int16_t +bswap16(u_int16_t x) +{ + return ((x >> 8) | ((x << 8) & 0xff00U)); +} +static __inline u_int32_t +bswap32(u_int32_t x) +{ + return ((x >> 24) | ((x >> 8) & 0xff00U) | ((x << 8) & 0xff0000U) | + ((x << 24) & 0xff000000U)); +} +static __inline u_int64_t +bswap64(u_int64_t x) +{ + return ((x >> 56) | ((x >> 40) & 0xff00UL) | ((x >> 24) & 0xff0000UL) | + ((x >> 8) & 0xff000000UL) | ((x << 8) & 0xff00000000UL) | + ((x << 24) & 0xff0000000000UL) | ((x << 40) & 0xff000000000000UL) | + ((x << 56))); +} +#endif +#endif /* inlines for access to swapped data */ static __inline u_int16_t udf_rw16 __P((u_int16_t)); --------------030109070305070303040201--