linuxkpi: Define xa_is_err()
, xa_{store,erase}_irq()
and xa_{,un}lock_irq*()
`xa_is_err()` is synonymous to `IS_ERR()`. Other introduced functions call their equivalent without the `irq*` suffix. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38534
This commit is contained in:
parent
1c6d8146fd
commit
5542309ec6
@ -45,6 +45,9 @@
|
||||
#define XA_ERROR(x) \
|
||||
ERR_PTR(x)
|
||||
|
||||
#define xa_is_err(x) \
|
||||
IS_ERR(x)
|
||||
|
||||
#define xa_limit_32b XA_LIMIT(0, 0xFFFFFFFF)
|
||||
|
||||
#define XA_ASSERT_LOCKED(xa) mtx_assert(&(xa)->mtx, MA_OWNED)
|
||||
@ -87,6 +90,24 @@ void *__xa_store(struct xarray *, uint32_t, void *, gfp_t);
|
||||
bool __xa_empty(struct xarray *);
|
||||
void *__xa_next(struct xarray *, unsigned long *, bool);
|
||||
|
||||
#define xa_store_irq(xa, index, ptr, gfp) \
|
||||
xa_store((xa), (index), (ptr), (gfp))
|
||||
|
||||
#define xa_erase_irq(xa, index) \
|
||||
xa_erase((xa), (index))
|
||||
|
||||
#define xa_lock_irqsave(xa, flags) \
|
||||
do { \
|
||||
xa_lock((xa)); \
|
||||
flags = 0; \
|
||||
} while (0)
|
||||
|
||||
#define xa_unlock_irqrestore(xa, flags) \
|
||||
do { \
|
||||
xa_unlock((xa)); \
|
||||
flags == 0; \
|
||||
} while (0)
|
||||
|
||||
static inline int
|
||||
xa_err(void *ptr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user