summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/include/linux
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2020-10-16 09:20:04 +0000
committerjsg <jsg@openbsd.org>2020-10-16 09:20:04 +0000
commitcfaa6efe52731784c0e5db80d9c1939a3fd93a0a (patch)
treec69bc81a249590954b81f4f8858453b0c4693084 /sys/dev/pci/drm/include/linux
parentxe(4) and mtd(4) are from a long gone era (diff)
downloadwireguard-openbsd-cfaa6efe52731784c0e5db80d9c1939a3fd93a0a.tar.xz
wireguard-openbsd-cfaa6efe52731784c0e5db80d9c1939a3fd93a0a.zip
implement linux interval tree functions
Adapt kettenis' amdgpu interval tree replacement functions for the interval_tree.h functions radeondrm uses on cayman, aruba and GCN.
Diffstat (limited to 'sys/dev/pci/drm/include/linux')
-rw-r--r--sys/dev/pci/drm/include/linux/interval_tree.h19
-rw-r--r--sys/dev/pci/drm/include/linux/rbtree.h36
2 files changed, 19 insertions, 36 deletions
diff --git a/sys/dev/pci/drm/include/linux/interval_tree.h b/sys/dev/pci/drm/include/linux/interval_tree.h
index e69de29bb2d..75f7a3799bd 100644
--- a/sys/dev/pci/drm/include/linux/interval_tree.h
+++ b/sys/dev/pci/drm/include/linux/interval_tree.h
@@ -0,0 +1,19 @@
+/* Public domain. */
+
+#ifndef _LINUX_INTERVAL_TREE_H
+#define _LINUX_INTERVAL_TREE_H
+
+#include <linux/rbtree.h>
+
+struct interval_tree_node {
+ struct rb_node rb;
+ unsigned long start;
+ unsigned long last;
+};
+
+struct interval_tree_node *interval_tree_iter_first(struct rb_root_cached *,
+ unsigned long, unsigned long);
+void interval_tree_insert(struct interval_tree_node *, struct rb_root_cached *);
+void interval_tree_remove(struct interval_tree_node *, struct rb_root_cached *);
+
+#endif
diff --git a/sys/dev/pci/drm/include/linux/rbtree.h b/sys/dev/pci/drm/include/linux/rbtree.h
index fe45a4eeeb1..875ce42f2cd 100644
--- a/sys/dev/pci/drm/include/linux/rbtree.h
+++ b/sys/dev/pci/drm/include/linux/rbtree.h
@@ -29,10 +29,6 @@
#ifndef _LINUX_RBTREE_H_
#define _LINUX_RBTREE_H_
-/* for printf */
-#include <sys/types.h>
-#include <sys/systm.h>
-
#include <sys/tree.h>
struct rb_node {
@@ -163,36 +159,4 @@ rb_replace_node(struct rb_node *victim, struct rb_node *new,
#define RB_ROOT_CACHED (struct rb_root_cached) { { NULL } }
#endif
-struct interval_tree_node {
- struct rb_node rb;
- unsigned long start;
- unsigned long last;
-};
-
-static inline struct interval_tree_node *
-interval_tree_iter_first(struct rb_root_cached *root,
- unsigned long start, unsigned long last)
-{
-#ifdef DRMDEBUG
- printf("%s: stub start: 0x%lx last: 0x%lx\n", __func__, start, last);
-#endif
- return NULL;
-}
-
-static inline void
-interval_tree_insert(struct interval_tree_node *node, struct rb_root_cached *root)
-{
-#ifdef DRMDEBUG
- printf("%s: stub start: 0x%lx last: 0x%lx\n", __func__, node->start, node->last);
-#endif
-}
-
-static inline void
-interval_tree_remove(struct interval_tree_node *node, struct rb_root_cached *root)
-{
-#ifdef DRMDEBUG
- printf("%s: stub start: 0x%lx last: 0x%lx\n", __func__, node->start, node->last);
-#endif
-}
-
#endif /* _LINUX_RBTREE_H_ */