diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/queue.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kern/queue.h b/kern/queue.h index f0b4002..0080e78 100644 --- a/kern/queue.h +++ b/kern/queue.h @@ -321,6 +321,21 @@ void insque(queue_entry_t, queue_entry_t); } /* + * Macro: queue_replace + */ +#define queue_replace(head, to, from, type, field) \ + { \ + if ((head) == (from)->field.prev) \ + (head)->next = (to); \ + else \ + ((type)((from)->field.prev))->field.next = (to); \ + if ((head) == (from)->field.next) \ + (head)->prev = (to); \ + else \ + ((type)((from)->field.next))->field.prev = (to); \ +} + +/* * Macro: queue_assign */ #define queue_assign(to, from, type, field) \ |