iPXE
Data Structures | Defines | Functions
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...

Defines

#define LIST_HEAD_INIT(list)   { &(list), &(list) }
 Initialise a static list head.
#define LIST_HEAD(list)   struct list_head list = LIST_HEAD_INIT ( 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_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_contains(entry, head)
 Test if list contains a specified entry.
#define list_contains_entry(entry, head, member)   list_contains ( &(entry)->member, (head) )
 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)
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.


Define Documentation

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

Initialise a static list head.

Parameters:
listList head

Definition at line 30 of file list.h.

#define LIST_HEAD (   list)    struct list_head list = LIST_HEAD_INIT ( list )

Declare a static list head.

Parameters:
listList head

Definition at line 37 of file list.h.

#define INIT_LIST_HEAD (   list)
Value:
do {                            \
        (list)->next = (list);                                  \
        (list)->prev = (list);                                  \
        } while ( 0 )

Initialise a list head.

Parameters:
listList head

Definition at line 45 of file list.h.

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_signature(), create_menu(), create_parameters(), efi_driver_start(), efi_pxe_install(), efi_snp_probe(), efi_usb_probe(), 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(), neighbour_create(), net80211_alloc(), net80211_probe_start(), nii_start(), open(), parse_net_args(), pci_read_config(), 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(), 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().

#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) );                \
        } )

Check a list entry or list head is valid.

Parameters:
listList entry or head

Definition at line 55 of file list.h.

Referenced by check_blocks().

#define list_add (   new,
  head 
)
#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 93 of file list.h.

Referenced by acpi_add(), add_ipv4_miniroute(), add_menu_item(), add_parameter(), 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_menu(), create_parameters(), 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(), free_memblock(), ib_create_cq(), ib_create_qp(), ib_mcast_attach(), ipoib_probe(), list_test_exec(), lotest_rx(), neighbour_tx(), net80211_handle_mgmt(), net80211_probe_step(), net80211_register(), netdev_rx(), netdev_tx(), netdev_tx_defer(), parse_net_args(), 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_newdata_process_data(), tls_newdata_process_header(), txnic_bgx_probe(), txnic_pf_probe(), 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(), usbio_endpoint_open(), usbkbd_probe(), vmbus_probe_channels(), wpa_start(), x509_append(), xcm_list(), xenbus_probe_device(), and xsigo_ib_probe().

#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 119 of file list.h.

Referenced by acpi_del(), alloc_memblock(), 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(), del_ipv4_miniroute(), destroy_menu(), efi_block_describe(), efi_block_install(), efi_driver_start(), efi_driver_stop(), 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(), 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(), fcoe_close(), fcpcmd_free(), flexboot_nodnic_eth_open(), fragment_expired(), fragment_reassemble(), free_memblock(), free_parameters(), free_tls(), generic_settings_clear(), generic_settings_store(), 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(), iob_concatenate(), ipoib_discard_remac(), ipoib_find_remac(), ipoib_flush_remac(), ipoib_map_remac(), ipoib_probe(), ipoib_remove(), ipv6_add_miniroute(), ipv6_del_miniroute(), ipv6conf_done(), isabus_probe(), isabus_remove(), isapnpbus_probe(), isapnpbus_remove(), linux_args_cleanup(), list_test_exec(), lotest_dequeue(), mcabus_probe(), mcabus_remove(), neighbour_destroy(), neighbour_discovered(), neighbour_find(), 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(), netvsc_recv_data(), nii_start(), nii_stop(), pcibus_probe(), pcibus_remove(), peerdisc_close(), peerdisc_destroy(), peerdisc_free(), peermux_block_close(), peermux_step(), ping_close(), pool_del(), pool_expired(), posix_file_free(), probe_devices(), process_del(), pxenv_udp_close(), pxenv_udp_read(), read_user(), 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_new_record(), tls_newdata_process_data(), tls_newdata_process_header(), txnic_bgx_probe(), txnic_bgx_remove(), txnic_pf_probe(), txnic_pf_remove(), 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(), usb_remove_all(), 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_free_chain(), xcm_destroy(), xcm_list(), xenbus_probe_device(), xenbus_remove_device(), xsigo_ib_remove(), xve_create(), and xve_destroy().

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

Test whether a list is empty.

Parameters:
listList head

Definition at line 136 of file list.h.

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(), efi_pxe_udp_read(), efi_usb_probe(), efi_usb_remove(), 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_usb(), free_usb_bus(), free_usb_hub(), generic_settings_clear(), have_images(), 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_open(), peerdisc_close(), peerdisc_destroy(), peerdisc_open(), peermux_step(), pool_add(), pool_expired(), process_running(), pxenv_udp_read(), pxenv_undi_isr(), read_user(), 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_newdata_process_data(), tls_newdata_process_header(), uhci_bus_close(), uhci_bus_open(), uhci_remove(), unregister_ibdev(), unregister_netdev(), unregister_usb_bus(), usb_endpoint_reset(), usb_hotplug(), usb_message(), usb_prefill(), usb_refill(), usb_remove_all(), usb_stream(), vmbus_remove_channels(), x509_test_exec(), xcm_free(), and xsigo_free().

#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 149 of file list.h.

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

#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 163 of file list.h.

Referenced by ath_tx_processq(), and list_test_exec().

#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 )

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 185 of file list.h.

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

#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 220 of file list.h.

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

#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 250 of file list.h.

Referenced by inline_list_splice_tail_init(), and list_test_exec().

#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 278 of file list.h.

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

#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 299 of file list.h.

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

#define list_entry (   list,
  type,
  member 
)
Value:
( {                     \
        list_check ( (list) );                                  \
        container_of ( list, type, member ); } )

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 321 of file list.h.

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(), and sis190_default_phy().

#define list_first_entry (   list,
  type,
  member 
)
#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 346 of file list.h.

Referenced by list_test_exec(), neighbour_discard(), tls_split_block(), tls_split_stream(), and x509_last().

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

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 359 of file list.h.

Referenced by cert_exec(), and list_test_exec().

#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 373 of file list.h.

Referenced by list_test_exec().

#define list_for_each (   pos,
  head 
)
Value:
for ( list_check ( (head) ),                                          \
              pos = (head)->next;                                             \
              pos != (head);                                                  \
              pos = (pos)->next )

Iterate over a list.

Parameters:
posIterator
headList head

Definition at line 385 of file list.h.

Referenced by inline_list_contains(), and list_test_exec().

#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 398 of file list.h.

Referenced by abft_install(), alloc_memblock(), aoecmd_find_tag(), ath5k_desc_free(), ath5k_rx_start(), ath_rx_cleanup(), ath_rx_init(), bofm_find_busdevfn(), certstore_find(), certstore_find_key(), check_blocks(), cms_find_issuer_serial(), cms_verify(), eapol_key_rx(), efi_file_find(), efi_pxe_find(), efi_snp_add_claim(), efi_snp_demux(), efi_undi_snpdev(), efi_usb_probe(), efidev_find(), 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(), fcoe_demux(), fcpeerstat(), fcstat_exec(), fetch_setting(), find_child_settings(), find_generic_setting(), find_image(), find_menu(), find_netdev(), find_netdev_by_index(), find_netdev_by_ll_addr(), find_netdev_by_location(), find_parameters(), find_snpdev(), flexboot_nodnic_complete_all_tx(), flexboot_nodnic_find_wq(), fragment_find(), free_memblock(), free_usb_bus(), guestinfo_net_remove(), http_connect(), 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(), iob_concatenate(), ipoib_find_remac(), ipoib_map_remac(), ipoib_netdev(), ipoib_notify(), 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(), menu_item(), menu_loop(), neighbour_find(), net80211_check_settings_update(), net80211_get(), net80211_mgmt_dequeue(), net80211_probe_finish_best(), net80211_probe_step(), net_poll(), nstat(), peerdisc_discovered(), peerdisc_find(), peermux_block_stat(), ping_demux(), posix_fd_to_file(), qib7322_poll_cq(), read_user(), reprioritise_settings(), retry_poll(), route_ipv4_print(), route_ipv6_print(), sandev_describe(), sandev_find(), 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_new_ciphertext(), txnic_bgx_probe(), txnic_pf_probe(), udp_demux(), udp_port_available(), uhci_bus_poll(), uhci_periodic_add(), uhci_periodic_schedule(), undirom_find_pci(), 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_subject(), x509_invalidate_chain(), x509_validate_chain(), xcm_find(), xsigo_ib_notify(), xsigo_net_notify(), and xve_find().

#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 411 of file list.h.

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

#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 ) )

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 425 of file list.h.

Referenced by aoedev_close(), atadev_close(), ath5k_tx_processq(), ath5k_txq_drainq(), ath_startrecv(), ath_txq_schedule(), cms_free(), destroy_menu(), 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_memblock(), free_parameters(), free_tls(), generic_settings_clear(), ib_destroy_mi(), iob_concatenate(), ipoib_flush_remac(), ipoib_remove(), ipv4_create_routes(), ipv6_create_all_routes(), ipv6_table_del(), isabus_remove(), isapnpbus_remove(), linux_args_cleanup(), list_test_exec(), mcabus_remove(), neighbour_flush(), net80211_free_wlanlist(), netvsc_recv_data(), 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(), x509_free_chain(), xcm_list(), xenbus_remove(), and xsigo_ib_remove().

#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 440 of file list.h.

Referenced by list_test_exec(), and peerblk_expired().

#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 453 of file list.h.

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

#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 466 of file list.h.

Referenced by list_test_exec().

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

Test if list contains a specified entry.

Parameters:
entryEntry
headList head
Return values:
presentList contains specified entry

Definition at line 490 of file list.h.

Referenced by list_test_exec().

#define list_check_contains_entry (   entry,
  head,
  member 
)
Value:
do {                  \
        assert ( list_contains_entry ( (entry), (head), member ) );           \
        } while ( 0 )

Check list contains a specified entry.

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

Definition at line 500 of file list.h.

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 ( GPL2_OR_LATER_OR_UBDL  )
static void inline_list_add ( struct list_head new,
struct list_head head 
) [inline, static]

Definition at line 75 of file list.h.

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

Referenced by extern_list_add().

                                                              {
        struct list_head *prev = head;
        struct list_head *next = head->next;
        next->prev = (new);
        (new)->next = next;
        (new)->prev = prev;
        prev->next = (new);
}
void extern_list_add ( struct list_head new,
struct list_head head 
)

Definition at line 34 of file list.c.

References inline_list_add().

                                                                       {
        inline_list_add ( new, head );
}
static void inline_list_add_tail ( struct list_head new,
struct list_head head 
) [inline, static]

Definition at line 99 of file list.h.

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

Referenced by extern_list_add_tail().

                                                                   {
        struct list_head *prev = head->prev;
        struct list_head *next = head;
        next->prev = (new);
        (new)->next = next;
        (new)->prev = prev;
        prev->next = (new);
}
void extern_list_add_tail ( struct list_head new,
struct list_head head 
)

Definition at line 38 of file list.c.

References inline_list_add_tail().

                                                                            {
        inline_list_add_tail ( new, head );
}
static void inline_list_del ( struct list_head list) [inline, static]

Definition at line 123 of file list.h.

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

Referenced by extern_list_del().

                                                              {
        struct list_head *next = (list)->next;
        struct list_head *prev = (list)->prev;
        next->prev = prev;
        prev->next = next;
}
void extern_list_del ( struct list_head list)

Definition at line 42 of file list.c.

References inline_list_del().

                                                {
        inline_list_del ( list );
}
static int inline_list_empty ( const struct list_head list) [inline, static]

Definition at line 139 of file list.h.

References list_head::next.

Referenced by extern_list_empty().

                                                                     {
        return ( list->next == list );
}
int extern_list_empty ( const struct list_head list)

Definition at line 46 of file list.c.

References inline_list_empty().

                                                       {
        return inline_list_empty ( list );
}
static int inline_list_is_singular ( const struct list_head list) [inline, static]

Definition at line 152 of file list.h.

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

Referenced by extern_list_is_singular().

                                                                           {
        return ( ( ! list_empty ( list ) ) && ( list->next == list->prev ) );
}
int extern_list_is_singular ( const struct list_head list)

Definition at line 50 of file list.c.

References inline_list_is_singular().

                                                             {
        return inline_list_is_singular ( list );
}
static int inline_list_is_last ( const struct list_head list,
const struct list_head head 
) [inline, static]

Definition at line 167 of file list.h.

References list_head::next.

Referenced by extern_list_is_last().

                                                                       {
        return ( list->next == head );
}
int extern_list_is_last ( const struct list_head list,
const struct list_head head 
)

Definition at line 54 of file list.c.

References inline_list_is_last().

                                                         {
        return inline_list_is_last ( list, head );
}
static void inline_list_cut_position ( struct list_head new,
struct list_head list,
struct list_head entry 
) [inline, static]

Definition at line 192 of file list.h.

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

Referenced by extern_list_cut_position().

                                                                        {
        struct list_head *first = entry->next;

        if ( list != entry ) {
                new->next = list->next;
                new->next->prev = new;
                new->prev = entry;
                new->prev->next = new;
                list->next = first;
                list->next->prev = list;
        }
}
void extern_list_cut_position ( struct list_head new,
struct list_head list,
struct list_head entry 
)

Definition at line 59 of file list.c.

References inline_list_cut_position().

                                                          {
        inline_list_cut_position ( new, list, entry );
}
static void inline_list_splice ( const struct list_head list,
struct list_head entry 
) [inline, static]

Definition at line 225 of file list.h.

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

Referenced by extern_list_splice().

                                                                  {
        struct list_head *first = list->next;
        struct list_head *last = list->prev;

        if ( ! list_empty ( list ) ) {
                last->next = entry->next;
                last->next->prev = last;
                first->prev = entry;
                first->prev->next = first;
        }
}
void extern_list_splice ( const struct list_head list,
struct list_head entry 
)

Definition at line 65 of file list.c.

References inline_list_splice().

                                                    {
        inline_list_splice ( list, entry );
}
static void inline_list_splice_tail ( const struct list_head list,
struct list_head entry 
) [inline, static]

Definition at line 255 of file list.h.

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

Referenced by extern_list_splice_tail().

                                                                       {
        struct list_head *first = list->next;
        struct list_head *last = list->prev;

        if ( ! list_empty ( list ) ) {
                first->prev = entry->prev;
                first->prev->next = first;
                last->next = entry;
                last->next->prev = last;
        }
}
void extern_list_splice_tail ( const struct list_head list,
struct list_head entry 
)

Definition at line 70 of file list.c.

References inline_list_splice_tail().

                                                         {
        inline_list_splice_tail ( list, entry );
}
static void inline_list_splice_init ( struct list_head list,
struct list_head entry 
) [inline, static]

Definition at line 283 of file list.h.

References INIT_LIST_HEAD, and list_splice.

Referenced by extern_list_splice_init().

                                                                       {
        list_splice ( list, entry );
        INIT_LIST_HEAD ( list );
}
void extern_list_splice_init ( struct list_head list,
struct list_head entry 
)

Definition at line 75 of file list.c.

References inline_list_splice_init().

                                                         {
        inline_list_splice_init ( list, entry );
}
static void inline_list_splice_tail_init ( struct list_head list,
struct list_head entry 
) [inline, static]

Definition at line 305 of file list.h.

References INIT_LIST_HEAD, and list_splice_tail.

Referenced by extern_list_splice_tail_init().

                                                                            {
        list_splice_tail ( list, entry );
        INIT_LIST_HEAD ( list );
}
void extern_list_splice_tail_init ( struct list_head list,
struct list_head entry 
)

Definition at line 80 of file list.c.

References inline_list_splice_tail_init().

                                                              {
        inline_list_splice_tail_init ( list, entry );
}
static int inline_list_contains ( struct list_head entry,
struct list_head head 
) [inline, static]

Definition at line 470 of file list.h.

References list_for_each.

Referenced by extern_list_contains().

                                                                  {
        struct list_head *tmp;

        list_for_each ( tmp, head ) {
                if ( tmp == entry )
                        return 1;
        }
        return 0;
}
int extern_list_contains ( struct list_head entry,
struct list_head head 
)

Definition at line 85 of file list.c.

References inline_list_contains().

                                                    {
        return inline_list_contains ( entry, head );
}