iPXE
list.h File Reference

Linked lists. More...

#include <stddef.h>
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  list_head
 A doubly-linked list entry (or list head) More...

Macros

#define LIST_HEAD_INIT(list)
 Initialise a static list head.
#define LIST_HEAD(list)
 Declare a static list head.
#define INIT_LIST_HEAD(list)
 Initialise a list head.
#define list_check(list)
 Check a list entry or list head is valid.
#define list_add(new, head)
 Add a new entry to the head of a list.
#define list_add_tail(new, head)
 Add a new entry to the tail of a list.
#define list_del(list)
 Delete an entry from a list.
#define list_empty(list)
 Test whether a list is empty.
#define list_is_singular(list)
 Test whether a list has just one entry.
#define list_is_last(list, head)
 Test whether an entry is the last entry in list.
#define list_cut_position(new, list, entry)
 Cut a list into two.
#define list_splice(list, entry)
 Move all entries from one list into another list.
#define list_splice_tail(list, entry)
 Move all entries from one list into another list.
#define list_splice_init(list, entry)
 Move all entries from one list into another list and reinitialise empty list.
#define list_splice_tail_init(list, entry)
 Move all entries from one list into another list and reinitialise empty list.
#define list_entry(list, type, member)
 Get the container of a list entry.
#define list_first_entry(list, type, member)
 Get the container of the first entry in a list.
#define list_last_entry(list, type, member)
 Get the container of the last entry in a list.
#define list_next_entry(pos, head, member)
 Get the container of the next entry in a list.
#define list_prev_entry(pos, head, member)
 Get the container of the previous entry in a list.
#define list_is_first_entry(entry, head, member)
 Test if entry is first in a list.
#define list_is_last_entry(entry, head, member)
 Test if entry is last in a list.
#define list_is_head_entry(entry, head, member)
 Test if entry is the list head.
#define list_for_each(pos, head)
 Iterate over a list.
#define list_for_each_entry(pos, head, member)
 Iterate over entries in a list.
#define list_for_each_entry_reverse(pos, head, member)
 Iterate over entries in a list in reverse order.
#define list_for_each_entry_safe(pos, tmp, head, member)
 Iterate over entries in a list, safe against deletion of the current entry.
#define list_for_each_entry_continue(pos, head, member)
 Iterate over entries in a list, starting after current position.
#define list_for_each_entry_continue_reverse(pos, head, member)
 Iterate over entries in a list in reverse, starting after current position.
#define list_for_each_entry_safe_continue(pos, tmp, head, member)
 Iterate over subsequent entries in a list, safe against deletion.
#define list_contains(entry, head)
 Test if list contains a specified entry.
#define list_contains_entry(entry, head, member)
 Test if list contains a specified entry.
#define list_check_contains_entry(entry, head, member)
 Check list contains a specified entry.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static void inline_list_add (struct list_head *new, struct list_head *head)
void extern_list_add (struct list_head *new, struct list_head *head)
static void inline_list_add_tail (struct list_head *new, struct list_head *head)
void extern_list_add_tail (struct list_head *new, struct list_head *head)
static void inline_list_del (struct list_head *list)
void extern_list_del (struct list_head *list)
static int inline_list_empty (const struct list_head *list)
int extern_list_empty (const struct list_head *list)
static int inline_list_is_singular (const struct list_head *list)
int extern_list_is_singular (const struct list_head *list)
static int inline_list_is_last (const struct list_head *list, const struct list_head *head)
int extern_list_is_last (const struct list_head *list, const struct list_head *head)
static void inline_list_cut_position (struct list_head *new, struct list_head *list, struct list_head *entry)
void extern_list_cut_position (struct list_head *new, struct list_head *list, struct list_head *entry)
static void inline_list_splice (const struct list_head *list, struct list_head *entry)
void extern_list_splice (const struct list_head *list, struct list_head *entry)
static void inline_list_splice_tail (const struct list_head *list, struct list_head *entry)
void extern_list_splice_tail (const struct list_head *list, struct list_head *entry)
static void inline_list_splice_init (struct list_head *list, struct list_head *entry)
void extern_list_splice_init (struct list_head *list, struct list_head *entry)
static void inline_list_splice_tail_init (struct list_head *list, struct list_head *entry)
void extern_list_splice_tail_init (struct list_head *list, struct list_head *entry)
static int inline_list_contains (struct list_head *entry, struct list_head *head)
int extern_list_contains (struct list_head *entry, struct list_head *head)

Detailed Description

Linked lists.

This linked list handling code is based on the Linux kernel's list.h.

Definition in file list.h.

Macro Definition Documentation

◆ LIST_HEAD_INIT

#define LIST_HEAD_INIT ( list)
Value:
{ &(list), &(list) }

Initialise a static list head.

Parameters
listList head

Definition at line 31 of file list.h.

◆ LIST_HEAD

#define LIST_HEAD ( list)
Value:
struct list_head list = LIST_HEAD_INIT ( list )
#define LIST_HEAD_INIT(list)
Initialise a static list head.
Definition list.h:31
A doubly-linked list entry (or list head)
Definition list.h:19

Declare a static list head.

Parameters
listList head

Definition at line 38 of file list.h.

38#define LIST_HEAD( list ) \
39 struct list_head list = LIST_HEAD_INIT ( list )

◆ INIT_LIST_HEAD

#define INIT_LIST_HEAD ( list)
Value:
do { \
(list)->next = (list); \
(list)->prev = (list); \
} while ( 0 )
uint32_t next
Next descriptor address.
Definition dwmac.h:11

Initialise a list head.

Parameters
listList head

Definition at line 46 of file list.h.

46#define INIT_LIST_HEAD( list ) do { \
47 (list)->next = (list); \
48 (list)->prev = (list); \
49 } while ( 0 )

Referenced by acpi_init(), add_tls(), alloc_ibdev(), alloc_netdev(), alloc_sandev(), alloc_usb(), alloc_usb_bus(), alloc_usb_hub(), aoecmd_close(), ath5k_desc_alloc(), ath5k_txq_setup(), ath_descdma_cleanup(), ath_descdma_setup(), ath_draintxq(), ath_tx_processq(), ath_tx_start_dma(), ath_txq_setup(), cms_message(), create_dynui(), create_parameters(), dt_probe_node(), efi_pxe_install(), efi_snp_probe(), efi_usb_probe(), efidev_alloc(), ehci_probe(), eisabus_probe(), eoib_create(), fc_peer_close(), fc_peer_create(), fc_port_close(), fc_port_open(), fc_ulp_close(), fc_ulp_create(), fc_xchg_close(), fcpdev_open(), flexboot_nodnic_eth_open(), generic_settings_init(), ib_create_cq(), ib_create_mi(), ib_create_qp(), inline_list_splice_init(), inline_list_splice_tail_init(), iob_concatenate(), ipoib_probe(), ipv6_route_okx(), ipv6_table_del(), ipv6_table_okx(), isabus_probe(), isapnpbus_probe(), list_test_exec(), mcabus_probe(), mnpnet_start(), neighbour_create(), net80211_alloc(), net80211_probe_start(), netfront_probe(), nii_start(), open(), parse_net_args(), pci_read_config(), peerblk_dequeue(), peerblk_open(), peerblk_step(), peerdisc_create(), peermux_filter(), pool_del(), pool_expired(), probe_devices(), process_del(), process_init_stopped(), scsi_open(), settings_init(), sis190_init_phy(), sis190_mii_probe(), snpnet_start(), srp_open(), srpcmd_close(), t509bus_probe(), tcp_open(), tls_close(), tls_session(), uhci_probe(), undibus_probe(), unregister_usb_hub(), usb_endpoint_open(), usb_endpoint_reset(), usb_hotplug(), usb_probe_all(), usb_refill_init(), usbio_start(), virtnet_close(), virtnet_open_legacy(), virtnet_open_modern(), vmbus_poll(), vmbus_probe_channels(), x509_alloc_chain(), xcm_create(), xcm_list(), xenbus_probe_device(), and xsigo_ib_probe().

◆ list_check

#define list_check ( list)
Value:
( { \
assert ( (list) != NULL ); \
assert ( (list)->prev != NULL ); \
assert ( (list)->next != NULL ); \
assert ( (list)->next->prev == (list) ); \
assert ( (list)->prev->next == (list) ); \
} )
#define NULL
NULL pointer (VOID *)
Definition Base.h:322

Check a list entry or list head is valid.

Parameters
listList entry or head

Definition at line 56 of file list.h.

56#define list_check( list ) ( { \
57 assert ( (list) != NULL ); \
58 assert ( (list)->prev != NULL ); \
59 assert ( (list)->next != NULL ); \
60 assert ( (list)->next->prev == (list) ); \
61 assert ( (list)->prev->next == (list) ); \
62 } )

Referenced by check_blocks().

◆ list_add

#define list_add ( new,
head )
Value:
do { \
list_check ( (head) ); \
extern_list_add ( (new), (head) ); \
list_check ( (head) ); \
list_check ( (new) ); \
} while ( 0 )
uint8_t head
Head number.
Definition int13.h:23

Add a new entry to the head of a list.

Parameters
newNew entry to be added
headList head, or entry after which to add the new entry

Definition at line 70 of file list.h.

70#define list_add( new, head ) do { \
71 list_check ( (head) ); \
72 extern_list_add ( (new), (head) ); \
73 list_check ( (head) ); \
74 list_check ( (new) ); \
75 } while ( 0 )

Referenced by aoecmd_create(), atadev_command(), bofm_register(), certstore_add(), certstore_found(), cms_parse_participants(), efi_snp_probe(), efidev_alloc(), efipci_start(), eisabus_probe(), eoib_create_peer(), eoib_find_peer(), fc_ulp_attach(), fc_xchg_create(), fcpdev_scsi_command(), flexboot_nodnic_eth_open(), fragment_reassemble(), generic_settings_store(), heap_alloc_block(), ib_create_conn(), ib_create_madx(), ib_open(), imux_probe(), iphone_probe(), ipoib_find_remac(), ipoib_map_remac(), ipv6_add_miniroute(), isabus_probe(), isapnpbus_probe(), list_test_exec(), lkrn_exec(), mcabus_probe(), mnpnet_start(), neighbour_create(), neighbour_find(), netdev_open(), nii_map(), nii_start(), open(), parse_kv(), pcibridge_probe(), pcibus_probe(), ping_open(), probe_devices(), scsidev_command(), sis190_mii_probe(), snpnet_start(), srpdev_scsi_command(), start_ipv6conf(), start_timer_fixed(), t509bus_probe(), tcp_open(), tls_new_record(), tls_session(), udp_open_common(), undibus_probe(), usb_refill_limit(), usbio_start(), virtnet_refill_rx_virtqueue(), vmbus_register_pages(), vmbus_xfer_page_iobufs(), xcm_create(), and xve_create().

◆ list_add_tail

#define list_add_tail ( new,
head )
Value:
do { \
list_check ( (head) ); \
extern_list_add_tail ( (new), (head) ); \
list_check ( (head) ); \
list_check ( (new) ); \
} while ( 0 )

Add a new entry to the tail of a list.

Parameters
newNew entry to be added
headList head, or entry before which to add the new entry

Definition at line 94 of file list.h.

94#define list_add_tail( new, head ) do { \
95 list_check ( (head) ); \
96 extern_list_add_tail ( (new), (head) ); \
97 list_check ( (head) ); \
98 list_check ( (new) ); \
99 } while ( 0 )

Referenced by acpi_add(), add_dynui_item(), add_parameter(), add_tls(), alloc_sandev(), ath5k_desc_alloc(), ath5k_handle_rx(), ath5k_tx(), ath5k_tx_processq(), ath5k_txbuf_setup(), ath5k_txq_drainq(), ath_descdma_setup(), ath_rx_tasklet(), ath_tx_queue_tid(), ath_tx_return_buffer(), ath_tx_start_dma(), ath_txq_schedule(), create_dynui(), create_parameters(), dt_probe_node(), efi_block_install(), efi_pxe_install(), efi_pxe_udp_deliver(), efi_snp_poll(), efi_usb_install(), ehci_async_add(), ehci_endpoint_open(), ehci_periodic_add(), eoib_create(), eoib_duplicate(), fc_peer_create(), fc_port_open(), fc_ulp_create(), gpios_register(), heap_free_block(), ib_create_cq(), ib_create_qp(), ib_mcast_attach(), ipoib_probe(), ipv4_add_miniroute(), list_test_exec(), lkrn_exec(), lotest_rx(), neighbour_tx(), net80211_handle_mgmt(), net80211_probe_step(), net80211_register(), netdev_rx(), netdev_tx(), netdev_tx_defer(), netfront_poll_rx(), netfront_probe(), parse_net_args(), peerblk_enqueue(), peerdisc_create(), peerdisc_discovered(), peerdisc_open(), peermux_block_close(), peermux_filter(), peermux_step(), pool_add(), posix_file_xfer_deliver(), process_add(), pxe_udp_deliver(), register_ibdev(), register_image(), register_netdev(), register_sandev(), register_settings(), register_usb(), register_usb_bus(), register_usb_hub(), reprioritise_settings(), sanpath_close(), sanpath_open(), step(), tcp_rx_enqueue(), tcp_xfer_deliver(), tls_new_finished(), tls_newdata_process_data(), tls_newdata_process_header(), txnic_bgx_probe(), txnic_pf_probe(), uart_register(), uhci_async_add(), uhci_endpoint_open(), uhci_periodic_add(), undirom_probe(), usb_complete_err(), usb_control_complete(), usb_port_changed(), usb_prefill(), usb_probe_all(), usb_recycle(), usbblk_probe(), usbio_endpoint_open(), usbkbd_probe(), vmbus_probe_channels(), wpa_start(), x509_append(), xcm_list(), xenbus_probe_device(), and xsigo_ib_probe().

◆ list_del

#define list_del ( list)
Value:
do { \
list_check ( (list) ); \
inline_list_del ( (list) ); \
} while ( 0 )

Delete an entry from a list.

Parameters
listList entry

Note that list_empty() on entry does not return true after this; the entry is in an undefined state.

Definition at line 120 of file list.h.

120#define list_del( list ) do { \
121 list_check ( (list) ); \
122 inline_list_del ( (list) ); \
123 } while ( 0 )

Referenced by acpi_del(), aoecmd_close(), atacmd_free(), ath5k_handle_rx(), ath5k_tx(), ath5k_tx_processq(), ath5k_txq_drainq(), ath_draintxq(), ath_rx_tasklet(), ath_tx_get_buffer(), ath_tx_processq(), ath_txq_schedule(), bofm_unregister(), certstore_del(), certstore_found(), close(), cms_free(), destroy_dynui(), dt_probe_node(), dt_remove_node(), efi_block_describe(), efi_block_install(), efi_pxe_udp_close(), efi_pxe_udp_read(), efi_pxe_uninstall(), efi_snp_flush(), efi_snp_probe(), efi_snp_receive(), efi_snp_remove(), efi_usb_install(), efi_usb_uninstall(), efidev_free(), efipci_start(), efipci_stop(), ehci_async_del(), ehci_endpoint_close(), ehci_periodic_del(), eisabus_probe(), eisabus_remove(), eoib_create(), eoib_destroy(), eoib_discard(), eoib_duplicate(), eoib_find_peer(), eoib_flush_peers(), fc_peer_close(), fc_port_close(), fc_ulp_close(), fc_ulp_detach(), fc_xchg_close(), fcpcmd_free(), flexboot_nodnic_eth_open(), fragment_expired(), fragment_reassemble(), free_parameters(), free_tls(), free_tls_session(), generic_settings_clear(), generic_settings_store(), gpios_unregister(), heap_alloc_block(), heap_free_block(), ib_close(), ib_create_cq(), ib_create_qp(), ib_destroy_conn(), ib_destroy_cq(), ib_destroy_madx(), ib_destroy_qp(), ib_mcast_attach(), ib_mcast_detach(), imux_probe(), imux_remove(), iob_concatenate(), iphone_probe(), iphone_remove(), ipoib_discard_remac(), ipoib_find_remac(), ipoib_flush_remac(), ipoib_map_remac(), ipoib_probe(), ipoib_remove(), ipv4_del_miniroute(), ipv6_add_miniroute(), ipv6_del_miniroute(), ipv6conf_done(), isabus_probe(), isabus_remove(), isapnpbus_probe(), isapnpbus_remove(), linux_args_cleanup(), list_test_exec(), lkrn_exec(), lotest_dequeue(), mcabus_probe(), mcabus_remove(), mnpnet_start(), mnpnet_stop(), neighbour_destroy(), neighbour_find(), neighbour_tx_queue(), net80211_free_wlanlist(), net80211_mgmt_dequeue(), net80211_probe_finish_best(), net80211_unregister(), net_discard(), netdev_close(), netdev_rx_dequeue(), netdev_tx_complete_err(), netdev_tx_defer(), netfront_discard(), netfront_probe(), netfront_remove(), netvsc_recv_data(), nii_map(), nii_pci_close(), nii_start(), nii_stop(), nii_unmap(), pcibridge_remove(), pcibus_probe(), pcibus_remove(), peerblk_dequeue(), peerblk_step(), peerdisc_close(), peerdisc_destroy(), peerdisc_free(), peermux_block_close(), peermux_step(), ping_close(), pool_del(), pool_expired(), posix_file_free(), probe_devices(), process_del(), pxe_udp_discard(), pxenv_udp_close(), pxenv_udp_read(), read(), register_ibdev(), register_netdev(), register_sandev(), register_usb(), register_usb_bus(), register_usb_hub(), remove_devices(), reprioritise_settings(), sanpath_close(), sanpath_open(), scsicmd_close(), snpnet_start(), snpnet_stop(), srpcmd_close(), step(), stop_timer(), t509bus_probe(), t509bus_remove(), tcp_close(), tcp_discard(), tcp_process_rx_queue(), tcp_process_tx_queue(), timer_expired(), tls_close(), tls_new_data(), tls_new_finished(), tls_newdata_process_data(), tls_newdata_process_header(), txnic_bgx_probe(), txnic_bgx_remove(), txnic_pf_probe(), txnic_pf_remove(), uart_unregister(), udp_close(), uhci_async_del(), uhci_endpoint_close(), uhci_periodic_del(), undibus_probe(), undibus_remove(), unregister_ibdev(), unregister_image(), unregister_netdev(), unregister_sandev(), unregister_settings(), unregister_usb(), unregister_usb_bus(), unregister_usb_hub(), usb_complete_err(), usb_control(), usb_endpoint_close(), usb_endpoint_reset(), usb_flush(), usb_hotplug(), usb_port_changed(), usb_probe_all(), usb_refill_limit(), usb_remove_all(), usbblk_remove(), usbio_endpoint_close(), usbio_endpoint_open(), usbio_start(), usbio_stop(), usbkbd_remove(), virtnet_process_rx_packets(), vlan_transmit(), vmbus_probe_channels(), vmbus_remove_channels(), vmbus_unregister_pages(), vmbus_xfer_page_iobufs(), wpa_stop(), x509_truncate(), xcm_destroy(), xcm_list(), xenbus_probe_device(), xenbus_remove_device(), xsigo_ib_remove(), xve_create(), and xve_destroy().

◆ list_empty

#define list_empty ( list)
Value:
( { \
list_check ( (list) ); \
inline_list_empty ( (list) ); } )

Test whether a list is empty.

Parameters
listList head

Definition at line 137 of file list.h.

137#define list_empty( list ) ( { \
138 list_check ( (list) ); \
139 inline_list_empty ( (list) ); } )

Referenced by aoecmd_close(), aoecmd_free(), ath5k_handle_rx(), ath5k_tx(), ath5k_tx_processq(), ath_draintxq(), ath_get_next_rx_buf(), ath_startrecv(), ath_tx_get_buffer(), ath_tx_processq(), ath_tx_txqaddbuf(), ath_txq_schedule(), cms_test_exec(), dt_probe_children(), dt_remove_children(), efi_cacert_shutdown(), efi_pxe_udp_read(), efi_usb_probe(), efi_usb_remove(), efidev_free(), ehci_bus_close(), ehci_bus_open(), ehci_remove(), fc_peer_close(), fc_ulp_close(), fc_ulp_detach(), fc_ulp_logout(), fc_xchg_close(), fc_xchg_free(), free_tls(), free_tls_session(), free_usb(), free_usb_bus(), free_usb_hub(), generic_settings_clear(), have_netdevs(), have_sandevs(), ib_destroy_cq(), ib_destroy_qp(), inline_list_is_singular(), inline_list_splice(), inline_list_splice_tail(), ipv6_table_okx(), iwlist(), list_test_exec(), neighbour_free(), net80211_mgmt_dequeue(), net80211_probe_step(), netdev_tx_flush(), open(), peerblk_dequeue(), peerblk_enqueue(), peerblk_open(), peerdisc_close(), peerdisc_destroy(), peerdisc_open(), peermux_step(), pool_add(), pool_expired(), process_running(), pxenv_udp_read(), pxenv_undi_isr(), read(), sandev_free(), sandev_reopen(), select(), sis190_mii_probe(), srpcmd_close(), srpcmd_free(), tcp_close(), tcp_rx(), tcp_rx_ack(), tcp_xfer_window(), tcp_xmit_sack(), tls_new_ciphertext(), tls_newdata_process_data(), tls_newdata_process_header(), tls_validator_done(), uart_find(), uhci_bus_close(), uhci_bus_open(), uhci_remove(), unregister_ibdev(), unregister_usb_bus(), usb_endpoint_reset(), usb_hotplug(), usb_message(), usb_prefill(), usb_refill_limit(), usb_remove_all(), usb_stream(), vmbus_remove_channels(), x509_free_chain(), x509_test_exec(), xcm_free(), and xsigo_free().

◆ list_is_singular

#define list_is_singular ( list)
Value:
( { \
list_check ( (list) ); \
inline_list_is_singular ( (list) ); } )

Test whether a list has just one entry.

Parameters
listList to test

Definition at line 150 of file list.h.

150#define list_is_singular( list ) ( { \
151 list_check ( (list) ); \
152 inline_list_is_singular ( (list) ); } )

Referenced by ath_tx_processq(), iob_concatenate(), and list_test_exec().

◆ list_is_last

#define list_is_last ( list,
head )
Value:
( { \
list_check ( (list) ); \
list_check ( (head) ); \
inline_list_is_last ( (list), (head) ); } )

Test whether an entry is the last entry in list.

Parameters
listList entry to test
headList head

Definition at line 164 of file list.h.

164#define list_is_last( list, head ) ( { \
165 list_check ( (list) ); \
166 list_check ( (head) ); \
167 inline_list_is_last ( (list), (head) ); } )

Referenced by ath_tx_processq(), and list_test_exec().

◆ list_cut_position

#define list_cut_position ( new,
list,
entry )
Value:
do { \
list_check ( (new) ); \
assert ( list_empty ( (new) ) ); \
list_check ( (list) ); \
list_check ( (entry) ); \
extern_list_cut_position ( (new), (list), (entry) ); \
} while ( 0 )
#define list_empty(list)
Test whether a list is empty.
Definition list.h:137

Cut a list into two.

Parameters
newA new list to contain all removed entries
listAn existing list
entryAn entry within the existing list

All entries from list up to and including entry are moved to new, which should be an empty list. entry may be equal to list, in which case no entries are moved.

Definition at line 186 of file list.h.

186#define list_cut_position( new, list, entry ) do { \
187 list_check ( (new) ); \
188 assert ( list_empty ( (new) ) ); \
189 list_check ( (list) ); \
190 list_check ( (entry) ); \
191 extern_list_cut_position ( (new), (list), (entry) ); \
192 } while ( 0 )

Referenced by ath_draintxq(), ath_tx_processq(), and list_test_exec().

◆ list_splice

#define list_splice ( list,
entry )
Value:
do { \
list_check ( (list) ); \
list_check ( (entry) ); \
extern_list_splice ( (list), (entry) ); \
} while ( 0 )

Move all entries from one list into another list.

Parameters
listList of entries to add
entryEntry after which to add the new entries

All entries from list are inserted after entry. Note that list is left in an undefined state; use list_splice_init() if you want list to become an empty list.

Definition at line 221 of file list.h.

221#define list_splice( list, entry ) do { \
222 list_check ( (list) ); \
223 list_check ( (entry) ); \
224 extern_list_splice ( (list), (entry) ); \
225 } while ( 0 )

Referenced by inline_list_splice_init(), ipv6_route_okx(), ipv6_table_del(), ipv6_table_okx(), list_test_exec(), and xcm_list().

◆ list_splice_tail

#define list_splice_tail ( list,
entry )
Value:
do { \
list_check ( (list) ); \
list_check ( (entry) ); \
extern_list_splice_tail ( (list), (entry) ); \
} while ( 0 )

Move all entries from one list into another list.

Parameters
listList of entries to add
entryEntry before which to add the new entries

All entries from list are inserted before entry. Note that list is left in an undefined state; use list_splice_tail_init() if you want list to become an empty list.

Definition at line 251 of file list.h.

251#define list_splice_tail( list, entry ) do { \
252 list_check ( (list) ); \
253 list_check ( (entry) ); \
254 extern_list_splice_tail ( (list), (entry) ); \
255 } while ( 0 )

Referenced by inline_list_splice_tail_init(), and list_test_exec().

◆ list_splice_init

#define list_splice_init ( list,
entry )
Value:
do { \
list_check ( (list) ); \
list_check ( (entry) ); \
extern_list_splice_init ( (list), (entry) ); \
} while ( 0 )

Move all entries from one list into another list and reinitialise empty list.

Parameters
listList of entries to add
entryEntry after which to add the new entries

All entries from list are inserted after entry.

Definition at line 279 of file list.h.

279#define list_splice_init( list, entry ) do { \
280 list_check ( (list) ); \
281 list_check ( (entry) ); \
282 extern_list_splice_init ( (list), (entry) ); \
283 } while ( 0 )

Referenced by ipv6_route_okx(), ipv6_table_del(), ipv6_table_okx(), and list_test_exec().

◆ list_splice_tail_init

#define list_splice_tail_init ( list,
entry )
Value:
do { \
list_check ( (list) ); \
list_check ( (entry) ); \
extern_list_splice_tail_init ( (list), (entry) ); \
} while ( 0 )

Move all entries from one list into another list and reinitialise empty list.

Parameters
listList of entries to add
entryEntry before which to add the new entries

All entries from list are inserted before entry.

Definition at line 300 of file list.h.

300#define list_splice_tail_init( list, entry ) do { \
301 list_check ( (list) ); \
302 list_check ( (entry) ); \
303 extern_list_splice_tail_init ( (list), (entry) ); \
304 } while ( 0 )

Referenced by ath_tx_complete_buf(), ath_tx_txqaddbuf(), and list_test_exec().

◆ list_entry

#define list_entry ( list,
type,
member )
Value:
( { \
list_check ( (list) ); \
container_of ( list, type, member ); } )
uint32_t type
Operating system type.
Definition ena.h:1

Get the container of a list entry.

Parameters
listList entry
typeContaining type
memberName of list field within containing type
Return values
containerContaining object

Definition at line 322 of file list.h.

322#define list_entry( list, type, member ) ( { \
323 list_check ( (list) ); \
324 container_of ( list, type, member ); } )

Referenced by ath5k_handle_rx(), ath5k_rx_start(), ath5k_tx(), ath_get_next_rx_buf(), ath_tx_processq(), ath_txq_schedule(), list_test_exec(), peerblk_done(), peerblk_expired(), sis190_default_phy(), and x509_truncate().

◆ list_first_entry

#define list_first_entry ( list,
type,
member )
Value:
( list_empty ( (list) ) ? \
( type * ) NULL : \
list_entry ( (list)->next, type, member ) )
#define list_entry(list, type, member)
Get the container of a list entry.
Definition list.h:322

Get the container of the first entry in a list.

Parameters
listList head
typeContaining type
memberName of list field within containing type
Return values
firstFirst list entry, or NULL

Definition at line 334 of file list.h.

334#define list_first_entry( list, type, member ) \
335 ( list_empty ( (list) ) ? \
336 ( type * ) NULL : \
337 list_entry ( (list)->next, type, member ) )

Referenced by ath_draintxq(), ath_get_next_rx_buf(), ath_startrecv(), ath_tx_get_buffer(), ath_tx_processq(), ath_tx_send_normal(), ath_tx_txqaddbuf(), ath_txq_schedule(), cert_exec(), efi_pxe_udp_read(), efi_snp_receive(), efi_undi_get_status(), efi_usb_uninstall_all(), fcels_exec(), first_image(), ibft_install(), iob_concatenate(), ipv6_table_okx(), last_opened_ibdev(), last_opened_netdev(), list_test_exec(), lotest_dequeue(), neighbour_destroy(), neighbour_tx_queue(), net80211_mgmt_dequeue(), net_discard(), netdev_rx_dequeue(), netdev_tx_complete_err(), netdev_tx_complete_next_err(), peerblk_step(), peermux_step(), pxe_udp_discard(), pxenv_udp_read(), sandev_reopen(), sandev_restart(), step(), tcp_process_rx_queue(), tcp_shutdown(), tls_cipherstream_deliver(), tls_new_ciphertext(), tls_new_data(), tls_newdata_process_data(), unregister_settings(), usb_control(), usb_hotplug(), usb_refill_limit(), usb_step(), x509_first(), and xcm_destroy().

◆ list_last_entry

#define list_last_entry ( list,
type,
member )
Value:
( list_empty ( (list) ) ? \
( type * ) NULL : \
list_entry ( (list)->prev, type, member ) )

Get the container of the last entry in a list.

Parameters
listList head
typeContaining type
memberName of list field within containing type
Return values
firstFirst list entry, or NULL

Definition at line 347 of file list.h.

347#define list_last_entry( list, type, member ) \
348 ( list_empty ( (list) ) ? \
349 ( type * ) NULL : \
350 list_entry ( (list)->prev, type, member ) )

Referenced by dt_remove_node(), fdtcon_default(), list_test_exec(), neighbour_discard(), tls_new_ciphertext(), x509_last(), and x509_test_exec().

◆ list_next_entry

#define list_next_entry ( pos,
head,
member )
Value:
( { \
typeof (pos) next = list_entry ( (pos)->member.next, \
typeof ( *(pos) ), \
member ); \
( ( &next->member == (head) ) ? NULL : next ); } )
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition acpi.c:48

Get the container of the next entry in a list.

Parameters
posCurrent list entry
headList head
memberName of list field within iterator's type
Return values
nextNext list entry, or NULL at end of list

Definition at line 360 of file list.h.

360#define list_next_entry( pos, head, member ) ( { \
361 typeof (pos) next = list_entry ( (pos)->member.next, \
362 typeof ( *(pos) ), \
363 member ); \
364 ( ( &next->member == (head) ) ? NULL : next ); } )

Referenced by cert_exec(), and list_test_exec().

◆ list_prev_entry

#define list_prev_entry ( pos,
head,
member )
Value:
( { \
typeof (pos) prev = list_entry ( (pos)->member.prev, \
typeof ( *(pos) ), \
member ); \
( ( &prev->member == (head) ) ? NULL : prev ); } )

Get the container of the previous entry in a list.

Parameters
posCurrent list entry
headList head
memberName of list field within iterator's type
Return values
nextNext list entry, or NULL at end of list

Definition at line 374 of file list.h.

374#define list_prev_entry( pos, head, member ) ( { \
375 typeof (pos) prev = list_entry ( (pos)->member.prev, \
376 typeof ( *(pos) ), \
377 member ); \
378 ( ( &prev->member == (head) ) ? NULL : prev ); } )

Referenced by list_test_exec(), and x509_test_exec().

◆ list_is_first_entry

#define list_is_first_entry ( entry,
head,
member )
Value:
( (head)->next == &(entry)->member )

Test if entry is first in a list.

Parameters
entryList entry
headList head
memberName of list field within iterator's type
Return values
is_firstEntry is first in the list

Definition at line 388 of file list.h.

388#define list_is_first_entry( entry, head, member ) \
389 ( (head)->next == &(entry)->member )

Referenced by list_test_exec().

◆ list_is_last_entry

#define list_is_last_entry ( entry,
head,
member )
Value:
( (head)->prev == &(entry)->member )

Test if entry is last in a list.

Parameters
entryList entry
headList head
memberName of list field within iterator's type
Return values
is_lastEntry is last in the list

Definition at line 399 of file list.h.

399#define list_is_last_entry( entry, head, member ) \
400 ( (head)->prev == &(entry)->member )

Referenced by list_test_exec().

◆ list_is_head_entry

#define list_is_head_entry ( entry,
head,
member )
Value:
( (head) == &(entry)->member )

Test if entry is the list head.

Parameters
entryList entry
headList head
memberName of list field within iterator's type
Return values
is_headEntry is the list head

Definition at line 410 of file list.h.

410#define list_is_head_entry( entry, head, member ) \
411 ( (head) == &(entry)->member )

Referenced by list_test_exec(), and validator_step().

◆ list_for_each

#define list_for_each ( pos,
head )
Value:
for ( list_check ( (head) ), \
pos = (head)->next; \
pos != (head); \
pos = (pos)->next )
#define list_check(list)
Check a list entry or list head is valid.
Definition list.h:56

Iterate over a list.

Parameters
posIterator
headList head

Definition at line 419 of file list.h.

419#define list_for_each( pos, head ) \
420 for ( list_check ( (head) ), \
421 pos = (head)->next; \
422 pos != (head); \
423 pos = (pos)->next )

Referenced by inline_list_contains(), and list_test_exec().

◆ list_for_each_entry

#define list_for_each_entry ( pos,
head,
member )
Value:
for ( list_check ( (head) ), \
pos = list_entry ( (head)->next, typeof ( *pos ), member ); \
&pos->member != (head); \
pos = list_entry ( pos->member.next, typeof ( *pos ), member ) )

Iterate over entries in a list.

Parameters
posIterator
headList head
memberName of list field within iterator's type

Definition at line 432 of file list.h.

432#define list_for_each_entry( pos, head, member ) \
433 for ( list_check ( (head) ), \
434 pos = list_entry ( (head)->next, typeof ( *pos ), member ); \
435 &pos->member != (head); \
436 pos = list_entry ( pos->member.next, typeof ( *pos ), member ) )

Referenced by abft_install(), alloc_form(), aoecmd_find_tag(), ath5k_desc_free(), ath5k_rx_start(), ath_rx_cleanup(), ath_rx_init(), bofm_find_busdevfn(), check_blocks(), cms_recipient(), cms_verify(), dynui_item(), dynui_shortcut(), eapol_key_rx(), efi_pxe_find(), efi_snp_add_claim(), efi_snp_demux(), efi_undi_snpdev(), efi_usb_probe(), efidev_find(), efidev_parent(), ehci_bus_poll(), ehci_periodic_add(), ehci_periodic_schedule(), eoib_find(), eoib_find_peer(), eoib_notify(), fc_peer_examine(), fc_peer_get_port_id(), fc_peer_get_wwn(), fc_port_demux(), fc_port_find(), fc_ulp_get_type(), fcpeerstat(), fcstat_exec(), fetch_setting(), find_child_settings(), find_dynui(), find_generic_setting(), find_netdev(), find_netdev_by_location(), find_netdev_by_scope_id(), find_parameters(), find_snpdev(), find_usb(), flexboot_nodnic_complete_all_tx(), flexboot_nodnic_find_wq(), fragment_find(), free_usb_bus(), gpios_find(), heap_alloc_block(), heap_dump(), heap_free_block(), ib_cm_find(), ib_find_qp_mgid(), ib_find_qp_qpn(), ib_find_wq(), ib_mcast_detach(), ib_mi_handle(), ib_poll_cq(), ib_poll_eq(), ib_sbft_install(), ib_step(), ibft_install(), ibft_netdev_is_required(), ibstat(), imgverify(), imux_close(), iob_concatenate(), iphone_check_pair(), ipoib_find_remac(), ipoib_map_remac(), ipoib_netdev(), ipoib_notify(), ipv4_add_miniroute(), ipv4_has_addr(), ipv4_has_any_addr(), ipv4_route(), ipv6_has_addr(), ipv6_miniroute(), ipv6_route(), ipv6conf_demux(), iwlist(), linda_poll_cq(), list_check_contents(), list_test_exec(), neighbour_find(), net80211_check_settings_update(), net80211_get(), net80211_mgmt_dequeue(), net80211_probe_finish_best(), net80211_probe_step(), net_poll(), netfront_net_probe(), nii_unmap(), nstat(), pcibridge_find(), peerdisc_discovered(), peerdisc_find(), peermux_block_stat(), ping_demux(), posix_fd_to_file(), qib7322_poll_cq(), read(), reprioritise_settings(), retry_poll(), route_ipv4_print(), route_ipv6_print(), sandev_describe(), sandev_find(), sandev_next(), sandev_reopen(), select_setting_row(), show_menu(), sis190_default_phy(), sis190_get_mac_addr_from_apc(), srp_find_tag(), tcp_demux(), tcp_discard(), tcp_first_unclosed(), tcp_first_unfinished(), tcp_rx_enqueue(), tcp_sack_block(), tls_hmac_list(), tls_new_ciphertext(), tls_send_certificate(), tls_session(), tls_tx_resume_all(), tls_tx_step(), txnic_bgx_probe(), txnic_pf_probe(), uart_find(), udp_demux(), udp_port_available(), uhci_bus_poll(), uhci_periodic_add(), uhci_periodic_schedule(), undirom_find_pci(), usbblk_find(), usbio_bus_poll(), usbio_interface(), usbkbd_getchar(), usbkbd_iskey(), valgrind_make_blocks_defined(), valgrind_make_blocks_noaccess(), validator_step(), vmbus_probe_channels(), vmbus_reset_channels(), vmbus_xfer_pages(), x509_find(), x509_find_issuer_serial(), x509_find_key(), x509_find_subject(), x509_invalidate_chain(), x509_validate_chain(), xcm_find(), xsigo_ib_notify(), xsigo_net_notify(), and xve_find().

◆ list_for_each_entry_reverse

#define list_for_each_entry_reverse ( pos,
head,
member )
Value:
for ( list_check ( (head) ), \
pos = list_entry ( (head)->prev, typeof ( *pos ), member ); \
&pos->member != (head); \
pos = list_entry ( pos->member.prev, typeof ( *pos ), member ) )

Iterate over entries in a list in reverse order.

Parameters
posIterator
headList head
memberName of list field within iterator's type

Definition at line 445 of file list.h.

445#define list_for_each_entry_reverse( pos, head, member ) \
446 for ( list_check ( (head) ), \
447 pos = list_entry ( (head)->prev, typeof ( *pos ), member ); \
448 &pos->member != (head); \
449 pos = list_entry ( pos->member.prev, typeof ( *pos ), member ) )

Referenced by certstore_discard(), ehci_async_schedule(), ehci_periodic_schedule(), eoib_discard(), http_connect(), ipoib_discard_remac(), ipv6_create_routes(), list_check_contents(), list_test_exec(), tcp_discard(), uhci_async_schedule(), and uhci_periodic_schedule().

◆ list_for_each_entry_safe

#define list_for_each_entry_safe ( pos,
tmp,
head,
member )
Value:
for ( list_check ( (head) ), \
pos = list_entry ( (head)->next, typeof ( *pos ), member ), \
tmp = list_entry ( pos->member.next, typeof ( *tmp ), member ); \
&pos->member != (head); \
pos = tmp, \
tmp = list_entry ( tmp->member.next, typeof ( *tmp ), member ) )
unsigned long tmp
Definition linux_pci.h:65

Iterate over entries in a list, safe against deletion of the current entry.

Parameters
posIterator
tmpTemporary value (of same type as iterator)
headList head
memberName of list field within iterator's type

Definition at line 459 of file list.h.

459#define list_for_each_entry_safe( pos, tmp, head, member ) \
460 for ( list_check ( (head) ), \
461 pos = list_entry ( (head)->next, typeof ( *pos ), member ), \
462 tmp = list_entry ( pos->member.next, typeof ( *tmp ), member ); \
463 &pos->member != (head); \
464 pos = tmp, \
465 tmp = list_entry ( tmp->member.next, typeof ( *tmp ), member ) )

Referenced by aoedev_close(), atadev_close(), ath5k_tx_processq(), ath5k_txq_drainq(), ath_startrecv(), ath_txq_schedule(), cms_free(), destroy_dynui(), efi_block_describe(), efi_pxe_udp_close(), efi_snp_flush(), eisabus_remove(), eoib_flush_peers(), eoib_remove(), fc_peer_login(), fc_peer_logout(), fc_port_close(), fc_port_login(), fc_port_logout(), fc_ulp_login(), fc_ulp_logout(), fcpdev_close(), free_parameters(), free_tls(), generic_settings_clear(), heap_free_block(), ib_destroy_mi(), iob_concatenate(), ipoib_flush_remac(), ipoib_remove(), ipv4_del_miniroutes(), ipv6_create_all_routes(), ipv6_table_del(), isabus_remove(), isapnpbus_remove(), linux_args_cleanup(), list_test_exec(), mcabus_remove(), neighbour_flush(), net80211_free_wlanlist(), netfront_discard(), netvsc_recv_data(), nii_pci_close(), pcibus_remove(), peerdisc_discovered(), peerdisc_free(), posix_file_free(), pxenv_udp_close(), remove_devices(), scsidev_close(), sis190_free_phy(), srpdev_close(), t509bus_remove(), tcp_close(), tcp_process_tx_queue(), tls_newdata_process_header(), unregister_usb(), usb_flush(), usb_remove_all(), virtnet_close(), vmbus_probe_channels(), vmbus_remove_channels(), vmbus_xfer_page_iobufs(), wpa_stop(), xcm_list(), xenbus_remove(), and xsigo_ib_remove().

◆ list_for_each_entry_continue

#define list_for_each_entry_continue ( pos,
head,
member )
Value:
for ( list_check ( (head) ), \
pos = list_entry ( pos->member.next, typeof ( *pos ), member ); \
&pos->member != (head); \
pos = list_entry ( pos->member.next, typeof ( *pos ), member ) )

Iterate over entries in a list, starting after current position.

Parameters
posIterator
headList head
memberName of list field within iterator's type

Definition at line 474 of file list.h.

474#define list_for_each_entry_continue( pos, head, member ) \
475 for ( list_check ( (head) ), \
476 pos = list_entry ( pos->member.next, typeof ( *pos ), member ); \
477 &pos->member != (head); \
478 pos = list_entry ( pos->member.next, typeof ( *pos ), member ) )

Referenced by list_test_exec(), peerblk_expired(), and validator_append().

◆ list_for_each_entry_continue_reverse

#define list_for_each_entry_continue_reverse ( pos,
head,
member )
Value:
for ( list_check ( (head) ), \
pos = list_entry ( pos->member.prev, typeof ( *pos ), member ); \
&pos->member != (head); \
pos = list_entry ( pos->member.prev, typeof ( *pos ), member ) )

Iterate over entries in a list in reverse, starting after current position.

Parameters
posIterator
headList head
memberName of list field within iterator's type

Definition at line 487 of file list.h.

487#define list_for_each_entry_continue_reverse( pos, head, member ) \
488 for ( list_check ( (head) ), \
489 pos = list_entry ( pos->member.prev, typeof ( *pos ), member ); \
490 &pos->member != (head); \
491 pos = list_entry ( pos->member.prev, typeof ( *pos ), member ) )

Referenced by list_test_exec(), validator_step(), vmbus_probe_channels(), and x509_validate_chain().

◆ list_for_each_entry_safe_continue

#define list_for_each_entry_safe_continue ( pos,
tmp,
head,
member )
Value:
for ( list_check ( (head) ), \
pos = list_entry ( pos->member.next, typeof ( *pos ), member ), \
tmp = list_entry ( pos->member.next, typeof ( *tmp ), member ); \
&pos->member != (head); \
pos = tmp, \
tmp = list_entry ( tmp->member.next, typeof ( *tmp ), member ) )

Iterate over subsequent entries in a list, safe against deletion.

Parameters
posIterator
tmpTemporary value (of same type as iterator)
headList head
memberName of list field within iterator's type

Definition at line 501 of file list.h.

501#define list_for_each_entry_safe_continue( pos, tmp, head, member ) \
502 for ( list_check ( (head) ), \
503 pos = list_entry ( pos->member.next, typeof ( *pos ), member ), \
504 tmp = list_entry ( pos->member.next, typeof ( *tmp ), member ); \
505 &pos->member != (head); \
506 pos = tmp, \
507 tmp = list_entry ( tmp->member.next, typeof ( *tmp ), member ) )

Referenced by list_test_exec(), and x509_truncate().

◆ list_contains

#define list_contains ( entry,
head )
Value:
( { \
list_check ( (head) ); \
list_check ( (entry) ); \
extern_list_contains ( (entry), (head) ); } )

Test if list contains a specified entry.

Parameters
entryEntry
headList head
Return values
presentList contains specified entry

Definition at line 516 of file list.h.

516#define list_contains( entry, head ) ( { \
517 list_check ( (head) ); \
518 list_check ( (entry) ); \
519 extern_list_contains ( (entry), (head) ); } )

Referenced by list_test_exec().

◆ list_contains_entry

#define list_contains_entry ( entry,
head,
member )
Value:
list_contains ( &(entry)->member, (head) )
#define list_contains(entry, head)
Test if list contains a specified entry.
Definition list.h:516

Test if list contains a specified entry.

Parameters
entryEntry
headList head
Return values
presentList contains specified entry

Definition at line 540 of file list.h.

540#define list_contains_entry( entry, head, member ) \
541 list_contains ( &(entry)->member, (head) )

Referenced by list_test_exec().

◆ list_check_contains_entry

#define list_check_contains_entry ( entry,
head,
member )
Value:
do { \
assert ( list_contains_entry ( (entry), (head), member ) ); \
} while ( 0 )
#define list_contains_entry(entry, head, member)
Test if list contains a specified entry.
Definition list.h:540

Check list contains a specified entry.

Parameters
entryEntry
headList head
memberName of list field within iterator's type

Definition at line 550 of file list.h.

550#define list_check_contains_entry( entry, head, member ) do { \
551 assert ( list_contains_entry ( (entry), (head), member ) ); \
552 } while ( 0 )

Referenced by acpi_del(), ehci_async_del(), ehci_periodic_del(), fc_ulp_detach(), list_test_exec(), netdev_tx_complete_err(), netdev_tx_defer(), sanpath_open(), uhci_async_del(), uhci_periodic_del(), and vmbus_unregister_pages().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ inline_list_add()

void inline_list_add ( struct list_head * new,
struct list_head * head )
inlinestatic

Definition at line 76 of file list.h.

77 {
78 struct list_head *prev = head;
79 struct list_head *next = head->next;
80 next->prev = (new);
81 (new)->next = next;
82 (new)->prev = prev;
83 prev->next = (new);
84}
struct list_head * next
Next list entry.
Definition list.h:21
struct list_head * prev
Previous list entry.
Definition list.h:23

References head, list_head::next, next, and list_head::prev.

Referenced by extern_list_add().

◆ extern_list_add()

void extern_list_add ( struct list_head * new,
struct list_head * head )
extern

Definition at line 35 of file list.c.

35 {
36 inline_list_add ( new, head );
37}
static void inline_list_add(struct list_head *new, struct list_head *head)
Definition list.h:76

References head, and inline_list_add().

◆ inline_list_add_tail()

void inline_list_add_tail ( struct list_head * new,
struct list_head * head )
inlinestatic

Definition at line 100 of file list.h.

101 {
102 struct list_head *prev = head->prev;
103 struct list_head *next = head;
104 next->prev = (new);
105 (new)->next = next;
106 (new)->prev = prev;
107 prev->next = (new);
108}

References head, list_head::next, next, and list_head::prev.

Referenced by extern_list_add_tail().

◆ extern_list_add_tail()

void extern_list_add_tail ( struct list_head * new,
struct list_head * head )
extern

Definition at line 39 of file list.c.

39 {
41}
static void inline_list_add_tail(struct list_head *new, struct list_head *head)
Definition list.h:100

References head, and inline_list_add_tail().

◆ inline_list_del()

void inline_list_del ( struct list_head * list)
inlinestatic

Definition at line 124 of file list.h.

124 {
125 struct list_head *next = (list)->next;
126 struct list_head *prev = (list)->prev;
127 next->prev = prev;
128 prev->next = next;
129}

References list_head::next, next, and list_head::prev.

Referenced by extern_list_del().

◆ extern_list_del()

void extern_list_del ( struct list_head * list)
extern

Definition at line 43 of file list.c.

43 {
44 inline_list_del ( list );
45}
static void inline_list_del(struct list_head *list)
Definition list.h:124

References inline_list_del().

◆ inline_list_empty()

int inline_list_empty ( const struct list_head * list)
inlinestatic

Definition at line 140 of file list.h.

140 {
141 return ( list->next == list );
142}

References list_head::next.

Referenced by extern_list_empty().

◆ extern_list_empty()

int extern_list_empty ( const struct list_head * list)
extern

Definition at line 47 of file list.c.

47 {
48 return inline_list_empty ( list );
49}
static int inline_list_empty(const struct list_head *list)
Definition list.h:140

References inline_list_empty().

◆ inline_list_is_singular()

int inline_list_is_singular ( const struct list_head * list)
inlinestatic

Definition at line 153 of file list.h.

153 {
154 return ( ( ! list_empty ( list ) ) && ( list->next == list->prev ) );
155}

References list_empty, list_head::next, and list_head::prev.

Referenced by extern_list_is_singular().

◆ extern_list_is_singular()

int extern_list_is_singular ( const struct list_head * list)
extern

Definition at line 51 of file list.c.

51 {
52 return inline_list_is_singular ( list );
53}
static int inline_list_is_singular(const struct list_head *list)
Definition list.h:153

References inline_list_is_singular().

◆ inline_list_is_last()

int inline_list_is_last ( const struct list_head * list,
const struct list_head * head )
inlinestatic

Definition at line 168 of file list.h.

169 {
170 return ( list->next == head );
171}

References head, and list_head::next.

Referenced by extern_list_is_last().

◆ extern_list_is_last()

int extern_list_is_last ( const struct list_head * list,
const struct list_head * head )
extern

Definition at line 55 of file list.c.

56 {
57 return inline_list_is_last ( list, head );
58}
static int inline_list_is_last(const struct list_head *list, const struct list_head *head)
Definition list.h:168

References head, and inline_list_is_last().

◆ inline_list_cut_position()

void inline_list_cut_position ( struct list_head * new,
struct list_head * list,
struct list_head * entry )
inlinestatic

Definition at line 193 of file list.h.

195 {
196 struct list_head *first = entry->next;
197
198 if ( list != entry ) {
199 new->next = list->next;
200 new->next->prev = new;
201 new->prev = entry;
202 new->prev->next = new;
203 list->next = first;
204 list->next->prev = list;
205 }
206}
uint32_t first
First block in range.
Definition pccrr.h:1

References first, list_head::next, and list_head::prev.

Referenced by extern_list_cut_position().

◆ extern_list_cut_position()

void extern_list_cut_position ( struct list_head * new,
struct list_head * list,
struct list_head * entry )
extern

Definition at line 60 of file list.c.

62 {
63 inline_list_cut_position ( new, list, entry );
64}
static void inline_list_cut_position(struct list_head *new, struct list_head *list, struct list_head *entry)
Definition list.h:193

References inline_list_cut_position().

◆ inline_list_splice()

void inline_list_splice ( const struct list_head * list,
struct list_head * entry )
inlinestatic

Definition at line 226 of file list.h.

227 {
228 struct list_head *first = list->next;
229 struct list_head *last = list->prev;
230
231 if ( ! list_empty ( list ) ) {
232 last->next = entry->next;
233 last->next->prev = last;
234 first->prev = entry;
235 first->prev->next = first;
236 }
237}

References first, list_empty, list_head::next, and list_head::prev.

Referenced by extern_list_splice().

◆ extern_list_splice()

void extern_list_splice ( const struct list_head * list,
struct list_head * entry )
extern

Definition at line 66 of file list.c.

67 {
68 inline_list_splice ( list, entry );
69}
static void inline_list_splice(const struct list_head *list, struct list_head *entry)
Definition list.h:226

References inline_list_splice().

◆ inline_list_splice_tail()

void inline_list_splice_tail ( const struct list_head * list,
struct list_head * entry )
inlinestatic

Definition at line 256 of file list.h.

257 {
258 struct list_head *first = list->next;
259 struct list_head *last = list->prev;
260
261 if ( ! list_empty ( list ) ) {
262 first->prev = entry->prev;
263 first->prev->next = first;
264 last->next = entry;
265 last->next->prev = last;
266 }
267}

References first, list_empty, list_head::next, and list_head::prev.

Referenced by extern_list_splice_tail().

◆ extern_list_splice_tail()

void extern_list_splice_tail ( const struct list_head * list,
struct list_head * entry )
extern

Definition at line 71 of file list.c.

72 {
73 inline_list_splice_tail ( list, entry );
74}
static void inline_list_splice_tail(const struct list_head *list, struct list_head *entry)
Definition list.h:256

References inline_list_splice_tail().

◆ inline_list_splice_init()

void inline_list_splice_init ( struct list_head * list,
struct list_head * entry )
inlinestatic

Definition at line 284 of file list.h.

285 {
286 list_splice ( list, entry );
287 INIT_LIST_HEAD ( list );
288}
#define list_splice(list, entry)
Move all entries from one list into another list.
Definition list.h:221
#define INIT_LIST_HEAD(list)
Initialise a list head.
Definition list.h:46

References INIT_LIST_HEAD, and list_splice.

Referenced by extern_list_splice_init().

◆ extern_list_splice_init()

void extern_list_splice_init ( struct list_head * list,
struct list_head * entry )
extern

Definition at line 76 of file list.c.

77 {
78 inline_list_splice_init ( list, entry );
79}
static void inline_list_splice_init(struct list_head *list, struct list_head *entry)
Definition list.h:284

References inline_list_splice_init().

◆ inline_list_splice_tail_init()

void inline_list_splice_tail_init ( struct list_head * list,
struct list_head * entry )
inlinestatic

Definition at line 306 of file list.h.

307 {
308 list_splice_tail ( list, entry );
309 INIT_LIST_HEAD ( list );
310}
#define list_splice_tail(list, entry)
Move all entries from one list into another list.
Definition list.h:251

References INIT_LIST_HEAD, and list_splice_tail.

Referenced by extern_list_splice_tail_init().

◆ extern_list_splice_tail_init()

void extern_list_splice_tail_init ( struct list_head * list,
struct list_head * entry )
extern

Definition at line 81 of file list.c.

82 {
83 inline_list_splice_tail_init ( list, entry );
84}
static void inline_list_splice_tail_init(struct list_head *list, struct list_head *entry)
Definition list.h:306

References inline_list_splice_tail_init().

◆ inline_list_contains()

int inline_list_contains ( struct list_head * entry,
struct list_head * head )
inlinestatic

Definition at line 520 of file list.h.

521 {
522 struct list_head *tmp;
523
524 list_for_each ( tmp, head ) {
525 if ( tmp == entry )
526 return 1;
527 }
528 return 0;
529}
#define list_for_each(pos, head)
Iterate over a list.
Definition list.h:419

References head, list_for_each, and tmp.

Referenced by extern_list_contains().

◆ extern_list_contains()

int extern_list_contains ( struct list_head * entry,
struct list_head * head )
extern

Definition at line 86 of file list.c.

87 {
88 return inline_list_contains ( entry, head );
89}
static int inline_list_contains(struct list_head *entry, struct list_head *head)
Definition list.h:520

References head, and inline_list_contains().