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/linux Define idr_init_base.



details:   https://anonhg.NetBSD.org/src/rev/1e0d392900a0
branches:  trunk
changeset: 1027869:1e0d392900a0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:00:17 2021 +0000

description:
Define idr_init_base.

Nothing actually uses this at the moment, because callers already
specify the base.  Not really sure what the point is!

diffstat:

 sys/external/bsd/drm2/include/linux/idr.h |   5 ++++-
 sys/external/bsd/drm2/linux/linux_idr.c   |  13 +++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diffs (69 lines):

diff -r 56c26faf4ac5 -r 1e0d392900a0 sys/external/bsd/drm2/include/linux/idr.h
--- a/sys/external/bsd/drm2/include/linux/idr.h Sun Dec 19 01:00:09 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/idr.h Sun Dec 19 01:00:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: idr.h,v 1.7 2018/08/27 14:14:42 riastradh Exp $        */
+/*     $NetBSD: idr.h,v 1.8 2021/12/19 01:00:17 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@
 struct idr {
        kmutex_t        idr_lock;
        rb_tree_t       idr_tree;
+       int             idr_base;
 };
 
 /* XXX Make the nm output a little more greppable...  */
@@ -51,6 +52,7 @@
 #define        idr_for_each            linux_idr_for_each
 #define        idr_get_next            linux_idr_get_next
 #define        idr_init                linux_idr_init
+#define        idr_init_base           linux_idr_init_base
 #define        idr_is_empty            linux_idr_is_empty
 #define        idr_preload             linux_idr_preload
 #define        idr_preload_end         linux_idr_preload_end
@@ -61,6 +63,7 @@
 void   linux_idr_module_fini(void);
 
 void   idr_init(struct idr *);
+void   idr_init_base(struct idr *, int);
 void   idr_destroy(struct idr *);
 bool   idr_is_empty(struct idr *);
 void   *idr_find(struct idr *, int);
diff -r 56c26faf4ac5 -r 1e0d392900a0 sys/external/bsd/drm2/linux/linux_idr.c
--- a/sys/external/bsd/drm2/linux/linux_idr.c   Sun Dec 19 01:00:09 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_idr.c   Sun Dec 19 01:00:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_idr.c,v 1.12 2018/08/27 15:24:53 riastradh Exp $ */
+/*     $NetBSD: linux_idr.c,v 1.13 2021/12/19 01:00:17 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_idr.c,v 1.12 2018/08/27 15:24:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_idr.c,v 1.13 2021/12/19 01:00:17 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -173,8 +173,17 @@
 idr_init(struct idr *idr)
 {
 
+       idr_init_base(idr, 0);
+}
+
+void
+idr_init_base(struct idr *idr, int base)
+{
+
        mutex_init(&idr->idr_lock, MUTEX_DEFAULT, IPL_VM);
        rb_tree_init(&idr->idr_tree, &idr_rb_ops);
+       idr->idr_base = base;
+
        SDT_PROBE1(sdt, linux, idr, init,  idr);
 }
 



Home | Main Index | Thread Index | Old Index