diff options
Diffstat (limited to 'kern/list.h')
-rw-r--r-- | kern/list.h | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kern/list.h b/kern/list.h index f48d7d7e..7ea39923 100644 --- a/kern/list.h +++ b/kern/list.h @@ -25,8 +25,8 @@ #include <stddef.h> #include <kern/list_types.h> -#include <kern/llsync.h> #include <kern/macros.h> +#include <kern/rcu.h> /* * Structure used as both head and node. @@ -385,18 +385,18 @@ for (entry = list_last_entry(list, typeof(*entry), member), \ * Return the first node of a list. */ static inline struct list * -list_llsync_first(const struct list *list) +list_rcu_first(const struct list *list) { - return llsync_load_ptr(list->next); + return rcu_load_ptr(list->next); } /* * Return the node next to the given node. */ static inline struct list * -list_llsync_next(const struct list *node) +list_rcu_next(const struct list *node) { - return llsync_load_ptr(node->next); + return rcu_load_ptr(node->next); } /* @@ -405,11 +405,11 @@ list_llsync_next(const struct list *node) * This function is private. */ static inline void -list_llsync_add(struct list *prev, struct list *next, struct list *node) +list_rcu_add(struct list *prev, struct list *next, struct list *node) { node->next = next; node->prev = prev; - llsync_store_ptr(prev->next, node); + rcu_store_ptr(prev->next, node); next->prev = node; } @@ -417,36 +417,36 @@ list_llsync_add(struct list *prev, struct list *next, struct list *node) * Insert a node at the head of a list. */ static inline void -list_llsync_insert_head(struct list *list, struct list *node) +list_rcu_insert_head(struct list *list, struct list *node) { - list_llsync_add(list, list->next, node); + list_rcu_add(list, list->next, node); } /* * Insert a node at the tail of a list. */ static inline void -list_llsync_insert_tail(struct list *list, struct list *node) +list_rcu_insert_tail(struct list *list, struct list *node) { - list_llsync_add(list->prev, list, node); + list_rcu_add(list->prev, list, node); } /* * Insert a node before another node. */ static inline void -list_llsync_insert_before(struct list *next, struct list *node) +list_rcu_insert_before(struct list *next, struct list *node) { - list_llsync_add(next->prev, next, node); + list_rcu_add(next->prev, next, node); } /* * Insert a node after another node. */ static inline void -list_llsync_insert_after(struct list *prev, struct list *node) +list_rcu_insert_after(struct list *prev, struct list *node) { - list_llsync_add(prev, prev->next, node); + list_rcu_add(prev, prev->next, node); } /* @@ -455,18 +455,18 @@ list_llsync_insert_after(struct list *prev, struct list *node) * After completion, the node is stale. */ static inline void -list_llsync_remove(struct list *node) +list_rcu_remove(struct list *node) { node->next->prev = node->prev; - llsync_store_ptr(node->prev->next, node->next); + rcu_store_ptr(node->prev->next, node->next); } /* * Macro that evaluates to the address of the structure containing the * given node based on the given type and member. */ -#define list_llsync_entry(node, type, member) \ - structof(llsync_load_ptr(node), type, member) +#define list_rcu_entry(node, type, member) \ + structof(rcu_load_ptr(node), type, member) /* * Get the first entry of a list. @@ -475,13 +475,13 @@ list_llsync_remove(struct list *node) * the node pointer can only be read once, preventing the combination * of lockless list_empty()/list_first_entry() variants. */ -#define list_llsync_first_entry(list, type, member) \ +#define list_rcu_first_entry(list, type, member) \ MACRO_BEGIN \ struct list *___list; \ struct list *___first; \ \ ___list = (list); \ - ___first = list_llsync_first(___list); \ + ___first = list_rcu_first(___list); \ list_end(___list, ___first) \ ? NULL \ : list_entry(___first, type, member); \ @@ -494,29 +494,29 @@ MACRO_END * the node pointer can only be read once, preventing the combination * of lockless list_empty()/list_next_entry() variants. */ -#define list_llsync_next_entry(entry, member) \ - list_llsync_first_entry(&entry->member, typeof(*entry), member) +#define list_rcu_next_entry(entry, member) \ + list_rcu_first_entry(&entry->member, typeof(*entry), member) /* * Forge a loop to process all nodes of a list. * * The node must not be altered during the loop. */ -#define list_llsync_for_each(list, node) \ -for (node = list_llsync_first(list); \ +#define list_rcu_for_each(list, node) \ +for (node = list_rcu_first(list); \ !list_end(list, node); \ - node = list_llsync_next(node)) + node = list_rcu_next(node)) /* * Forge a loop to process all entries of a list. * * The entry node must not be altered during the loop. */ -#define list_llsync_for_each_entry(list, entry, member) \ -for (entry = list_llsync_entry(list_first(list), \ +#define list_rcu_for_each_entry(list, entry, member) \ +for (entry = list_rcu_entry(list_first(list), \ typeof(*entry), member); \ !list_end(list, &entry->member); \ - entry = list_llsync_entry(list_next(&entry->member), \ + entry = list_rcu_entry(list_next(&entry->member), \ typeof(*entry), member)) #endif /* _KERN_LIST_H */ |