|
AquilaOS documentation
How it works, and its code
|
Go to the source code of this file.
Data Structures | |
| struct | qnode |
| A queue's node, holding one entry. More... | |
| struct | queue |
| A queue. More... | |
Macros | |
| #define | QUEUE_TRACE 1 |
| #define | queue_for(n, q) |
| #define | QUEUE_NEW() |
Functions | |
| static struct queue * | queue_new (void) |
| Returns a new, empty queue from kmalloc(), or NULL if there was no memory for it. | |
| static struct qnode * | enqueue (struct queue *queue, void *value) |
| Adds an entry at the end of a queue. | |
| static struct qnode * | enqueue_head (struct queue *queue, void *value) |
| Adds an entry at the head of a queue, so that dequeue() returns it next. | |
| static void * | dequeue (struct queue *queue) |
| Takes the first entry off a queue, frees its node, and returns the entry, or NULL if the queue is empty. | |
| static void | queue_remove (struct queue *queue, void *value) |
| Removes the first node whose entry is value, if there's one. | |
| static void | queue_node_remove (struct queue *queue, struct qnode *node) |
| Removes a node from a queue, and frees it. | |
| #define queue_for | ( | n, | |
| q ) |
Definition at line 37 of file queue.h.
Referenced by hashmap_lookup(), hashmap_replace(), load_ramdisk(), lock_conflicts(), pgrp_orphaned(), pgrp_orphaned_hangup(), pid_is_group(), proc_pid_find(), proc_setpgid(), procfs_finddir(), procfs_kvmem(), procfs_mounts(), procfs_proc_maps(), procfs_proc_status(), procfs_proc_vmstats(), procfs_readdir(), queue_remove(), signal_pgrp_send(), signal_send(), signal_to(), socket_unix_connect(), sys_munmap(), sys_thread_exit(), sys_thread_join(), sys_waitpid(), tty_ioctl(), vm_space_find(), vm_space_fork(), and vm_space_insert().
| #define QUEUE_NEW | ( | ) |
|
inlinestatic |
Takes the first entry off a queue, frees its node, and returns the entry, or NULL if the queue is empty.
Definition at line 117 of file queue.h.
References queue::count, queue::head, kfree(), qnode::next, NULL, qnode::prev, queue::tail, and qnode::value.
Referenced by queue_remove().
Adds an entry at the end of a queue.
Returns its node, or NULL if there was no memory for it.
Definition at line 57 of file queue.h.
References queue::count, queue::flags, queue::head, kmalloc(), memset(), qnode::next, NULL, qnode::prev, printk(), QUEUE_TRACE, queue::tail, and qnode::value.
Adds an entry at the head of a queue, so that dequeue() returns it next.
Returns its node, or NULL if there was no memory for it.
Definition at line 92 of file queue.h.
References queue::count, enqueue_head(), queue::head, kmalloc(), memset(), qnode::next, NULL, qnode::prev, queue::tail, and qnode::value.
Referenced by enqueue_head().
|
inlinestatic |
Removes a node from a queue, and frees it.
Definition at line 167 of file queue.h.
References queue::count, queue::head, kfree(), qnode::next, qnode::prev, and queue::tail.
|
inlinestatic |
Removes the first node whose entry is value, if there's one.
Definition at line 140 of file queue.h.
References queue::count, dequeue(), kfree(), qnode::next, NULL, qnode::prev, queue_for, queue::tail, and qnode::value.