add DEFINE_XARRAY_ALLOC for 6.6.53 drm
authorjsg <jsg@openbsd.org>
Tue, 1 Oct 2024 06:19:39 +0000 (06:19 +0000)
committerjsg <jsg@openbsd.org>
Tue, 1 Oct 2024 06:19:39 +0000 (06:19 +0000)
sys/dev/pci/drm/include/linux/xarray.h

index fd64305..a48a295 100644 (file)
@@ -29,6 +29,13 @@ struct xarray {
        SPLAY_HEAD(xarray_tree, xarray_entry) xa_tree;
 };
 
+#define DEFINE_XARRAY_ALLOC(name)                              \
+       struct xarray name = {                                  \
+               .xa_flags = XA_FLAGS_ALLOC,                     \
+               .xa_lock = MUTEX_INITIALIZER(IPL_NONE),         \
+               .xa_tree = SPLAY_INITIALIZER(&name.xa_tree)     \
+       }
+
 struct xarray_range {
        uint32_t start;
        uint32_t end;