Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux More xarray declarations.



details:   https://anonhg.NetBSD.org/src/rev/e8ab9c950e34
branches:  trunk
changeset: 1028416:e8ab9c950e34
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:00:10 2021 +0000

description:
More xarray declarations.

diffstat:

 sys/external/bsd/drm2/include/linux/xarray.h |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r 75f6bbed1954 -r e8ab9c950e34 sys/external/bsd/drm2/include/linux/xarray.h
--- a/sys/external/bsd/drm2/include/linux/xarray.h      Sun Dec 19 11:00:03 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/xarray.h      Sun Dec 19 11:00:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xarray.h,v 1.4 2021/12/19 11:00:03 riastradh Exp $     */
+/*     $NetBSD: xarray.h,v 1.5 2021/12/19 11:00:10 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -29,11 +29,19 @@
 #ifndef        _LINUX_XARRAY_H_
 #define        _LINUX_XARRAY_H_
 
+#include <sys/radixtree.h>
+
 #include <linux/slab.h>
 
 struct xarray;
 struct xa_limit;
 
+struct xarray {
+       kmutex_t                xa_lock;
+       struct radix_tree       xa_tree;
+       gfp_t                   xa_gfp;
+};
+
 struct xa_limit {
        uint32_t        max;
        uint32_t        min;
@@ -56,13 +64,14 @@
 void   xa_init_flags(struct xarray *, gfp_t);
 void   xa_destroy(struct xarray *);
 
+void * xa_load(struct xarray *, unsigned long);
+void * xa_store(struct xarray *, unsigned long, void *, gfp_t);
+void * xa_erase(struct xarray *, unsigned long);
+
 int    xa_alloc(struct xarray *, uint32_t *, void *, struct xa_limit, gfp_t);
-void * xa_load(struct xarray *, unsigned long);
 void * xa_find(struct xarray *, unsigned long *, unsigned long, unsigned);
 void * xa_find_after(struct xarray *, unsigned long *, unsigned long,
            unsigned);
-void   xa_store(struct xarray *, unsigned long, void *, gfp_t);
-void * xa_erase(struct xarray *, unsigned long);
 
 extern const struct xa_limit xa_limit_32b;
 



Home | Main Index | Thread Index | Old Index