OpenOCD
list.h File Reference
Include dependency graph for list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hlist_head
 
struct  hlist_node
 
struct  list_head
 

Macros

#define hlist_entry(ptr, type, member)   container_of(ptr, type, member)
 
#define hlist_entry_safe(ptr, type, member)
 
#define hlist_for_each(pos, head)    for (pos = (head)->first; pos ; pos = pos->next)
 
#define hlist_for_each_entry(pos, head, member)
 hlist_for_each_entry - iterate over list of given type More...
 
#define hlist_for_each_entry_continue(pos, member)
 hlist_for_each_entry_continue - iterate over a hlist continuing after current point More...
 
#define hlist_for_each_entry_from(pos, member)
 hlist_for_each_entry_from - iterate over a hlist continuing from current point More...
 
#define hlist_for_each_entry_safe(pos, n, head, member)
 hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry More...
 
#define hlist_for_each_safe(pos, n, head)
 
#define HLIST_HEAD(name)   struct hlist_head name = { .first = NULL }
 
#define HLIST_HEAD_INIT   { .first = NULL }
 
#define INIT_HLIST_HEAD(ptr)   ((ptr)->first = NULL)
 
#define list_entry(ptr, type, member)    container_of(ptr, type, member)
 list_entry - get the struct for this entry More...
 
#define list_entry_is_head(pos, head, member)    (&pos->member == (head))
 list_entry_is_head - test if the entry points to the head of the list More...
 
#define list_first_entry(ptr, type, member)    list_entry((ptr)->next, type, member)
 list_first_entry - get the first element from a list More...
 
#define list_first_entry_or_null(ptr, type, member)
 list_first_entry_or_null - get the first element from a list More...
 
#define list_for_each(pos, head)    for (pos = (head)->next; pos != (head); pos = pos->next)
 list_for_each - iterate over a list More...
 
#define list_for_each_continue(pos, head)    for (pos = pos->next; pos != (head); pos = pos->next)
 list_for_each_continue - continue iteration over a list More...
 
#define list_for_each_entry(pos, head, member)
 list_for_each_entry - iterate over list of given type More...
 
#define list_for_each_entry_continue(pos, head, member)
 list_for_each_entry_continue - continue iteration over list of given type More...
 
#define list_for_each_entry_continue_reverse(pos, head, member)
 list_for_each_entry_continue_reverse - iterate backwards from the given point More...
 
#define list_for_each_entry_direction(forward, pos, head, member)
 list_for_each_entry_direction - iterate forward/backward over list of given type More...
 
#define list_for_each_entry_from(pos, head, member)
 list_for_each_entry_from - iterate over list of given type from the current point More...
 
#define list_for_each_entry_from_reverse(pos, head, member)
 list_for_each_entry_from_reverse - iterate backwards over list of given type from the current point More...
 
#define list_for_each_entry_reverse(pos, head, member)
 list_for_each_entry_reverse - iterate backwards over list of given type. More...
 
#define list_for_each_entry_safe(pos, n, head, member)
 list_for_each_entry_safe - iterate over list of given type safe against removal of list entry More...
 
#define list_for_each_entry_safe_continue(pos, n, head, member)
 list_for_each_entry_safe_continue - continue list iteration safe against removal More...
 
#define list_for_each_entry_safe_from(pos, n, head, member)
 list_for_each_entry_safe_from - iterate over list from current point safe against removal More...
 
#define list_for_each_entry_safe_reverse(pos, n, head, member)
 list_for_each_entry_safe_reverse - iterate backwards over list safe against removal More...
 
#define list_for_each_prev(pos, head)    for (pos = (head)->prev; pos != (head); pos = pos->prev)
 list_for_each_prev - iterate over a list backwards More...
 
#define list_for_each_prev_safe(pos, n, head)
 list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry More...
 
#define list_for_each_safe(pos, n, head)
 list_for_each_safe - iterate over a list safe against removal of list entry More...
 
#define LIST_HEAD(name)    struct list_head name = LIST_HEAD_INIT(name)
 
#define LIST_HEAD_INIT(name)   { &(name), &(name) }
 
#define list_last_entry(ptr, type, member)    list_entry((ptr)->prev, type, member)
 list_last_entry - get the last element from a list More...
 
#define list_next_entry(pos, member)    list_entry((pos)->member.next, typeof(*(pos)), member)
 list_next_entry - get the next element in list More...
 
#define LIST_POISON1   NULL
 
#define LIST_POISON2   NULL
 
#define list_prepare_entry(pos, head, member)    ((pos) ? (pos) : list_entry(head, typeof(*pos), member))
 list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() More...
 
#define list_prev_entry(pos, member)    list_entry((pos)->member.prev, typeof(*(pos)), member)
 list_prev_entry - get the prev element in list More...
 
#define list_safe_reset_next(pos, n, member)    n = list_next_entry(pos, member)
 list_safe_reset_next - reset a stale list_for_each_entry_safe loop More...
 

Functions

static void __hlist_del (struct hlist_node *n)
 
static void __list_add (struct list_head *new, struct list_head *prev, struct list_head *next)
 
static bool __list_add_valid (struct list_head *new, struct list_head *prev, struct list_head *next)
 
static void __list_cut_position (struct list_head *list, struct list_head *head, struct list_head *entry)
 
static void __list_del (struct list_head *prev, struct list_head *next)
 
static void __list_del_entry (struct list_head *entry)
 
static bool __list_del_entry_valid (struct list_head *entry)
 
static void __list_splice (const struct list_head *list, struct list_head *prev, struct list_head *next)
 
static void hlist_add_before (struct hlist_node *n, struct hlist_node *next)
 hlist_add_before - add a new entry before the one specified More...
 
static void hlist_add_behind (struct hlist_node *n, struct hlist_node *prev)
 hlist_add_behind - add a new entry after the one specified More...
 
static void hlist_add_fake (struct hlist_node *n)
 hlist_add_fake - create a fake hlist consisting of a single headless node More...
 
static void hlist_add_head (struct hlist_node *n, struct hlist_head *h)
 hlist_add_head - add a new entry at the beginning of the hlist More...
 
static void hlist_del (struct hlist_node *n)
 hlist_del - Delete the specified hlist_node from its list More...
 
static void hlist_del_init (struct hlist_node *n)
 hlist_del_init - Delete the specified hlist_node from its list and initialize More...
 
static int hlist_empty (const struct hlist_head *h)
 hlist_empty - Is the specified hlist_head structure an empty hlist? More...
 
static bool hlist_fake (struct hlist_node *h)
 hlist_fake: Is this node a fake hlist? More...
 
static bool hlist_is_singular_node (struct hlist_node *n, struct hlist_head *h)
 hlist_is_singular_node - is node the only element of the specified hlist? More...
 
static void hlist_move_list (struct hlist_head *old, struct hlist_head *new)
 hlist_move_list - Move an hlist More...
 
static int hlist_unhashed (const struct hlist_node *h)
 hlist_unhashed - Has node been removed from list and reinitialized? More...
 
static void INIT_HLIST_NODE (struct hlist_node *h)
 
static void INIT_LIST_HEAD (struct list_head *list)
 INIT_LIST_HEAD - Initialize a list_head structure. More...
 
static void list_add (struct list_head *new, struct list_head *head)
 list_add - add a new entry More...
 
static void list_add_tail (struct list_head *new, struct list_head *head)
 list_add_tail - add a new entry More...
 
static void list_bulk_move_tail (struct list_head *head, struct list_head *first, struct list_head *last)
 list_bulk_move_tail - move a subsection of a list to its tail More...
 
static void list_cut_before (struct list_head *list, struct list_head *head, struct list_head *entry)
 list_cut_before - cut a list into two, before given entry More...
 
static void list_cut_position (struct list_head *list, struct list_head *head, struct list_head *entry)
 list_cut_position - cut a list into two More...
 
static void list_del (struct list_head *entry)
 list_del - deletes entry from list. More...
 
static void list_del_init (struct list_head *entry)
 list_del_init - deletes entry from list and reinitialize it. More...
 
static void list_del_init_careful (struct list_head *entry)
 list_del_init_careful - deletes entry from list and reinitialize it. More...
 
static int list_empty (const struct list_head *head)
 list_empty - tests whether a list is empty More...
 
static int list_empty_careful (const struct list_head *head)
 list_empty_careful - tests whether a list is empty and not being modified More...
 
static int list_is_first (const struct list_head *list, const struct list_head *head)
 list_is_first – tests whether list is the first entry in list head More...
 
static int list_is_last (const struct list_head *list, const struct list_head *head)
 list_is_last - tests whether list is the last entry in list head More...
 
static int list_is_singular (const struct list_head *head)
 list_is_singular - tests whether a list has just one entry. More...
 
static void list_move (struct list_head *list, struct list_head *head)
 list_move - delete from one list and add as another's head More...
 
static void list_move_tail (struct list_head *list, struct list_head *head)
 list_move_tail - delete from one list and add as another's tail More...
 
static void list_replace (struct list_head *old, struct list_head *new)
 list_replace - replace old entry by new one More...
 
static void list_replace_init (struct list_head *old, struct list_head *new)
 list_replace_init - replace old entry by new one and initialize the old one More...
 
static void list_rotate_left (struct list_head *head)
 list_rotate_left - rotate the list to the left More...
 
static void list_rotate_to_front (struct list_head *list, struct list_head *head)
 list_rotate_to_front() - Rotate list to specific item. More...
 
static void list_splice (const struct list_head *list, struct list_head *head)
 list_splice - join two lists, this is designed for stacks More...
 
static void list_splice_init (struct list_head *list, struct list_head *head)
 list_splice_init - join two lists and reinitialise the emptied list. More...
 
static void list_splice_tail (struct list_head *list, struct list_head *head)
 list_splice_tail - join two lists, each list being a queue More...
 
static void list_splice_tail_init (struct list_head *list, struct list_head *head)
 list_splice_tail_init - join two lists and reinitialise the emptied list More...
 
static void list_swap (struct list_head *entry1, struct list_head *entry2)
 list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position More...
 

Macro Definition Documentation

◆ hlist_entry

#define hlist_entry (   ptr,
  type,
  member 
)    container_of(ptr, type, member)

Definition at line 991 of file list.h.

◆ hlist_entry_safe

#define hlist_entry_safe (   ptr,
  type,
  member 
)
Value:
({ typeof(ptr) ____ptr = (ptr); \
____ptr ? hlist_entry(____ptr, type, member) : NULL; \
})
uint8_t type
Definition: esp_usb_jtag.c:0
#define hlist_entry(ptr, type, member)
Definition: list.h:991
#define NULL
Definition: usb.h:16

Definition at line 1000 of file list.h.

◆ hlist_for_each

#define hlist_for_each (   pos,
  head 
)     for (pos = (head)->first; pos ; pos = pos->next)

Definition at line 993 of file list.h.

◆ hlist_for_each_entry

#define hlist_for_each_entry (   pos,
  head,
  member 
)
Value:
for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
#define hlist_entry_safe(ptr, type, member)
Definition: list.h:1000

hlist_for_each_entry - iterate over list of given type

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the hlist_node within the struct.

Definition at line 1011 of file list.h.

◆ hlist_for_each_entry_continue

#define hlist_for_each_entry_continue (   pos,
  member 
)
Value:
for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member);\
pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))

hlist_for_each_entry_continue - iterate over a hlist continuing after current point

Parameters
posthe type * to use as a loop cursor.
memberthe name of the hlist_node within the struct.

Definition at line 1021 of file list.h.

◆ hlist_for_each_entry_from

#define hlist_for_each_entry_from (   pos,
  member 
)
Value:
for (; pos; \
pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))

hlist_for_each_entry_from - iterate over a hlist continuing from current point

Parameters
posthe type * to use as a loop cursor.
memberthe name of the hlist_node within the struct.

Definition at line 1031 of file list.h.

◆ hlist_for_each_entry_safe

#define hlist_for_each_entry_safe (   pos,
  n,
  head,
  member 
)
Value:
for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\
pos && ({ n = pos->member.next; 1; }); \
pos = hlist_entry_safe(n, typeof(*pos), member))

hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry

Parameters
posthe type * to use as a loop cursor.
na &struct hlist_node to use as temporary storage
headthe head for your list.
memberthe name of the hlist_node within the struct.

Definition at line 1042 of file list.h.

◆ hlist_for_each_safe

#define hlist_for_each_safe (   pos,
  n,
  head 
)
Value:
for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
pos = n)

Definition at line 996 of file list.h.

◆ HLIST_HEAD

#define HLIST_HEAD (   name)    struct hlist_head name = { .first = NULL }

Definition at line 820 of file list.h.

◆ HLIST_HEAD_INIT

#define HLIST_HEAD_INIT   { .first = NULL }

Definition at line 819 of file list.h.

◆ INIT_HLIST_HEAD

#define INIT_HLIST_HEAD (   ptr)    ((ptr)->first = NULL)

Definition at line 821 of file list.h.

◆ list_entry

#define list_entry (   ptr,
  type,
  member 
)     container_of(ptr, type, member)

list_entry - get the struct for this entry

Parameters
ptrthe &struct list_head pointer.
typethe type of the struct this is embedded in.
memberthe name of the list_head within the struct.

Definition at line 526 of file list.h.

◆ list_entry_is_head

#define list_entry_is_head (   pos,
  head,
  member 
)     (&pos->member == (head))

list_entry_is_head - test if the entry points to the head of the list

Parameters
posthe type * to cursor
headthe head for your list.
memberthe name of the list_head within the struct.

Definition at line 634 of file list.h.

◆ list_first_entry

#define list_first_entry (   ptr,
  type,
  member 
)     list_entry((ptr)->next, type, member)

list_first_entry - get the first element from a list

Parameters
ptrthe list head to take the element from.
typethe type of the struct this is embedded in.
memberthe name of the list_head within the struct.

Note, that list is expected to be not empty.

Definition at line 537 of file list.h.

◆ list_first_entry_or_null

#define list_first_entry_or_null (   ptr,
  type,
  member 
)
Value:
({ \
struct list_head *head__ = (ptr); \
struct list_head *pos__ = head__->next; \
pos__ != head__ ? list_entry(pos__, type, member) : NULL; \
})
#define list_entry(ptr, type, member)
list_entry - get the struct for this entry
Definition: list.h:526
Definition: list.h:26
struct list_head * next
Definition: list.h:27

list_first_entry_or_null - get the first element from a list

Parameters
ptrthe list head to take the element from.
typethe type of the struct this is embedded in.
memberthe name of the list_head within the struct.

Note that if the list is empty, it returns NULL.

Definition at line 559 of file list.h.

◆ list_for_each

#define list_for_each (   pos,
  head 
)     for (pos = (head)->next; pos != (head); pos = pos->next)

list_for_each - iterate over a list

Parameters
posthe &struct list_head to use as a loop cursor.
headthe head for your list.

Definition at line 586 of file list.h.

◆ list_for_each_continue

#define list_for_each_continue (   pos,
  head 
)     for (pos = pos->next; pos != (head); pos = pos->next)

list_for_each_continue - continue iteration over a list

Parameters
posthe &struct list_head to use as a loop cursor.
headthe head for your list.

Continue to iterate over a list, continuing after the current position.

Definition at line 596 of file list.h.

◆ list_for_each_entry

#define list_for_each_entry (   pos,
  head,
  member 
)
Value:
for (pos = list_first_entry(head, typeof(*pos), member); \
!list_entry_is_head(pos, head, member); \
pos = list_next_entry(pos, member))
#define list_first_entry(ptr, type, member)
list_first_entry - get the first element from a list
Definition: list.h:537
#define list_entry_is_head(pos, head, member)
list_entry_is_head - test if the entry points to the head of the list
Definition: list.h:634
#define list_next_entry(pos, member)
list_next_entry - get the next element in list
Definition: list.h:570

list_for_each_entry - iterate over list of given type

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Definition at line 643 of file list.h.

◆ list_for_each_entry_continue

#define list_for_each_entry_continue (   pos,
  head,
  member 
)
Value:
for (pos = list_next_entry(pos, member); \
!list_entry_is_head(pos, head, member); \
pos = list_next_entry(pos, member))

list_for_each_entry_continue - continue iteration over list of given type

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Continue to iterate over list of given type, continuing after the current position.

Definition at line 693 of file list.h.

◆ list_for_each_entry_continue_reverse

#define list_for_each_entry_continue_reverse (   pos,
  head,
  member 
)
Value:
for (pos = list_prev_entry(pos, member); \
!list_entry_is_head(pos, head, member); \
pos = list_prev_entry(pos, member))
#define list_prev_entry(pos, member)
list_prev_entry - get the prev element in list
Definition: list.h:578

list_for_each_entry_continue_reverse - iterate backwards from the given point

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Start to iterate over list of given type backwards, continuing after the current position.

Definition at line 707 of file list.h.

◆ list_for_each_entry_direction

#define list_for_each_entry_direction (   forward,
  pos,
  head,
  member 
)
Value:
for (pos = forward ? list_first_entry(head, typeof(*pos), member) \
: list_last_entry(head, typeof(*pos), member); \
!list_entry_is_head(pos, head, member); \
pos = forward ? list_next_entry(pos, member) \
: list_prev_entry(pos, member))
#define list_last_entry(ptr, type, member)
list_last_entry - get the last element from a list
Definition: list.h:548

list_for_each_entry_direction - iterate forward/backward over list of given type

Parameters
forwardthe iterate direction, true for forward, false for backward.
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Definition at line 666 of file list.h.

◆ list_for_each_entry_from

#define list_for_each_entry_from (   pos,
  head,
  member 
)
Value:
for (; !list_entry_is_head(pos, head, member); \
pos = list_next_entry(pos, member))

list_for_each_entry_from - iterate over list of given type from the current point

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Iterate over list of given type, continuing from current position.

Definition at line 720 of file list.h.

◆ list_for_each_entry_from_reverse

#define list_for_each_entry_from_reverse (   pos,
  head,
  member 
)
Value:
for (; !list_entry_is_head(pos, head, member); \
pos = list_prev_entry(pos, member))

list_for_each_entry_from_reverse - iterate backwards over list of given type from the current point

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Iterate backwards over list of given type, continuing from current position.

Definition at line 733 of file list.h.

◆ list_for_each_entry_reverse

#define list_for_each_entry_reverse (   pos,
  head,
  member 
)
Value:
for (pos = list_last_entry(head, typeof(*pos), member); \
!list_entry_is_head(pos, head, member); \
pos = list_prev_entry(pos, member))

list_for_each_entry_reverse - iterate backwards over list of given type.

Parameters
posthe type * to use as a loop cursor.
headthe head for your list.
memberthe name of the list_head within the struct.

Definition at line 654 of file list.h.

◆ list_for_each_entry_safe

#define list_for_each_entry_safe (   pos,
  n,
  head,
  member 
)
Value:
for (pos = list_first_entry(head, typeof(*pos), member), \
n = list_next_entry(pos, member); \
!list_entry_is_head(pos, head, member); \
pos = n, n = list_next_entry(n, member))

list_for_each_entry_safe - iterate over list of given type safe against removal of list entry

Parameters
posthe type * to use as a loop cursor.
nanother type * to use as temporary storage
headthe head for your list.
memberthe name of the list_head within the struct.

Definition at line 744 of file list.h.

◆ list_for_each_entry_safe_continue

#define list_for_each_entry_safe_continue (   pos,
  n,
  head,
  member 
)
Value:
for (pos = list_next_entry(pos, member), \
n = list_next_entry(pos, member); \
!list_entry_is_head(pos, head, member); \
pos = n, n = list_next_entry(n, member))

list_for_each_entry_safe_continue - continue list iteration safe against removal

Parameters
posthe type * to use as a loop cursor.
nanother type * to use as temporary storage
headthe head for your list.
memberthe name of the list_head within the struct.

Iterate over list of given type, continuing after current point, safe against removal of list entry.

Definition at line 760 of file list.h.

◆ list_for_each_entry_safe_from

#define list_for_each_entry_safe_from (   pos,
  n,
  head,
  member 
)
Value:
for (n = list_next_entry(pos, member); \
!list_entry_is_head(pos, head, member); \
pos = n, n = list_next_entry(n, member))

list_for_each_entry_safe_from - iterate over list from current point safe against removal

Parameters
posthe type * to use as a loop cursor.
nanother type * to use as temporary storage
headthe head for your list.
memberthe name of the list_head within the struct.

Iterate over list of given type from current point, safe against removal of list entry.

Definition at line 776 of file list.h.

◆ list_for_each_entry_safe_reverse

#define list_for_each_entry_safe_reverse (   pos,
  n,
  head,
  member 
)
Value:
for (pos = list_last_entry(head, typeof(*pos), member), \
n = list_prev_entry(pos, member); \
!list_entry_is_head(pos, head, member); \
pos = n, n = list_prev_entry(n, member))

list_for_each_entry_safe_reverse - iterate backwards over list safe against removal

Parameters
posthe type * to use as a loop cursor.
nanother type * to use as temporary storage
headthe head for your list.
memberthe name of the list_head within the struct.

Iterate backwards over list of given type, safe against removal of list entry.

Definition at line 791 of file list.h.

◆ list_for_each_prev

#define list_for_each_prev (   pos,
  head 
)     for (pos = (head)->prev; pos != (head); pos = pos->prev)

list_for_each_prev - iterate over a list backwards

Parameters
posthe &struct list_head to use as a loop cursor.
headthe head for your list.

Definition at line 604 of file list.h.

◆ list_for_each_prev_safe

#define list_for_each_prev_safe (   pos,
  n,
  head 
)
Value:
for (pos = (head)->prev, n = pos->prev; \
pos != (head); \
pos = n, n = pos->prev)

list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry

Parameters
posthe &struct list_head to use as a loop cursor.
nanother &struct list_head to use as temporary storage
headthe head for your list.

Definition at line 623 of file list.h.

◆ list_for_each_safe

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

list_for_each_safe - iterate over a list safe against removal of list entry

Parameters
posthe &struct list_head to use as a loop cursor.
nanother &struct list_head to use as temporary storage
headthe head for your list.

Definition at line 613 of file list.h.

◆ LIST_HEAD

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

Definition at line 51 of file list.h.

◆ LIST_HEAD_INIT

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

Definition at line 49 of file list.h.

◆ list_last_entry

#define list_last_entry (   ptr,
  type,
  member 
)     list_entry((ptr)->prev, type, member)

list_last_entry - get the last element from a list

Parameters
ptrthe list head to take the element from.
typethe type of the struct this is embedded in.
memberthe name of the list_head within the struct.

Note, that list is expected to be not empty.

Definition at line 548 of file list.h.

◆ list_next_entry

#define list_next_entry (   pos,
  member 
)     list_entry((pos)->member.next, typeof(*(pos)), member)

list_next_entry - get the next element in list

Parameters
posthe type * to cursor
memberthe name of the list_head within the struct.

Definition at line 570 of file list.h.

◆ LIST_POISON1

#define LIST_POISON1   NULL

Definition at line 23 of file list.h.

◆ LIST_POISON2

#define LIST_POISON2   NULL

Definition at line 24 of file list.h.

◆ list_prepare_entry

#define list_prepare_entry (   pos,
  head,
  member 
)     ((pos) ? (pos) : list_entry(head, typeof(*pos), member))

list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()

Parameters
posthe type * to use as a start point
headthe head of the list
memberthe name of the list_head within the struct.

Prepares a pos entry for use as a start point in list_for_each_entry_continue().

Definition at line 681 of file list.h.

◆ list_prev_entry

#define list_prev_entry (   pos,
  member 
)     list_entry((pos)->member.prev, typeof(*(pos)), member)

list_prev_entry - get the prev element in list

Parameters
posthe type * to cursor
memberthe name of the list_head within the struct.

Definition at line 578 of file list.h.

◆ list_safe_reset_next

#define list_safe_reset_next (   pos,
  n,
  member 
)     n = list_next_entry(pos, member)

list_safe_reset_next - reset a stale list_for_each_entry_safe loop

Parameters
posthe loop cursor used in the list_for_each_entry_safe loop
ntemporary storage used in list_for_each_entry_safe
memberthe name of the list_head within the struct.

list_safe_reset_next is not safe to use in general if the list may be modified concurrently (eg. the lock is dropped in the loop body). An exception to this is if the cursor element (pos) is pinned in the list, and list_safe_reset_next is called after re-taking the lock and before completing the current iteration of the loop body.

Definition at line 809 of file list.h.

Function Documentation

◆ __hlist_del()

static void __hlist_del ( struct hlist_node n)
inlinestatic

Definition at line 852 of file list.h.

References hlist_node::next, and hlist_node::pprev.

Referenced by hlist_del(), and hlist_del_init().

◆ __list_add()

static void __list_add ( struct list_head new,
struct list_head prev,
struct list_head next 
)
inlinestatic

Definition at line 91 of file list.h.

References __list_add_valid(), list_head::next, and hlist_node::next.

Referenced by list_add(), and list_add_tail().

◆ __list_add_valid()

static bool __list_add_valid ( struct list_head new,
struct list_head prev,
struct list_head next 
)
inlinestatic

Definition at line 73 of file list.h.

Referenced by __list_add().

◆ __list_cut_position()

static void __list_cut_position ( struct list_head list,
struct list_head head,
struct list_head entry 
)
inlinestatic

Definition at line 379 of file list.h.

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

Referenced by list_cut_position().

◆ __list_del()

static void __list_del ( struct list_head prev,
struct list_head next 
)
inlinestatic

Definition at line 138 of file list.h.

References list_head::next, and hlist_node::next.

Referenced by __list_del_entry().

◆ __list_del_entry()

static void __list_del_entry ( struct list_head entry)
inlinestatic

◆ __list_del_entry_valid()

static bool __list_del_entry_valid ( struct list_head entry)
inlinestatic

Definition at line 79 of file list.h.

Referenced by __list_del_entry().

◆ __list_splice()

static void __list_splice ( const struct list_head list,
struct list_head prev,
struct list_head next 
)
inlinestatic

Definition at line 449 of file list.h.

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

Referenced by list_splice(), list_splice_init(), list_splice_tail(), and list_splice_tail_init().

◆ hlist_add_before()

static void hlist_add_before ( struct hlist_node n,
struct hlist_node next 
)
inlinestatic

hlist_add_before - add a new entry before the one specified

Parameters
nnew entry to be added
nexthlist node to add it before, which must be non-NULL

Definition at line 913 of file list.h.

References hlist_node::next, and hlist_node::pprev.

◆ hlist_add_behind()

static void hlist_add_behind ( struct hlist_node n,
struct hlist_node prev 
)
inlinestatic

hlist_add_behind - add a new entry after the one specified

Parameters
nnew entry to be added
prevhlist node to add it after, which must be non-NULL

Definition at line 927 of file list.h.

References hlist_node::next, and hlist_node::pprev.

◆ hlist_add_fake()

static void hlist_add_fake ( struct hlist_node n)
inlinestatic

hlist_add_fake - create a fake hlist consisting of a single headless node

Parameters
nNode to make a fake list out of

This makes n appear to be its own predecessor on a headless hlist. The point of this is to allow things like hlist_del() to work correctly in cases where there is no list.

Definition at line 946 of file list.h.

References hlist_node::next, and hlist_node::pprev.

◆ hlist_add_head()

static void hlist_add_head ( struct hlist_node n,
struct hlist_head h 
)
inlinestatic

hlist_add_head - add a new entry at the beginning of the hlist

Parameters
nnew entry to be added
hhlist head to add it after

Insert a new entry after the specified head. This is good for implementing stacks.

Definition at line 898 of file list.h.

References hlist_head::first, hlist_node::next, and hlist_node::pprev.

◆ hlist_del()

static void hlist_del ( struct hlist_node n)
inlinestatic

hlist_del - Delete the specified hlist_node from its list

Parameters
nNode to delete.

Note that this function leaves the node in hashed state. Use hlist_del_init() or similar instead to unhash n.

Definition at line 869 of file list.h.

References __hlist_del(), LIST_POISON1, LIST_POISON2, hlist_node::next, and hlist_node::pprev.

◆ hlist_del_init()

static void hlist_del_init ( struct hlist_node n)
inlinestatic

hlist_del_init - Delete the specified hlist_node from its list and initialize

Parameters
nNode to delete.

Note that this function leaves the node in unhashed state.

Definition at line 882 of file list.h.

References __hlist_del(), hlist_unhashed(), and INIT_HLIST_NODE().

◆ hlist_empty()

static int hlist_empty ( const struct hlist_head h)
inlinestatic

hlist_empty - Is the specified hlist_head structure an empty hlist?

Parameters
hStructure to check.

Definition at line 847 of file list.h.

References hlist_head::first.

◆ hlist_fake()

static bool hlist_fake ( struct hlist_node h)
inlinestatic

hlist_fake: Is this node a fake hlist?

Parameters
hNode to check for being a self-referential fake hlist.

Definition at line 955 of file list.h.

References hlist_node::next, and hlist_node::pprev.

◆ hlist_is_singular_node()

static bool hlist_is_singular_node ( struct hlist_node n,
struct hlist_head h 
)
inlinestatic

hlist_is_singular_node - is node the only element of the specified hlist?

Parameters
nNode to check for singularity.
hHeader for potentially singular list.

Check whether the node is the only node of the head without accessing head, thus avoiding unnecessary cache misses.

Definition at line 969 of file list.h.

References hlist_head::first, hlist_node::next, and hlist_node::pprev.

◆ hlist_move_list()

static void hlist_move_list ( struct hlist_head old,
struct hlist_head new 
)
inlinestatic

hlist_move_list - Move an hlist

Parameters
oldhlist_head for old list.
newhlist_head for new list.

Move a list from one list head to another. Fixup the pprev reference of the first entry if it exists.

Definition at line 982 of file list.h.

References hlist_head::first, NULL, and hlist_node::pprev.

◆ hlist_unhashed()

static int hlist_unhashed ( const struct hlist_node h)
inlinestatic

hlist_unhashed - Has node been removed from list and reinitialized?

Parameters
hNode to be checked

Not that not all removal functions will leave a node in unhashed state. For example, hlist_nulls_del_init_rcu() does leave the node in unhashed state, but hlist_nulls_del() does not.

Definition at line 836 of file list.h.

References hlist_node::pprev.

Referenced by hlist_del_init().

◆ INIT_HLIST_NODE()

static void INIT_HLIST_NODE ( struct hlist_node h)
inlinestatic

Definition at line 822 of file list.h.

References hlist_node::next, NULL, and hlist_node::pprev.

Referenced by hlist_del_init().

◆ INIT_LIST_HEAD()

static void INIT_LIST_HEAD ( struct list_head list)
inlinestatic

INIT_LIST_HEAD - Initialize a list_head structure.

Parameters
listlist_head structure to be initialized.

Initializes the list_head to point to itself. If it is a list header, the result is an empty list.

Definition at line 61 of file list.h.

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

Referenced by arc_init_arch_info(), bit_copy_queue_init(), command_init(), dap_cmd_new(), dap_instance_init(), get_dm(), jim_arm_tpiu_swo_create(), jim_target_smp(), list_cut_before(), list_cut_position(), list_del_init(), list_replace_init(), list_splice_init(), list_splice_tail_init(), riscv_info_init(), and vdebug_open().

◆ list_add()

static void list_add ( struct list_head new,
struct list_head head 
)
inlinestatic

list_add - add a new entry

Parameters
newnew entry to be added
headlist head to add it after

Insert a new entry after the specified head. This is good for implementing stacks.

Definition at line 112 of file list.h.

References __list_add(), and list_head::next.

Referenced by arm_tpiu_swo_service_new_connection(), dap_cmd_release(), get_dm(), help_add_command(), jtagdp_overrun_check(), list_move(), list_swap(), parse_ranges(), target_register_reset_callback(), and target_register_trace_callback().

◆ list_add_tail()

static void list_add_tail ( struct list_head new,
struct list_head head 
)
inlinestatic

list_add_tail - add a new entry

Parameters
newnew entry to be added
headlist head to add it before

Insert a new entry before the specified head. This is useful for implementing queues.

Definition at line 126 of file list.h.

References __list_add(), and list_head::prev.

Referenced by adi_jtag_dp_scan(), arc_reg_add(), arc_reg_data_type_add(), arm_tpiu_swo_create(), bit_copy_queued(), cti_create(), dap_create(), jim_target_smp(), list_move_tail(), or1k_du_adv_register(), or1k_tap_mohor_register(), or1k_tap_vjtag_register(), or1k_tap_xilinx_bscan_register(), telnet_auto_complete(), vdebug_jtag_shift_tap(), and vdebug_reg_read().

◆ list_bulk_move_tail()

static void list_bulk_move_tail ( struct list_head head,
struct list_head first,
struct list_head last 
)
inlinestatic

list_bulk_move_tail - move a subsection of a list to its tail

Parameters
headthe head that will follow our entry
firstthe first entry to move
lastthe last entry to move, can be the same as first

Move all entries between first and including last before head. All three entries must belong to the same linked list.

Definition at line 256 of file list.h.

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

◆ list_cut_before()

static void list_cut_before ( struct list_head list,
struct list_head head,
struct list_head entry 
)
inlinestatic

list_cut_before - cut a list into two, before given entry

Parameters
lista new list to add all removed entries
heada list with entries
entryan entry within head, could be the head itself

This helper moves the initial part of head, up to but excluding entry, from head to list. You should pass in entry an element you know is on head. list should be an empty list or a list you do not care about losing its data. If entry == head, all entries on head are moved to list.

Definition at line 433 of file list.h.

References INIT_LIST_HEAD(), list_head::next, and list_head::prev.

◆ list_cut_position()

static void list_cut_position ( struct list_head list,
struct list_head head,
struct list_head entry 
)
inlinestatic

list_cut_position - cut a list into two

Parameters
lista new list to add all removed entries
heada list with entries
entryan entry within head, could be the head itself and if so we won't cut the list

This helper moves the initial part of head, up to and including entry, from head to list. You should pass on entry an element you know is on head. list should be an empty list or a list you do not care about losing its data.

Definition at line 405 of file list.h.

References __list_cut_position(), INIT_LIST_HEAD(), list_empty(), list_is_singular(), and list_head::next.

◆ list_del()

static void list_del ( struct list_head entry)
inlinestatic

list_del - deletes entry from list.

Parameters
entrythe element to delete from the list. Note: list_empty() on entry does not return true after this, the entry is in an undefined state.

Definition at line 160 of file list.h.

References __list_del_entry(), LIST_POISON1, LIST_POISON2, list_head::next, and list_head::prev.

Referenced by arm_tpiu_swo_service_connection_closed(), bit_copy_discard(), bit_copy_execute(), dap_cmd_new(), flush_journal(), help_del_all_commands(), help_del_command(), jtag_quit(), list_swap(), target_destroy(), target_unregister_reset_callback(), target_unregister_trace_callback(), vdebug_run_jtag_queue(), and vdebug_run_reg_queue().

◆ list_del_init()

static void list_del_init ( struct list_head entry)
inlinestatic

list_del_init - deletes entry from list and reinitialize it.

Parameters
entrythe element to delete from the list.

Definition at line 218 of file list.h.

References __list_del_entry(), and INIT_LIST_HEAD().

◆ list_del_init_careful()

static void list_del_init_careful ( struct list_head entry)
inlinestatic

list_del_init_careful - deletes entry from list and reinitialize it.

Parameters
entrythe element to delete from the list.

This is the same as list_del_init(), except designed to be used together with list_empty_careful() in a way to guarantee ordering of other memory operations.

Any memory operations done before a list_del_init_careful() are guaranteed to be visible after a list_empty_careful() test.

Definition at line 312 of file list.h.

References __list_del_entry(), list_head::next, and list_head::prev.

◆ list_empty()

◆ list_empty_careful()

static int list_empty_careful ( const struct list_head head)
inlinestatic

list_empty_careful - tests whether a list is empty and not being modified

Parameters
headthe list to test

Description: tests whether a list is empty and checks that no other CPU might be in the process of modifying either member (next or prev)

NOTE: using list_empty_careful() without synchronization can only be safe if the only activity that can happen to the list entry is list_del_init(). Eg. it cannot be used if another CPU could re-list_add() it.

Definition at line 332 of file list.h.

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

◆ list_is_first()

static int list_is_first ( const struct list_head list,
const struct list_head head 
)
inlinestatic

list_is_first – tests whether list is the first entry in list head

Parameters
listthe entry to test
headthe head of the list

Definition at line 275 of file list.h.

References list_head::prev.

◆ list_is_last()

static int list_is_last ( const struct list_head list,
const struct list_head head 
)
inlinestatic

list_is_last - tests whether list is the last entry in list head

Parameters
listthe entry to test
headthe head of the list

Definition at line 286 of file list.h.

References list_head::next.

◆ list_is_singular()

static int list_is_singular ( const struct list_head head)
inlinestatic

list_is_singular - tests whether a list has just one entry.

Parameters
headthe list to test.

Definition at line 374 of file list.h.

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

Referenced by list_cut_position(), and telnet_auto_complete().

◆ list_move()

static void list_move ( struct list_head list,
struct list_head head 
)
inlinestatic

list_move - delete from one list and add as another's head

Parameters
listthe entry to move
headthe head that will precede our entry

Definition at line 229 of file list.h.

References __list_del_entry(), and list_add().

◆ list_move_tail()

static void list_move_tail ( struct list_head list,
struct list_head head 
)
inlinestatic

list_move_tail - delete from one list and add as another's tail

Parameters
listthe entry to move
headthe head that will follow our entry

Definition at line 240 of file list.h.

References __list_del_entry(), and list_add_tail().

Referenced by jtagdp_overrun_check(), list_rotate_left(), and list_rotate_to_front().

◆ list_replace()

static void list_replace ( struct list_head old,
struct list_head new 
)
inlinestatic

list_replace - replace old entry by new one

Parameters
oldthe element to be replaced
newthe new element to insert

If old was empty, it will be overwritten.

Definition at line 174 of file list.h.

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

Referenced by list_replace_init(), and list_swap().

◆ list_replace_init()

static void list_replace_init ( struct list_head old,
struct list_head new 
)
inlinestatic

list_replace_init - replace old entry by new one and initialize the old one

Parameters
oldthe element to be replaced
newthe new element to insert

If old was empty, it will be overwritten.

Definition at line 190 of file list.h.

References INIT_LIST_HEAD(), and list_replace().

◆ list_rotate_left()

static void list_rotate_left ( struct list_head head)
inlinestatic

list_rotate_left - rotate the list to the left

Parameters
headthe head of the list

Definition at line 342 of file list.h.

References list_empty(), list_move_tail(), and list_head::next.

Referenced by riscv_init_registers().

◆ list_rotate_to_front()

static void list_rotate_to_front ( struct list_head list,
struct list_head head 
)
inlinestatic

list_rotate_to_front() - Rotate list to specific item.

Parameters
listThe desired new front of the list.
headThe head of the list.

Rotates list so that list becomes the new front of the list.

Definition at line 359 of file list.h.

References list_move_tail().

◆ list_splice()

static void list_splice ( const struct list_head list,
struct list_head head 
)
inlinestatic

list_splice - join two lists, this is designed for stacks

Parameters
listthe new list to add.
headthe place to add it in the first list.

Definition at line 468 of file list.h.

References __list_splice(), list_empty(), and list_head::next.

◆ list_splice_init()

static void list_splice_init ( struct list_head list,
struct list_head head 
)
inlinestatic

list_splice_init - join two lists and reinitialise the emptied list.

Parameters
listthe new list to add.
headthe place to add it in the first list.

The list at list is reinitialised

Definition at line 494 of file list.h.

References __list_splice(), INIT_LIST_HEAD(), list_empty(), and list_head::next.

◆ list_splice_tail()

static void list_splice_tail ( struct list_head list,
struct list_head head 
)
inlinestatic

list_splice_tail - join two lists, each list being a queue

Parameters
listthe new list to add.
headthe place to add it in the first list.

Definition at line 480 of file list.h.

References __list_splice(), list_empty(), and list_head::prev.

◆ list_splice_tail_init()

static void list_splice_tail_init ( struct list_head list,
struct list_head head 
)
inlinestatic

list_splice_tail_init - join two lists and reinitialise the emptied list

Parameters
listthe new list to add.
headthe place to add it in the first list.

Each of the lists is a queue. The list at list is reinitialised

Definition at line 511 of file list.h.

References __list_splice(), INIT_LIST_HEAD(), list_empty(), and list_head::prev.

◆ list_swap()

static void list_swap ( struct list_head entry1,
struct list_head entry2 
)
inlinestatic

list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position

Parameters
entry1the location to place entry2
entry2the location to place entry1

Definition at line 202 of file list.h.

References list_add(), list_del(), list_replace(), and list_head::prev.