Deleted Added
full compact
efsys.h (258541) efsys.h (272325)
1/*-
2 * Copyright (c) 2010-2011 Solarflare Communications, Inc.
3 * All rights reserved.
4 *
5 * This software was developed in part by Philip Paeps under contract for
6 * Solarflare Communications, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2010-2011 Solarflare Communications, Inc.
3 * All rights reserved.
4 *
5 * This software was developed in part by Philip Paeps under contract for
6 * Solarflare Communications, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/sfxge/common/efsys.h 258541 2013-11-25 07:38:45Z attilio $
29 * $FreeBSD: head/sys/dev/sfxge/common/efsys.h 272325 2014-09-30 20:18:10Z gnn $
30 */
31
32#ifndef _SYS_EFSYS_H
33#define _SYS_EFSYS_H
34
35#ifdef __cplusplus
36extern "C" {
37#endif

--- 10 unchanged lines hidden (view full) ---

48#include <sys/systm.h>
49
50#include <machine/bus.h>
51#include <machine/endian.h>
52
53#define EFSYS_HAS_UINT64 1
54#define EFSYS_USE_UINT64 0
55#if _BYTE_ORDER == _BIG_ENDIAN
30 */
31
32#ifndef _SYS_EFSYS_H
33#define _SYS_EFSYS_H
34
35#ifdef __cplusplus
36extern "C" {
37#endif

--- 10 unchanged lines hidden (view full) ---

48#include <sys/systm.h>
49
50#include <machine/bus.h>
51#include <machine/endian.h>
52
53#define EFSYS_HAS_UINT64 1
54#define EFSYS_USE_UINT64 0
55#if _BYTE_ORDER == _BIG_ENDIAN
56#define EFSYS_IS_BIG_ENDIAN 1
57#define EFSYS_IS_LITTLE_ENDIAN 0
56#define EFSYS_IS_BIG_ENDIAN 1
57#define EFSYS_IS_LITTLE_ENDIAN 0
58#elif _BYTE_ORDER == _LITTLE_ENDIAN
58#elif _BYTE_ORDER == _LITTLE_ENDIAN
59#define EFSYS_IS_BIG_ENDIAN 0
60#define EFSYS_IS_LITTLE_ENDIAN 1
59#define EFSYS_IS_BIG_ENDIAN 0
60#define EFSYS_IS_LITTLE_ENDIAN 1
61#endif
62#include "efx_types.h"
63
64/* Common code requires this */
65#if __FreeBSD_version < 800068
61#endif
62#include "efx_types.h"
63
64/* Common code requires this */
65#if __FreeBSD_version < 800068
66#define memmove(d, s, l) bcopy(s, d, l)
66#define memmove(d, s, l) bcopy(s, d, l)
67#endif
67#endif
68
68
69/* FreeBSD equivalents of Solaris things */
70#ifndef _NOTE
69/* FreeBSD equivalents of Solaris things */
70#ifndef _NOTE
71#define _NOTE(s)
71#define _NOTE(s)
72#endif
73
74#ifndef B_FALSE
72#endif
73
74#ifndef B_FALSE
75#define B_FALSE FALSE
75#define B_FALSE FALSE
76#endif
77#ifndef B_TRUE
76#endif
77#ifndef B_TRUE
78#define B_TRUE TRUE
78#define B_TRUE TRUE
79#endif
80
81#ifndef IS_P2ALIGNED
79#endif
80
81#ifndef IS_P2ALIGNED
82#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
82#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
83#endif
84
85#ifndef P2ROUNDUP
83#endif
84
85#ifndef P2ROUNDUP
86#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
86#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
87#endif
88
89#ifndef IS2P
87#endif
88
89#ifndef IS2P
90#define ISP2(x) (((x) & ((x) - 1)) == 0)
90#define ISP2(x) (((x) & ((x) - 1)) == 0)
91#endif
92
91#endif
92
93#define ENOTACTIVE EINVAL
93#define ENOTACTIVE EINVAL
94
95/* Memory type to use on FreeBSD */
96MALLOC_DECLARE(M_SFXGE);
97
98/* Machine dependend prefetch wrappers */
99#if defined(__i386__) || defined(__amd64__)
100static __inline void
101prefetch_read_many(void *addr)

--- 135 unchanged lines hidden (view full) ---

237#define EFSYS_OPT_PHY_TXC43128 0
238#define EFSYS_OPT_PHY_PM8358 0
239#define EFSYS_OPT_PHY_SFT9001 0
240#define EFSYS_OPT_PHY_QT2025C 0
241#define EFSYS_OPT_PHY_STATS 1
242#define EFSYS_OPT_PHY_PROPS 0
243#define EFSYS_OPT_PHY_BIST 1
244#define EFSYS_OPT_PHY_LED_CONTROL 1
94
95/* Memory type to use on FreeBSD */
96MALLOC_DECLARE(M_SFXGE);
97
98/* Machine dependend prefetch wrappers */
99#if defined(__i386__) || defined(__amd64__)
100static __inline void
101prefetch_read_many(void *addr)

--- 135 unchanged lines hidden (view full) ---

237#define EFSYS_OPT_PHY_TXC43128 0
238#define EFSYS_OPT_PHY_PM8358 0
239#define EFSYS_OPT_PHY_SFT9001 0
240#define EFSYS_OPT_PHY_QT2025C 0
241#define EFSYS_OPT_PHY_STATS 1
242#define EFSYS_OPT_PHY_PROPS 0
243#define EFSYS_OPT_PHY_BIST 1
244#define EFSYS_OPT_PHY_LED_CONTROL 1
245#define EFSYS_OPT_PHY_FLAGS 0
245#define EFSYS_OPT_PHY_FLAGS 0
246
247#define EFSYS_OPT_VPD 1
248#define EFSYS_OPT_NVRAM 1
249#define EFSYS_OPT_NVRAM_FALCON_BOOTROM 0
250#define EFSYS_OPT_NVRAM_SFT9001 0
251#define EFSYS_OPT_NVRAM_SFX7101 0
252#define EFSYS_OPT_BOOTCFG 0
253
254#define EFSYS_OPT_PCIE_TUNE 0
255#define EFSYS_OPT_DIAG 0
256#define EFSYS_OPT_WOL 1
257#define EFSYS_OPT_RX_SCALE 1
258#define EFSYS_OPT_QSTATS 1
246
247#define EFSYS_OPT_VPD 1
248#define EFSYS_OPT_NVRAM 1
249#define EFSYS_OPT_NVRAM_FALCON_BOOTROM 0
250#define EFSYS_OPT_NVRAM_SFT9001 0
251#define EFSYS_OPT_NVRAM_SFX7101 0
252#define EFSYS_OPT_BOOTCFG 0
253
254#define EFSYS_OPT_PCIE_TUNE 0
255#define EFSYS_OPT_DIAG 0
256#define EFSYS_OPT_WOL 1
257#define EFSYS_OPT_RX_SCALE 1
258#define EFSYS_OPT_QSTATS 1
259#define EFSYS_OPT_FILTER 0
260#define EFSYS_OPT_RX_SCATTER 0
259#define EFSYS_OPT_FILTER 0
260#define EFSYS_OPT_RX_SCATTER 0
261#define EFSYS_OPT_RX_HDR_SPLIT 0
262
263#define EFSYS_OPT_EV_PREFETCH 0
264
265#define EFSYS_OPT_DECODE_INTR_FATAL 1
266
267/* ID */
268
269typedef struct __efsys_identifier_s efsys_identifier_t;
270
271/* PROBE */
272
273#ifndef DTRACE_PROBE
274
261#define EFSYS_OPT_RX_HDR_SPLIT 0
262
263#define EFSYS_OPT_EV_PREFETCH 0
264
265#define EFSYS_OPT_DECODE_INTR_FATAL 1
266
267/* ID */
268
269typedef struct __efsys_identifier_s efsys_identifier_t;
270
271/* PROBE */
272
273#ifndef DTRACE_PROBE
274
275#define EFSYS_PROBE(_name)
275#define EFSYS_PROBE(_name)
276
277#define EFSYS_PROBE1(_name, _type1, _arg1)
278
279#define EFSYS_PROBE2(_name, _type1, _arg1, _type2, _arg2)
280
281#define EFSYS_PROBE3(_name, _type1, _arg1, _type2, _arg2, \
282 _type3, _arg3)
283

--- 526 unchanged lines hidden (view full) ---

810
811/* ASSERT */
812
813#define EFSYS_ASSERT(_exp) do { \
814 if (!(_exp)) \
815 panic(#_exp); \
816 } while (0)
817
276
277#define EFSYS_PROBE1(_name, _type1, _arg1)
278
279#define EFSYS_PROBE2(_name, _type1, _arg1, _type2, _arg2)
280
281#define EFSYS_PROBE3(_name, _type1, _arg1, _type2, _arg2, \
282 _type3, _arg3)
283

--- 526 unchanged lines hidden (view full) ---

810
811/* ASSERT */
812
813#define EFSYS_ASSERT(_exp) do { \
814 if (!(_exp)) \
815 panic(#_exp); \
816 } while (0)
817
818#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \
818#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \
819 const _t __x = (_t)(_x); \
820 const _t __y = (_t)(_y); \
821 if (!(__x _op __y)) \
819 const _t __x = (_t)(_x); \
820 const _t __y = (_t)(_y); \
821 if (!(__x _op __y)) \
822 panic("assertion failed at %s:%u", __FILE__, __LINE__); \
822 panic("assertion failed at %s:%u", __FILE__, __LINE__); \
823 } while(0)
824
823 } while(0)
824
825#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t)
826#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t)
827#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t)
825#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t)
826#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t)
827#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t)
828
829#ifdef __cplusplus
830}
831#endif
832
833#endif /* _SYS_EFSYS_H */
828
829#ifdef __cplusplus
830}
831#endif
832
833#endif /* _SYS_EFSYS_H */