-#define ice_memdup(a, b, c, d) rte_memcpy(ice_malloc(a, c), b, c)
-
-#define CPU_TO_BE16(o) rte_cpu_to_be_16(o)
-#define CPU_TO_BE32(o) rte_cpu_to_be_32(o)
-#define CPU_TO_BE64(o) rte_cpu_to_be_64(o)
-#define CPU_TO_LE16(o) rte_cpu_to_le_16(o)
-#define CPU_TO_LE32(s) rte_cpu_to_le_32(s)
-#define CPU_TO_LE64(h) rte_cpu_to_le_64(h)
-#define LE16_TO_CPU(a) rte_le_to_cpu_16(a)
-#define LE32_TO_CPU(c) rte_le_to_cpu_32(c)
-#define LE64_TO_CPU(k) rte_le_to_cpu_64(k)
-
-#define NTOHS(a) rte_be_to_cpu_16(a)
-#define NTOHL(a) rte_be_to_cpu_32(a)
-#define HTONS(a) rte_cpu_to_be_16(a)
-#define HTONL(a) rte_cpu_to_be_32(a)
-
-static inline void
-ice_set_bit(unsigned int nr, volatile ice_bitmap_t *addr)
-{
- __sync_fetch_and_or(addr, (1UL << nr));
-}
-
-static inline void
-ice_clear_bit(unsigned int nr, volatile ice_bitmap_t *addr)
-{
- __sync_fetch_and_and(addr, (0UL << nr));
-}
-
-static inline void
-ice_zero_bitmap(ice_bitmap_t *bmp, u16 size)
-{
- unsigned long mask;
- u16 i;
-
- for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
- bmp[i] = 0;
- mask = BITS_CHUNK_MASK(size);
- bmp[i] &= ~mask;
-}
-
-static inline void
-ice_or_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1,
- const ice_bitmap_t *bmp2, u16 size)
-{
- unsigned long mask;
- u16 i;
-
- /* Handle all but last chunk*/
- for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
- dst[i] = bmp1[i] | bmp2[i];
-
- /* We want to only OR bits within the size. Furthermore, we also do
- * not want to modify destination bits which are beyond the specified
- * size. Use a bitmask to ensure that we only modify the bits that are
- * within the specified size.
- */
- mask = BITS_CHUNK_MASK(size);
- dst[i] &= ~mask;
- dst[i] |= (bmp1[i] | bmp2[i]) & mask;
-}
-
-static inline void ice_cp_bitmap(ice_bitmap_t *dst, ice_bitmap_t *src, u16 size)
-{
- ice_bitmap_t mask;
- u16 i;
-
- /* Handle all but last chunk*/
- for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
- dst[i] = src[i];
-
- /* We want to only copy bits within the size.*/
- mask = BITS_CHUNK_MASK(size);
- dst[i] &= ~mask;
- dst[i] |= src[i] & mask;
-}
-
-static inline bool
-ice_cmp_bitmap(ice_bitmap_t *bmp1, ice_bitmap_t *bmp2, u16 size)
-{
- ice_bitmap_t mask;
- u16 i;
-
- /* Handle all but last chunk*/
- for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
- if (bmp1[i] != bmp2[i])
- return false;
-
- /* We want to only compare bits within the size.*/
- mask = BITS_CHUNK_MASK(size);
- if ((bmp1[i] & mask) != (bmp2[i] & mask))
- return false;
-
- return true;
-}