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  list_head
 

Macros

#define list_entry(ptr, type, field)   container_of(ptr, type, field)
 
#define list_first_entry(ptr, type, member)    list_entry((ptr)->next, type, member)
 
#define list_first_entry_or_null(ptr, type, member)    (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)
 
#define list_for_each(p, head)    for (p = (head)->next; p != (head); p = (p)->next)
 
#define list_for_each_entry(p, h, field)
 
#define list_for_each_entry_continue(p, h, field)
 
#define list_for_each_entry_continue_reverse(p, h, field)
 
#define list_for_each_entry_direction(is_fwd, p, h, field)
 list_for_each_entry_direction - iterate forward/backward over list of given type More...
 
#define list_for_each_entry_from(p, h, field)
 
#define list_for_each_entry_from_reverse(p, h, field)
 
#define list_for_each_entry_reverse(p, h, field)
 
#define list_for_each_entry_safe(p, n, h, field)
 
#define list_for_each_entry_safe_from(pos, n, head, member)
 
#define list_for_each_entry_safe_reverse(p, n, h, field)
 
#define list_for_each_prev(p, h)   for (p = (h)->prev; p != (h); p = (p)->prev)
 
#define list_for_each_safe(p, n, head)    for (p = (head)->next, n = (p)->next; p != (head); p = n, n = (p)->next)
 
#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)
 
#define list_next_entry(ptr, member)    list_entry(((ptr)->member.next), typeof(*(ptr)), member)
 
#define list_prev_entry(ptr, member)    list_entry(((ptr)->member.prev), typeof(*(ptr)), member)
 
#define list_safe_reset_next(ptr, n, member)    (n) = list_next_entry(ptr, member)
 

Functions

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 void INIT_LIST_HEAD (struct list_head *list)
 
static void linux_list_add (struct list_head *new, struct list_head *prev, struct list_head *next)
 
static void linux_list_splice (const struct list_head *list, struct list_head *prev, struct list_head *next)
 
static void list_add (struct list_head *new, struct list_head *head)
 
static void list_add_tail (struct list_head *new, struct list_head *head)
 
static void list_bulk_move_tail (struct list_head *head, struct list_head *first, struct list_head *last)
 
static size_t list_count_nodes (const struct list_head *list)
 
static void list_cut_position (struct list_head *list, struct list_head *head, struct list_head *entry)
 
static void list_del (struct list_head *entry)
 
static void list_del_init (struct list_head *entry)
 
static int list_empty (const struct list_head *head)
 
static int list_empty_careful (const struct list_head *head)
 
static int list_is_first (const struct list_head *list, const struct list_head *head)
 
static int list_is_last (const struct list_head *list, const struct list_head *head)
 
static int list_is_singular (const struct list_head *head)
 
static void list_move (struct list_head *list, struct list_head *head)
 
static void list_move_tail (struct list_head *entry, struct list_head *head)
 
static void list_replace (struct list_head *old, struct list_head *new)
 
static void list_replace_init (struct list_head *old, struct list_head *new)
 
static void list_rotate_left (struct list_head *h)
 list_rotate_left - rotate the list to the left More...
 
static void list_rotate_to_front (struct list_head *entry, struct list_head *head)
 
static void list_splice (const struct list_head *list, struct list_head *head)
 
static void list_splice_init (struct list_head *list, struct list_head *head)
 
static void list_splice_tail (struct list_head *list, struct list_head *head)
 
static void list_splice_tail_init (struct list_head *list, struct list_head *head)
 

Macro Definition Documentation

◆ list_entry

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

Definition at line 125 of file list.h.

◆ list_first_entry

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

Definition at line 127 of file list.h.

◆ list_first_entry_or_null

#define list_first_entry_or_null (   ptr,
  type,
  member 
)     (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)

Definition at line 133 of file list.h.

◆ list_for_each

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

Definition at line 145 of file list.h.

◆ list_for_each_entry

#define list_for_each_entry (   p,
  h,
  field 
)
Value:
for (p = list_entry((h)->next, typeof(*p), field); &(p)->field != (h); \
p = list_entry((p)->field.next, typeof(*p), field))
#define list_entry(ptr, type, field)
Definition: list.h:125

Definition at line 151 of file list.h.

◆ list_for_each_entry_continue

#define list_for_each_entry_continue (   p,
  h,
  field 
)
Value:
for (p = list_next_entry((p), field); &(p)->field != (h); \
p = list_next_entry((p), field))
#define list_next_entry(ptr, member)
Definition: list.h:136

Definition at line 164 of file list.h.

◆ list_for_each_entry_continue_reverse

#define list_for_each_entry_continue_reverse (   p,
  h,
  field 
)
Value:
for (p = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \
p = list_entry((p)->field.prev, typeof(*p), field))

Definition at line 182 of file list.h.

◆ list_for_each_entry_direction

#define list_for_each_entry_direction (   is_fwd,
  p,
  h,
  field 
)
Value:
for (p = list_entry(is_fwd ? (h)->next : (h)->prev, typeof(*p), field); \
&(p)->field != (h); \
p = list_entry(is_fwd ? (p)->field.next : (p)->field.prev, typeof(*p), field))

list_for_each_entry_direction - iterate forward/backward over list of given type

Parameters
is_fwdthe iterate direction, true for forward, false for backward.
pthe type * to use as a loop cursor.
hthe head of the list.
fieldthe name of the list_head within the struct.

Definition at line 355 of file list.h.

◆ list_for_each_entry_from

#define list_for_each_entry_from (   p,
  h,
  field 
)
Value:
for ( ; &(p)->field != (h); \
p = list_entry((p)->field.next, typeof(*p), field))

Definition at line 160 of file list.h.

◆ list_for_each_entry_from_reverse

#define list_for_each_entry_from_reverse (   p,
  h,
  field 
)
Value:
for (; &p->field != (h); \
p = list_prev_entry(p, field))
#define list_prev_entry(ptr, member)
Definition: list.h:142

Definition at line 188 of file list.h.

◆ list_for_each_entry_reverse

#define list_for_each_entry_reverse (   p,
  h,
  field 
)
Value:
for (p = list_entry((h)->prev, typeof(*p), field); &(p)->field != (h); \
p = list_entry((p)->field.prev, typeof(*p), field))

Definition at line 173 of file list.h.

◆ list_for_each_entry_safe

#define list_for_each_entry_safe (   p,
  n,
  h,
  field 
)
Value:
for (p = list_entry((h)->next, typeof(*p), field), \
n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\
p = n, n = list_entry(n->field.next, typeof(*n), field))

Definition at line 155 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_entry((pos)->member.next, typeof(*pos), member); \
&(pos)->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))

Definition at line 168 of file list.h.

◆ list_for_each_entry_safe_reverse

#define list_for_each_entry_safe_reverse (   p,
  n,
  h,
  field 
)
Value:
for (p = list_entry((h)->prev, typeof(*p), field), \
n = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \
p = n, n = list_entry(n->field.prev, typeof(*n), field))

Definition at line 177 of file list.h.

◆ list_for_each_prev

#define list_for_each_prev (   p,
 
)    for (p = (h)->prev; p != (h); p = (p)->prev)

Definition at line 186 of file list.h.

◆ list_for_each_safe

#define list_for_each_safe (   p,
  n,
  head 
)     for (p = (head)->next, n = (p)->next; p != (head); p = n, n = (p)->next)

Definition at line 148 of file list.h.

◆ LIST_HEAD

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

Definition at line 49 of file list.h.

◆ LIST_HEAD_INIT

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

Definition at line 47 of file list.h.

◆ list_last_entry

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

Definition at line 130 of file list.h.

◆ list_next_entry

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

Definition at line 136 of file list.h.

◆ list_prev_entry

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

Definition at line 142 of file list.h.

◆ list_safe_reset_next

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

Definition at line 139 of file list.h.

Function Documentation

◆ __list_cut_position()

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

Definition at line 289 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 74 of file list.h.

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

Referenced by __list_del_entry(), and list_del().

◆ __list_del_entry()

static void __list_del_entry ( struct list_head entry)
inlinestatic

Definition at line 81 of file list.h.

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

◆ INIT_LIST_HEAD()

◆ linux_list_add()

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

Definition at line 109 of file list.h.

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

Referenced by list_add(), and list_add_tail().

◆ linux_list_splice()

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

◆ list_add()

◆ list_add_tail()

◆ list_bulk_move_tail()

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

Definition at line 225 of file list.h.

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

◆ list_count_nodes()

static size_t list_count_nodes ( const struct list_head list)
inlinestatic

Definition at line 328 of file list.h.

References count, lh(), and list_for_each.

◆ list_cut_position()

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

◆ list_del()

◆ list_del_init()

static void list_del_init ( struct list_head entry)
inlinestatic

Definition at line 119 of file list.h.

References INIT_LIST_HEAD(), and list_del().

◆ list_empty()

◆ list_empty_careful()

static int list_empty_careful ( const struct list_head head)
inlinestatic

Definition at line 66 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

Definition at line 315 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

Definition at line 321 of file list.h.

References list_head::next.

◆ list_is_singular()

static int list_is_singular ( const struct list_head head)
inlinestatic

Definition at line 284 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

Definition at line 205 of file list.h.

References list_add(), and list_del().

◆ list_move_tail()

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

Definition at line 212 of file list.h.

References list_add_tail(), and list_del().

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

Definition at line 93 of file list.h.

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

Referenced by list_replace_init().

◆ list_replace_init()

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

Definition at line 102 of file list.h.

References INIT_LIST_HEAD(), and list_replace().

◆ list_rotate_left()

static void list_rotate_left ( struct list_head h)
inlinestatic

list_rotate_left - rotate the list to the left

Parameters
hthe head of the list

Definition at line 364 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 entry,
struct list_head head 
)
inlinestatic

Definition at line 219 of file list.h.

References list_move_tail().

◆ list_splice()

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

Definition at line 254 of file list.h.

References linux_list_splice(), and list_head::next.

◆ list_splice_init()

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

Definition at line 266 of file list.h.

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

◆ list_splice_tail()

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

Definition at line 260 of file list.h.

References linux_list_splice(), and list_head::prev.

◆ list_splice_tail_init()

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

Definition at line 273 of file list.h.

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