From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 15:52:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 112DB85E; Mon, 23 Mar 2015 15:52:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D71C0F8; Mon, 23 Mar 2015 15:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFq6wR050627; Mon, 23 Mar 2015 15:52:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFq6Pf050626; Mon, 23 Mar 2015 15:52:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231552.t2NFq6Pf050626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280378 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 15:52:07 -0000 Author: arybchik Date: Mon Mar 23 15:52:05 2015 New Revision: 280378 URL: https://svnweb.freebsd.org/changeset/base/280378 Log: sfxge: FreeBSD before 10 does not have bus_space_*_8 on amd64 bus_space_*_8() are not always macros, so it is not correct to use #ifndef. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2083 Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Mar 23 15:49:11 2015 (r280377) +++ head/sys/dev/sfxge/common/efsys.h Mon Mar 23 15:52:05 2015 (r280378) @@ -94,13 +94,20 @@ extern "C" { #define ISP2(x) (((x) & ((x) - 1)) == 0) #endif -#if defined(__x86_64__) +#if defined(__x86_64__) && __FreeBSD_version >= 1000000 + +#define SFXGE_USE_BUS_SPACE_8 1 + #if !defined(bus_space_read_stream_8) + #define bus_space_read_stream_8(t, h, o) \ bus_space_read_8((t), (h), (o)) + #define bus_space_write_stream_8(t, h, o, v) \ bus_space_write_8((t), (h), (o), (v)) + #endif + #endif #define ENOTACTIVE EINVAL @@ -663,7 +670,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -804,7 +811,7 @@ typedef struct efsys_bar_s { _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ @@ -873,7 +880,7 @@ typedef struct efsys_bar_s { } while (B_FALSE) #endif -#if defined(__x86_64__) +#if defined(SFXGE_USE_BUS_SPACE_8) #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \