#define MIN(v1, v2) ((v1) < (v2) ? (v1) : (v2))
#endif
-/* There are macros for alignment in DPDK, but we need to make a proper
- * correspondence here, if we want to re-use them at all
- */
-#ifndef IS_P2ALIGNED
-#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
-#endif
-
#ifndef ISP2
#define ISP2(x) rte_is_power_of_2(x)
#endif
volatile uint32_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_dword_t))); \
\
_addr = (volatile uint32_t *)(_base + (_offset)); \
(_edp)->ed_u32[0] = _addr[0]; \
volatile uint64_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_qword_t))); \
\
_addr = (volatile uint64_t *)(_base + (_offset)); \
(_eqp)->eq_u64[0] = _addr[0]; \
volatile __m128i *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_oword_t))); \
\
_addr = (volatile __m128i *)(_base + (_offset)); \
(_eop)->eo_u128[0] = _addr[0]; \
volatile uint32_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_dword_t))); \
\
EFSYS_PROBE2(mem_writed, unsigned int, (_offset), \
uint32_t, (_edp)->ed_u32[0]); \
volatile uint64_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_qword_t))); \
\
EFSYS_PROBE3(mem_writeq, unsigned int, (_offset), \
uint32_t, (_eqp)->eq_u32[1], \
volatile __m128i *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_oword_t))); \
\
\
EFSYS_PROBE5(mem_writeo, unsigned int, (_offset), \
volatile uint32_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_dword_t))); \
_NOTE(CONSTANTCONDITION); \
if (_lock) \
SFC_BAR_LOCK(_esbp); \
volatile uint64_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_qword_t))); \
\
SFC_BAR_LOCK(_esbp); \
\
volatile __m128i *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_oword_t))); \
\
_NOTE(CONSTANTCONDITION); \
if (_lock) \
volatile uint32_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_dword_t))); \
\
_NOTE(CONSTANTCONDITION); \
if (_lock) \
volatile uint64_t *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_qword_t))); \
\
SFC_BAR_LOCK(_esbp); \
\
volatile __m128i *_addr; \
\
_NOTE(CONSTANTCONDITION); \
- SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t))); \
+ SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \
+ sizeof(efx_oword_t))); \
\
_NOTE(CONSTANTCONDITION); \
if (_lock) \