accel/amdxdna: use modern PM helpers
[drm/drm-misc.git] / kernel / bpf / range_tree.h
blobff0b9110eb715b9198dc564be0f2f72249894e1e
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
3 #ifndef _RANGE_TREE_H
4 #define _RANGE_TREE_H 1
6 struct range_tree {
7 /* root of interval tree */
8 struct rb_root_cached it_root;
9 /* root of rbtree of interval sizes */
10 struct rb_root_cached range_size_root;
13 void range_tree_init(struct range_tree *rt);
14 void range_tree_destroy(struct range_tree *rt);
16 int range_tree_clear(struct range_tree *rt, u32 start, u32 len);
17 int range_tree_set(struct range_tree *rt, u32 start, u32 len);
18 int is_range_tree_set(struct range_tree *rt, u32 start, u32 len);
19 s64 range_tree_find(struct range_tree *rt, u32 len);
21 #endif