diff options
author | Con Kolivas <kernel@kolivas.org> | 2018-02-17 16:14:25 +1100 |
---|---|---|
committer | Con Kolivas <kernel@kolivas.org> | 2018-02-18 15:54:09 +1100 |
commit | 1a62481815118810b99167748a74f907358c6198 (patch) | |
tree | 8c7dc28d246b9c39868e6e6e4c1f682e97b45b31 /include/linux/skip_list.h | |
parent | d8a5b80568a9cb66810e75b182018e9edb68e8ff (diff) |
MultiQueue Skiplist Scheduler version 0.170.4.15-muqss-170
Diffstat (limited to 'include/linux/skip_list.h')
-rw-r--r-- | include/linux/skip_list.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/skip_list.h b/include/linux/skip_list.h new file mode 100644 index 000000000000..d4be84ba273b --- /dev/null +++ b/include/linux/skip_list.h @@ -0,0 +1,33 @@ +#ifndef _LINUX_SKIP_LISTS_H +#define _LINUX_SKIP_LISTS_H +typedef u64 keyType; +typedef void *valueType; + +typedef struct nodeStructure skiplist_node; + +struct nodeStructure { + int level; /* Levels in this structure */ + keyType key; + valueType value; + skiplist_node *next[8]; + skiplist_node *prev[8]; +}; + +typedef struct listStructure { + int entries; + int level; /* Maximum level of the list + (1 more than the number of levels in the list) */ + skiplist_node *header; /* pointer to header */ +} skiplist; + +void skiplist_init(skiplist_node *slnode); +skiplist *new_skiplist(skiplist_node *slnode); +void free_skiplist(skiplist *l); +void skiplist_node_init(skiplist_node *node); +void skiplist_insert(skiplist *l, skiplist_node *node, keyType key, valueType value, unsigned int randseed); +void skiplist_delete(skiplist *l, skiplist_node *node); + +static inline bool skiplist_node_empty(skiplist_node *node) { + return (!node->next[0]); +} +#endif /* _LINUX_SKIP_LISTS_H */ |