diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:52:31 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:52:31 +0000 |
commit | 7df9d164f1470ef69b776d52e168a67e4f6d0009 (patch) | |
tree | ceea937678c88a153d85365e1c81c66e24e3cda2 | |
parent | 94de563c74b0394c4b46ece0c29306f2ebca5226 (diff) | |
download | FreeBSD-src-7df9d164f1470ef69b776d52e168a67e4f6d0009.zip FreeBSD-src-7df9d164f1470ef69b776d52e168a67e4f6d0009.tar.gz |
MFC: 280378
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.
Original Differential Revision: https://reviews.freebsd.org/D2083
-rw-r--r-- | sys/dev/sfxge/common/efsys.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/sfxge/common/efsys.h b/sys/dev/sfxge/common/efsys.h index 9e9bdc2..5407426 100644 --- a/sys/dev/sfxge/common/efsys.h +++ b/sys/dev/sfxge/common/efsys.h @@ -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) \ |