From 4375fa312e91ffeef0d34ab0594bda4a8c9189ea Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 19 Apr 2019 15:56:00 -0700 Subject: svm: fifo ooo reads/writes with multiple chunks Change-Id: If23a04623a7138c9f6c98ee9ecfa587396618a60 Signed-off-by: Florin Coras --- src/vppinfra/rbtree.c | 20 +------------------- src/vppinfra/rbtree.h | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/vppinfra') diff --git a/src/vppinfra/rbtree.c b/src/vppinfra/rbtree.c index 3770c2304ff..95e9d10967b 100644 --- a/src/vppinfra/rbtree.c +++ b/src/vppinfra/rbtree.c @@ -20,24 +20,6 @@ #include -static inline rb_node_t * -rb_node_right (rb_tree_t * rt, rb_node_t * n) -{ - return pool_elt_at_index (rt->nodes, n->right); -} - -static inline rb_node_t * -rb_node_left (rb_tree_t * rt, rb_node_t * n) -{ - return pool_elt_at_index (rt->nodes, n->left); -} - -static inline rb_node_t * -rb_node_parent (rb_tree_t * rt, rb_node_t * n) -{ - return pool_elt_at_index (rt->nodes, n->parent); -} - static inline void rb_tree_rotate_left (rb_tree_t * rt, rb_node_t * x) { @@ -188,7 +170,7 @@ rb_tree_add (rb_tree_t * rt, u32 key) } rb_node_index_t -rb_tree_add2 (rb_tree_t * rt, u32 key, u32 opaque) +rb_tree_add2 (rb_tree_t * rt, u32 key, uword opaque) { rb_node_t *n; diff --git a/src/vppinfra/rbtree.h b/src/vppinfra/rbtree.h index 73180d1d54c..79437cdd719 100644 --- a/src/vppinfra/rbtree.h +++ b/src/vppinfra/rbtree.h @@ -36,7 +36,7 @@ typedef struct rb_node_ rb_node_index_t left; /**< left child index */ rb_node_index_t right; /**< right child index */ u32 key; /**< node key */ - u32 opaque; /**< value stored by node */ + uword opaque; /**< value stored by node */ } rb_node_t; typedef struct rb_tree_ @@ -47,7 +47,7 @@ typedef struct rb_tree_ void rb_tree_init (rb_tree_t * rt); rb_node_index_t rb_tree_add (rb_tree_t * rt, u32 key); -rb_node_index_t rb_tree_add2 (rb_tree_t * rt, u32 key, u32 opaque); +rb_node_index_t rb_tree_add2 (rb_tree_t * rt, u32 key, uword opaque); void rb_tree_del (rb_tree_t * rt, u32 key); void rb_tree_free_nodes (rb_tree_t * rt); u32 rb_tree_n_nodes (rb_tree_t * rt); @@ -75,6 +75,24 @@ rb_node (rb_tree_t * rt, rb_node_index_t ri) return pool_elt_at_index (rt->nodes, ri); } +static inline rb_node_t * +rb_node_right (rb_tree_t * rt, rb_node_t * n) +{ + return pool_elt_at_index (rt->nodes, n->right); +} + +static inline rb_node_t * +rb_node_left (rb_tree_t * rt, rb_node_t * n) +{ + return pool_elt_at_index (rt->nodes, n->left); +} + +static inline rb_node_t * +rb_node_parent (rb_tree_t * rt, rb_node_t * n) +{ + return pool_elt_at_index (rt->nodes, n->parent); +} + #endif /* SRC_VPPINFRA_RBTREE_H_ */ /* -- cgit 1.2.3-korg