1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

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:
Jean-Sébastien Pédron 2023-02-08 18:55:29 +01:00
parent 1c6d8146fd
commit 5542309ec6
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC

View File

@ -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)
{