svn commit: r280378 - head/sys/dev/sfxge/common
Andrew Rybchenko
arybchik at FreeBSD.org
Mon Mar 23 15:52:07 UTC 2015
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) \
More information about the svn-src-all
mailing list