]>
git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/dpdk/drivers/bus/dpaa/include/dpaa_bits.h
1 /* SPDX-License-Identifier: BSD-3-Clause
11 #define BITS_PER_ULONG (sizeof(unsigned long) << 3)
12 #define SHIFT_PER_ULONG (((1 << 5) == BITS_PER_ULONG) ? 5 : 6)
13 #define BITS_MASK(idx) (1UL << ((idx) & (BITS_PER_ULONG - 1)))
14 #define BITS_IDX(idx) ((idx) >> SHIFT_PER_ULONG)
16 static inline void dpaa_set_bits(unsigned long mask
,
17 volatile unsigned long *p
)
22 static inline void dpaa_set_bit(int idx
, volatile unsigned long *bits
)
24 dpaa_set_bits(BITS_MASK(idx
), bits
+ BITS_IDX(idx
));
27 static inline void dpaa_clear_bits(unsigned long mask
,
28 volatile unsigned long *p
)
33 static inline void dpaa_clear_bit(int idx
,
34 volatile unsigned long *bits
)
36 dpaa_clear_bits(BITS_MASK(idx
), bits
+ BITS_IDX(idx
));
39 #endif /* __DPAA_BITS_H */