WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
osal_list.h 文件参考
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

结构体

struct  osal_list_head
 
struct  osal_hlist_node
 
struct  osal_hlist_head
 

宏定义

#define NULL   ((void*)0)
 
#define INLINE__   __inline
 
#define OSAL_LIST_HEAD_INIT(name)
 
#define OSAL_LIST_HEAD(name)    struct osal_list_head name = OSAL_LIST_HEAD_INIT(name)
 
#define OSAL_LIST_POISON1   0x00100100
 
#define OSAL_LIST_POISON2   0x00200200
 
#define osal_offsetof(TYPE, MEMBER)   ((int)(unsigned long)&((TYPE *)0)->MEMBER)
 
#define osal_container_of(ptr, type, member)
 
#define osal_list_entry(ptr, type, member)    osal_container_of(ptr, type, member)
 
#define osal_list_first_entry(ptr, type, member)    osal_list_entry((ptr)->next, type, member)
 
#define osal_list_for_each(pos, head)    for ((pos) = (head)->next; (pos) != (head); (pos) = (pos)->next)
 
#define osal___list_for_each(pos, head)    for ((pos) = (head)->next; (pos) != (head); (pos) = (pos)->next)
 
#define osal_list_for_each_prev(pos, head)    for ((pos) = (head)->prev; (pos) != (head); (pos) = (pos)->prev)
 
#define osal_list_for_each_safe(pos, n, head)
 
#define osal_list_for_each_prev_safe(pos, n, head)
 
#define osal_list_for_each_entry(pos, head, member)
 
#define osal_list_for_each_entry_reverse(pos, head, member)
 
#define osal_list_prepare_entry(pos, head, member)    ((pos) ? : osal_list_entry(head, __typeof__(*pos), member))
 
#define osal_list_for_each_entry_continue(pos, head, member)
 
#define osal_list_for_each_entry_continue_reverse(pos, head, member)
 
#define osal_list_for_each_entry_from(pos, head, member)
 
#define osal_list_for_each_entry_safe(pos, n, head, member)
 
#define osal_list_for_each_entry_safe_continue(pos, n, head, member)
 
#define osal_list_for_each_entry_safe_from(pos, n, head, member)
 
#define osal_list_for_each_entry_safe_reverse(pos, n, head, member)
 
#define osal_list_safe_reset_next(pos, n, member)    (n) = osal_list_entry((pos)->member.next, __typeof__(*pos), member)
 
#define OSAL_HLIST_HEAD_INIT
 
#define OSAL_HLIST_HEAD(name)   struct osal_hlist_head name = { .first = NULL }
 
#define INIT_OSAL_HLIST_HEAD(ptr)   ((ptr)->first = NULL)
 
#define osal_hlist_entry(ptr, type, member)   osal_container_of(ptr, type, member)
 
#define osal_hlist_for_each(pos, head)    for ((pos) = (head)->first; (pos); (pos) = (pos)->next)
 
#define osal_hlist_for_each_safe(pos, n, head)
 
#define osal_hlist_for_each_entry(tpos, pos, head, member)
 
#define osal_hlist_for_each_entry_continue(tpos, pos, member)
 
#define osal_hlist_for_each_entry_from(tpos, pos, member)
 
#define osal_hlist_for_each_entry_safe(tpos, pos, n, head, member)
 
#define get_first_item(attached, type, member)    ((type *)((char *)((attached)->next) - (unsigned long)(&((type *)0)->member)))
 

宏定义说明

◆ get_first_item

#define get_first_item (   attached,
  type,
  member 
)     ((type *)((char *)((attached)->next) - (unsigned long)(&((type *)0)->member)))

◆ INIT_OSAL_HLIST_HEAD

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

◆ INLINE__

#define INLINE__   __inline

◆ NULL

#define NULL   ((void*)0)

◆ osal___list_for_each

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

__list_for_each - iterate over a list @pos: the &struct list_head to use as a loop cursor. @head: the head for your list.

This variant doesn't differ from list_for_each() any more. We don't do prefetching in either case.

◆ osal_container_of

#define osal_container_of (   ptr,
  type,
  member 
)
值:
({ \
const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
(type *)((char *)__mptr - osal_offsetof(type, member)); })
osal_u8 type
Definition oal_net.h:0
#define osal_offsetof(TYPE, MEMBER)
Definition osal_list.h:396

◆ osal_hlist_entry

#define osal_hlist_entry (   ptr,
  type,
  member 
)    osal_container_of(ptr, type, member)

◆ osal_hlist_for_each

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

◆ osal_hlist_for_each_entry

#define osal_hlist_for_each_entry (   tpos,
  pos,
  head,
  member 
)
值:
for ((pos) = (head)->first; \
(pos) && \
({ (tpos) = osal_hlist_entry((pos), __typeof__(*tpos), member); 1; }); \
(pos) = (pos)->next)
#define osal_hlist_entry(ptr, type, member)
Definition osal_list.h:733

hlist_for_each_entry - iterate over list of given type @tpos: the type * to use as a loop cursor. @pos: the &struct hlist_node to use as a loop cursor. @head: the head for your list. @member: the name of the hlist_node within the struct.

◆ osal_hlist_for_each_entry_continue

#define osal_hlist_for_each_entry_continue (   tpos,
  pos,
  member 
)
值:
for ((pos) = (pos)->next; \
(pos) && \
({ (tpos) = osal_hlist_entry((pos), __typeof__(*tpos), member); 1; }); \
(pos) = (pos)->next)

hlist_for_each_entry_continue - iterate over a hlist continuing after current point @tpos: the type * to use as a loop cursor. @pos: the &struct hlist_node to use as a loop cursor. @member: the name of the hlist_node within the struct.

◆ osal_hlist_for_each_entry_from

#define osal_hlist_for_each_entry_from (   tpos,
  pos,
  member 
)
值:
for (; (pos) && \
({ (tpos) = osal_hlist_entry((pos), __typeof__(*tpos), member); 1; }); \
(pos) = (pos)->next)

hlist_for_each_entry_from - iterate over a hlist continuing from current point @tpos: the type * to use as a loop cursor. @pos: the &struct hlist_node to use as a loop cursor. @member: the name of the hlist_node within the struct.

◆ osal_hlist_for_each_entry_safe

#define osal_hlist_for_each_entry_safe (   tpos,
  pos,
  n,
  head,
  member 
)
值:
for ((pos) = (head)->first; \
(pos) && ({ (n) = (pos)->next; 1; }) && \
({ (tpos) = osal_hlist_entry((pos), __typeof__(*tpos), member); 1; }); \
(pos) = (n))

hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry @tpos: the type * to use as a loop cursor. @pos: the &struct hlist_node to use as a loop cursor.
: another &struct hlist_node to use as temporary storage @head: the head for your list. @member: the name of the hlist_node within the struct.

◆ osal_hlist_for_each_safe

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

◆ OSAL_HLIST_HEAD

#define OSAL_HLIST_HEAD (   name)    struct osal_hlist_head name = { .first = NULL }

◆ OSAL_HLIST_HEAD_INIT

#define OSAL_HLIST_HEAD_INIT
值:
{ \
.first = NULL \
}
#define NULL
Definition osal_list.h:18

◆ osal_list_entry

#define osal_list_entry (   ptr,
  type,
  member 
)     osal_container_of(ptr, type, member)

list_entry - get the struct for this entry @ptr: the &struct list_head pointer. @type: the type of the struct this is embedded in. @member: the name of the list_struct within the struct.

◆ osal_list_first_entry

#define osal_list_first_entry (   ptr,
  type,
  member 
)     osal_list_entry((ptr)->next, type, member)

list_first_entry - get the first element from a list @ptr: the list head to take the element from. @type: the type of the struct this is embedded in. @member: the name of the list_struct within the struct.

Note, that list is expected to be not empty.

◆ osal_list_for_each

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

list_for_each - iterate over a list @pos: the &struct list_head to use as a loop cursor. @head: the head for your list.

◆ osal_list_for_each_entry

#define osal_list_for_each_entry (   pos,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((head)->next, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = osal_list_entry((pos)->member.next, __typeof__(*pos), member))
#define osal_list_entry(ptr, type, member)
Definition osal_list.h:409

list_for_each_entry - iterate over list of given type @pos: the type * to use as a loop cursor. @head: the head for your list. @member: the name of the list_struct within the struct.

◆ osal_list_for_each_entry_continue

#define osal_list_for_each_entry_continue (   pos,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((pos)->member.next, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = osal_list_entry((pos)->member.next, __typeof__(*pos), member))

list_for_each_entry_continue - continue iteration over list of given type @pos: the type * to use as a loop cursor. @head: the head for your list. @member: the name of the list_struct within the struct.

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

◆ osal_list_for_each_entry_continue_reverse

#define osal_list_for_each_entry_continue_reverse (   pos,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((pos)->member.prev, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = osal_list_entry((pos)->member.prev, __typeof__(*pos), member))

list_for_each_entry_continue_reverse - iterate backwards from the given point @pos: the type * to use as a loop cursor. @head: the head for your list. @member: the name of the list_struct within the struct.

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

◆ osal_list_for_each_entry_from

#define osal_list_for_each_entry_from (   pos,
  head,
  member 
)
值:
for (; &pos->member != (head); \
(pos) = osal_list_entry((pos)->member.next, __typeof__(*pos), member))

list_for_each_entry_from - iterate over list of given type from the current point @pos: the type * to use as a loop cursor. @head: the head for your list. @member: the name of the list_struct within the struct.

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

◆ osal_list_for_each_entry_reverse

#define osal_list_for_each_entry_reverse (   pos,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((head)->prev, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = osal_list_entry((pos)->member.prev, __typeof__(*pos), member))

list_for_each_entry_reverse - iterate backwards over list of given type. @pos: the type * to use as a loop cursor. @head: the head for your list. @member: the name of the list_struct within the struct.

◆ osal_list_for_each_entry_safe

#define osal_list_for_each_entry_safe (   pos,
  n,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((head)->next, __typeof__(*pos), member), \
(n) = osal_list_entry((pos)->member.next, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = (n), (n) = osal_list_entry((n)->member.next, __typeof__(*n), member))

list_for_each_entry_safe - iterate over list of given type safe against removal of list entry @pos: the type * to use as a loop cursor.
: another type * to use as temporary storage @head: the head for your list. @member: the name of the list_struct within the struct.

◆ osal_list_for_each_entry_safe_continue

#define osal_list_for_each_entry_safe_continue (   pos,
  n,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((pos)->member.next, __typeof__(*pos), member), \
(n) = osal_list_entry((pos)->member.next, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = (n), (n) = osal_list_entry((n)->member.next, __typeof__(*n), member))

list_for_each_entry_safe_continue - continue list iteration safe against removal @pos: the type * to use as a loop cursor.
: another type * to use as temporary storage @head: the head for your list. @member: the name of the list_struct within the struct.

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

◆ osal_list_for_each_entry_safe_from

#define osal_list_for_each_entry_safe_from (   pos,
  n,
  head,
  member 
)
值:
for ((n) = osal_list_entry((pos)->member.next, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = (n), (n) = osal_list_entry((n)->member.next, __typeof__(*n), member))

list_for_each_entry_safe_from - iterate over list from current point safe against removal @pos: the type * to use as a loop cursor.
: another type * to use as temporary storage @head: the head for your list. @member: the name of the list_struct within the struct.

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

◆ osal_list_for_each_entry_safe_reverse

#define osal_list_for_each_entry_safe_reverse (   pos,
  n,
  head,
  member 
)
值:
for ((pos) = osal_list_entry((head)->prev, __typeof__(*pos), member), \
(n) = osal_list_entry((pos)->member.prev, __typeof__(*pos), member); \
&pos->member != (head); \
(pos) = (n), (n) = osal_list_entry((n)->member.prev, __typeof__(*n), member))

list_for_each_entry_safe_reverse - iterate backwards over list safe against removal @pos: the type * to use as a loop cursor.
: another type * to use as temporary storage @head: the head for your list. @member: the name of the list_struct within the struct.

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

◆ osal_list_for_each_prev

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

list_for_each_prev - iterate over a list backwards @pos: the &struct list_head to use as a loop cursor. @head: the head for your list.

◆ osal_list_for_each_prev_safe

#define osal_list_for_each_prev_safe (   pos,
  n,
  head 
)
值:
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 @pos: the &struct list_head to use as a loop cursor.
: another &struct list_head to use as temporary storage @head: the head for your list.

◆ osal_list_for_each_safe

#define osal_list_for_each_safe (   pos,
  n,
  head 
)
值:
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 @pos: the &struct list_head to use as a loop cursor.
: another &struct list_head to use as temporary storage @head: the head for your list.

◆ OSAL_LIST_HEAD

#define OSAL_LIST_HEAD (   name)     struct osal_list_head name = OSAL_LIST_HEAD_INIT(name)

◆ OSAL_LIST_HEAD_INIT

#define OSAL_LIST_HEAD_INIT (   name)
值:
{ \
&(name), &(name) \
}

◆ OSAL_LIST_POISON1

#define OSAL_LIST_POISON1   0x00100100

◆ OSAL_LIST_POISON2

#define OSAL_LIST_POISON2   0x00200200

◆ osal_list_prepare_entry

#define osal_list_prepare_entry (   pos,
  head,
  member 
)     ((pos) ? : osal_list_entry(head, __typeof__(*pos), member))

list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() @pos: the type * to use as a start point @head: the head of the list @member: the name of the list_struct within the struct.

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

◆ osal_list_safe_reset_next

#define osal_list_safe_reset_next (   pos,
  n,
  member 
)     (n) = osal_list_entry((pos)->member.next, __typeof__(*pos), member)

list_safe_reset_next - reset a stale list_for_each_entry_safe loop @pos: the loop cursor used in the list_for_each_entry_safe loop
: temporary storage used in list_for_each_entry_safe @member: the name of the list_struct 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.

◆ osal_offsetof

#define osal_offsetof (   TYPE,
  MEMBER 
)    ((int)(unsigned long)&((TYPE *)0)->MEMBER)