MOS Source Code
|
A circular, doubly-linked list. More...
Classes | |
struct | list_node_t |
A node in a linked list. More... | |
Macros | |
#define | as_linked_list list_node_t list_node |
Embed a list node into a struct. | |
#define | LIST_HEAD_INIT(container) |
#define | LIST_NODE_INIT(container) |
#define | list_entry(node, type) |
Get the container struct of a list node. | |
#define | list_prev_entry(item, type) |
Get the next element in a list. | |
#define | list_next_entry(item, type) |
Get the next element in a list. | |
#define | list_node_next_entry(node, type) |
Get the next list node. | |
#define | list_node(element) |
Get the ‘list_node’ of a list element. This is exactly the reverse of ‘list_entry’ above. | |
#define | list_prepend(element, item) |
#define | list_append(element, item) |
#define | list_insert_before(element, item) |
#define | list_insert_after(element, item) |
#define | list_remove(element) |
#define | list_foreach(t, v, h) |
Iterate over a list. | |
#define | list_foreach_reverse(t, v, h) |
#define | list_node_foreach(v, h) |
#define | list_node_foreach_reverse(v, h) |
#define | list_headless_foreach(t, v, h) |
#define | list_headless_foreach_reverse(t, v, h) |
Typedefs | |
typedef list_node_t | list_head |
A linked list head. | |
Functions | |
MOSAPI void | linked_list_init (list_node_t *head_node) |
Initialise a circular double linked list. | |
MOSAPI bool | list_is_empty (const list_node_t *head) |
MOSAPI void | list_node_remove (list_node_t *link) |
MOSAPI list_node_t * | list_node_pop (list_node_t *head) |
MOSAPI void | list_node_prepend (list_node_t *head, list_node_t *item) |
MOSAPI void | list_node_append (list_node_t *head, list_node_t *item) |
MOSAPI void | list_node_insert_before (list_node_t *element, list_node_t *item) |
MOSAPI void | list_node_insert_after (list_node_t *element, list_node_t *item) |
A circular, doubly-linked list.
#define as_linked_list list_node_t list_node |
#define LIST_HEAD_INIT | ( | container | ) |
Definition at line 38 of file list.h.
Referenced by MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), and MOS_TEST_CASE().
#define LIST_NODE_INIT | ( | container | ) |
Definition at line 41 of file list.h.
Referenced by MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), and timer_msleep().
#define list_entry | ( | node, | |
type ) |
Get the container struct of a list node.
Definition at line 46 of file list.h.
Referenced by break_the_order(), buddy_alloc_n_exact(), MOS_TEST_CASE(), naive_sched_select_next(), and waitlist_wake().
#define list_prev_entry | ( | item, | |
type ) |
Get the next element in a list.
#define list_next_entry | ( | item, | |
type ) |
Get the next element in a list.
Definition at line 56 of file list.h.
Referenced by MOS_TEST_CASE().
#define list_node_next_entry | ( | node, | |
type ) |
Get the next list node.
Definition at line 62 of file list.h.
Referenced by ipc_server_accept().
#define list_node | ( | element | ) |
Get the ‘list_node’ of a list element. This is exactly the reverse of ‘list_entry’ above.
Definition at line 68 of file list.h.
Referenced by add_to_freelist(), break_the_order(), break_this_pfn(), buddy_free_n(), clocksource_register(), console_register(), dentry_mount(), dentry_unmount(), dirter_add(), do_attach_vmap(), futex_wait(), ipc_connect_to_server(), ipc_server_create(), MOS_TEST_CASE(), naive_sched_add_thread(), pmm_free_frames(), populate_freelist(), power_register_shutdown_callback(), process_do_fork(), process_exit(), serial_console_setup(), signal_send_to_thread(), slab_init_one(), sysfs_register(), sysfs_register_file(), thread_allocate(), timer_msleep(), try_merge(), userfs_manager_register_filesystem(), vfs_register_filesystem(), vmap_create(), and vmap_split().
#define list_prepend | ( | element, | |
item ) |
#define list_append | ( | element, | |
item ) |
Definition at line 71 of file list.h.
Referenced by MOS_TEST_CASE().
#define list_insert_before | ( | element, | |
item ) |
Definition at line 72 of file list.h.
Referenced by do_attach_vmap().
#define list_insert_after | ( | element, | |
item ) |
#define list_remove | ( | element | ) |
Definition at line 74 of file list.h.
Referenced by break_the_order(), break_this_pfn(), dentry_try_release(), extract_exact_range(), ipc_server_accept(), ipc_server_close(), naive_sched_remove_thread(), naive_sched_select_next(), power_shutdown(), process_exit(), process_wait_for_pid(), signal_get_next_pending(), timer_msleep(), timer_tick(), try_merge(), vfs_io_ops_close_dir(), vmap_destroy(), and waitlist_remove_me().
#define list_foreach | ( | t, | |
v, | |||
h ) |
Iterate over a list.
t | Type of the list elements (e.g. ‘struct foo’) |
v | Name of the variable to use for the current element (e.g. ‘item’) |
h | List Head (e.g. ‘consoles’) |
Definition at line 83 of file list.h.
Referenced by console_get(), console_get_by_prefix(), console_putc(), do_attach_vmap(), dump_list(), extract_exact_range(), futex_wait(), futex_wake(), interrupt_entry(), ipc_connect_to_server(), ipc_dump_name_waitlist(), ipc_get_server(), ipc_server_close(), ipc_server_create(), ipc_sysfs_list_ipcs(), ipc_sysfs_lookup_ipc(), ipc_sysfs_servers(), lvprintk(), mm_get_free_vaddr_locked(), mm_get_is_mapped_locked(), mmstat_sysfs_vmaps_show(), MOS_TEST_CASE(), MOS_TEST_CASE(), naive_sched_remove_thread(), power_shutdown(), process_destroy(), process_do_execveat(), process_do_fork(), process_dump_mmaps(), process_exit(), process_sysfs_process_stat(), process_sysfs_vmap_stat(), process_wait_for_pid(), signal_get_next_pending(), signal_has_pending(), signal_send_to_process(), signal_send_to_thread(), slab_sysfs_slabinfo(), timer_tick(), vfs_find_filesystem(), vfs_io_ops_close_dir(), vfs_list_dir(), vfs_sysfs_filesystems(), vfs_sysfs_mountpoints(), vmap_obtain(), and waitlist_remove_me().
#define list_foreach_reverse | ( | t, | |
v, | |||
h ) |
#define list_node_foreach | ( | v, | |
h ) |
Definition at line 89 of file list.h.
Referenced by sysfs_iops_create(), sysfs_iops_iterate_dir(), and sysfs_iops_lookup().
#define list_node_foreach_reverse | ( | v, | |
h ) |
#define list_headless_foreach | ( | t, | |
v, | |||
h ) |
Definition at line 92 of file list.h.
Referenced by MOS_TEST_CASE().
#define list_headless_foreach_reverse | ( | t, | |
v, | |||
h ) |
Definition at line 96 of file list.h.
Referenced by MOS_TEST_CASE().
typedef list_node_t list_head |
Initialise a circular double linked list.
node | The list head node (and thus, the only element in the newly created list) |
Definition at line 15 of file list.c.
Referenced by break_the_order(), break_this_pfn(), buddy_init(), dentry_mount(), dirter_add(), ipc_connect_to_server(), ipc_server_create(), mm_create_context(), mos_start_kernel(), naive_sched_add_thread(), naive_sched_init(), pmm_free_frames(), populate_freelist(), power_register_shutdown_callback(), process_allocate(), process_do_fork(), process_exit(), serial_console_setup(), signal_send_to_thread(), slab_init_one(), sysfs_register(), sysfs_register_file(), thread_allocate(), tree_add_child(), tree_node_init(), try_merge(), userfs_manager_register_filesystem(), vfs_list_dir(), vmap_create(), vmap_split(), and waitlist_init().
Definition at line 21 of file list.c.
Referenced by add_to_freelist(), break_the_order(), buddy_alloc_n_exact(), buddy_free_n(), console_get(), dentry_try_release(), do_attach_vmap(), extract_exact_range(), ipc_server_accept(), ipc_server_close(), mm_destroy_context(), MOS_TEST_CASE(), naive_sched_select_next(), process_wait_for_pid(), sysfs_iops_create(), sysfs_iops_iterate_dir(), sysfs_iops_lookup(), timer_msleep(), tree_add_child(), vfs_register_filesystem(), and waitlist_wake().
Definition at line 26 of file list.c.
Referenced by dentry_unmount(), list_node_pop(), MOS_TEST_CASE(), and MOS_TEST_CASE().
MOSAPI list_node_t * list_node_pop | ( | list_node_t * | head | ) |
Definition at line 56 of file list.c.
Referenced by waitlist_wake().
Definition at line 63 of file list.c.
Referenced by MOS_TEST_CASE(), and process_do_fork().
Definition at line 68 of file list.c.
Referenced by clocksource_register(), console_register(), dentry_mount(), dirter_add(), do_attach_vmap(), futex_wait(), interrupt_handler_register(), ipc_connect_to_server(), ipc_server_create(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), MOS_TEST_CASE(), naive_sched_add_thread(), power_register_shutdown_callback(), process_allocate(), process_exit(), signal_send_to_thread(), slab_init_one(), sysfs_register(), sysfs_register_file(), thread_allocate(), timer_msleep(), tree_add_child(), vfs_register_filesystem(), and waitlist_append().
Definition at line 74 of file list.c.
Referenced by add_to_freelist(), and MOS_TEST_CASE().
Definition at line 79 of file list.c.
Referenced by MOS_TEST_CASE().