WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
frw_list_rom.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2022. All rights reserved.
3 * Description: wifi dmac os adapt layer
4 */
5
6#ifndef __FRW_LIST_ROM_H__
7#define __FRW_LIST_ROM_H__
8
9#include "osal_types.h"
10#include "osal_list.h"
11
12/* 删除链表中的指定节点,不负责释放,不判断链表是否为空,请注意 */
13static INLINE__ void osal_dlist_delete_entry(struct osal_list_head * const entry)
14{
15 if (osal_unlikely((entry->next == OSAL_NULL) || (entry->prev == OSAL_NULL))) {
16 return;
17 }
18
19 osal___list_del(entry->prev, entry->next);
20 entry->next = OSAL_NULL;
21 entry->prev = OSAL_NULL;
22}
23
24/* 将链表2 加入链表1的尾部 */
25static INLINE__ void osal_dlist_join_tail(struct osal_list_head * const head1, const struct osal_list_head *head2)
26{
27 struct osal_list_head *dlist1_tail;
28 struct osal_list_head *dlist2_tail;
29 struct osal_list_head *dlist2_first;
30
31 dlist1_tail = head1->prev;
32 dlist2_tail = head2->prev;
33 dlist2_first = head2->next;
34 dlist1_tail->next = dlist2_first;
35 dlist2_first->prev = dlist1_tail;
36 head1->prev = dlist2_tail;
37 dlist2_tail->next = head1;
38}
39
40/* 将链表2 加入链表1的头部 也可用于将新链表 加入链表的指定节点后 */
41static INLINE__ void osal_dlist_join_head(struct osal_list_head * const head1, const struct osal_list_head *head2)
42{
43 struct osal_list_head *head2_first = OSAL_NULL;
44 struct osal_list_head *head2_tail = OSAL_NULL;
45 struct osal_list_head *head1_first = OSAL_NULL;
46
47 if (osal_list_empty(head2) == OSAL_TRUE) {
48 return;
49 }
50
51 head2_first = head2->next;
52 head2_tail = head2->prev;
53 head1_first = head1->next;
54
55 head1->next = head2_first;
56 head2_first->prev = head1;
57 head2_tail->next = head1_first;
58 head1_first->prev = head2_tail;
59}
60
61#endif // endif __FRW_LIST_ROM_H__
62
#define osal_unlikely(x)
Definition dmac_misc_type.h:12
#define INLINE__
Definition osal_list.h:25
#define OSAL_NULL
Definition osal_types.h:65
#define OSAL_TRUE
Definition osal_types.h:57
Definition osal_list.h:39
struct osal_list_head * next
Definition osal_list.h:40
struct osal_list_head * prev
Definition osal_list.h:40