更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
los_sortlink_pri.h 文件参考

浏览源代码.

结构体

struct  SortLinkList
 
struct  SortLinkAttribute
 排序链表属性
更多...
 

函数

STATIC INLINE VOID OsDeleteNodeSortLink (SortLinkAttribute *sortLinkHeader, SortLinkList *sortList)
 
STATIC INLINE UINT64 OsGetSortLinkNextExpireTime (SortLinkAttribute *sortHeader, UINT64 startTime, UINT32 tickPrecision)
 
STATIC INLINE UINT32 OsGetSortLinkNodeNum (const SortLinkAttribute *head)
 
STATIC INLINE UINT16 OsGetSortLinkNodeCpuid (const SortLinkList *node)
 
VOID OsSortLinkInit (SortLinkAttribute *sortLinkHeader)
 排序链表初始化 更多...
 
VOID OsAdd2SortLink (SortLinkAttribute *head, SortLinkList *node, UINT64 responseTime, UINT16 idleCpu)
 
VOID OsDeleteFromSortLink (SortLinkAttribute *head, SortLinkList *node)
 
UINT64 OsSortLinkGetTargetExpireTime (UINT64 currTime, const SortLinkList *targetSortList)
 
UINT64 OsSortLinkGetNextExpireTime (UINT64 currTime, const SortLinkAttribute *sortLinkHeader)
 
UINT32 OsSortLinkAdjustNodeResponseTime (SortLinkAttribute *head, SortLinkList *node, UINT64 responseTime)
 

函数说明

◆ OsAdd2SortLink()

VOID OsAdd2SortLink ( SortLinkAttribute head,
SortLinkList node,
UINT64  responseTime,
UINT16  idleCpu 
)

在文件 los_sortlink.c84 行定义.

85{
86 LOS_SpinLock(&head->spinLock);
87 SET_SORTLIST_VALUE(node, responseTime);
88 AddNode2SortLink(head, node);
89#ifdef LOSCFG_KERNEL_SMP
90 node->cpuid = idleCpu;
91#endif
93}
VOID LOS_SpinLock(SPIN_LOCK_S *lock)
Definition: los_spinlock.c:50
VOID LOS_SpinUnlock(SPIN_LOCK_S *lock)
Definition: los_spinlock.c:84
函数调用图:
这是这个函数的调用关系图:

◆ OsDeleteFromSortLink()

VOID OsDeleteFromSortLink ( SortLinkAttribute head,
SortLinkList node 
)

在文件 los_sortlink.c95 行定义.

96{
97 LOS_SpinLock(&head->spinLock);
98 if (node->responseTime != OS_SORT_LINK_INVALID_TIME) {
99 OsDeleteNodeSortLink(head, node);
100 }
101 LOS_SpinUnlock(&head->spinLock);
102}
函数调用图:
这是这个函数的调用关系图:

◆ OsDeleteNodeSortLink()

STATIC INLINE VOID OsDeleteNodeSortLink ( SortLinkAttribute sortLinkHeader,
SortLinkList sortList 
)

在文件 los_sortlink_pri.h70 行定义.

71{
72 LOS_ListDelete(&sortList->sortLinkNode);
73 SET_SORTLIST_VALUE(sortList, OS_SORT_LINK_INVALID_TIME);
74 sortLinkHeader->nodeNum--;
75}
LITE_OS_SEC_ALW_INLINE STATIC INLINE VOID LOS_ListDelete(LOS_DL_LIST *node)
Definition: los_list.h:292
函数调用图:
这是这个函数的调用关系图:

◆ OsGetSortLinkNextExpireTime()

STATIC INLINE UINT64 OsGetSortLinkNextExpireTime ( SortLinkAttribute sortHeader,
UINT64  startTime,
UINT32  tickPrecision 
)

在文件 los_sortlink_pri.h77 行定义.

78{
79 LOS_DL_LIST *head = &sortHeader->sortLink;
80 LOS_DL_LIST *list = head->pstNext;
81
82 LOS_SpinLock(&sortHeader->spinLock);
83 if (LOS_ListEmpty(head)) {
84 LOS_SpinUnlock(&sortHeader->spinLock);
85 return OS_SORT_LINK_INVALID_TIME - tickPrecision;
86 }
87
88 SortLinkList *listSorted = LOS_DL_LIST_ENTRY(list, SortLinkList, sortLinkNode);
89 if (listSorted->responseTime <= (startTime + tickPrecision)) {
90 LOS_SpinUnlock(&sortHeader->spinLock);
91 return startTime + tickPrecision;
92 }
93
94 LOS_SpinUnlock(&sortHeader->spinLock);
95 return listSorted->responseTime;
96}
LITE_OS_SEC_ALW_INLINE STATIC INLINE BOOL LOS_ListEmpty(LOS_DL_LIST *list)
Identify whether a specified doubly linked list is empty. | 判断链表是否为空
Definition: los_list.h:321
struct LOS_DL_LIST * pstNext
Definition: los_list.h:84
函数调用图:
这是这个函数的调用关系图:

◆ OsGetSortLinkNodeCpuid()

STATIC INLINE UINT16 OsGetSortLinkNodeCpuid ( const SortLinkList node)

在文件 los_sortlink_pri.h103 行定义.

104{
105#ifdef LOSCFG_KERNEL_SMP
106 return node->cpuid;
107#else
108 return 0;
109#endif
110}
这是这个函数的调用关系图:

◆ OsGetSortLinkNodeNum()

STATIC INLINE UINT32 OsGetSortLinkNodeNum ( const SortLinkAttribute head)

在文件 los_sortlink_pri.h98 行定义.

99{
100 return head->nodeNum;
101}
这是这个函数的调用关系图:

◆ OsSortLinkAdjustNodeResponseTime()

UINT32 OsSortLinkAdjustNodeResponseTime ( SortLinkAttribute head,
SortLinkList node,
UINT64  responseTime 
)

在文件 los_sortlink.c104 行定义.

105{
106 UINT32 ret = LOS_NOK;
107
108 LOS_SpinLock(&head->spinLock);
109 if (node->responseTime != OS_SORT_LINK_INVALID_TIME) {
110 OsDeleteNodeSortLink(head, node);
111 SET_SORTLIST_VALUE(node, responseTime);
112 AddNode2SortLink(head, node);
113 ret = LOS_OK;
114 }
115 LOS_SpinUnlock(&head->spinLock);
116 return ret;
117}
unsigned int UINT32
Definition: los_typedef.h:57
函数调用图:
这是这个函数的调用关系图:

◆ OsSortLinkGetNextExpireTime()

UINT64 OsSortLinkGetNextExpireTime ( UINT64  currTime,
const SortLinkAttribute sortLinkHeader 
)

在文件 los_sortlink.c128 行定义.

129{
130 LOS_DL_LIST *head = (LOS_DL_LIST *)&sortLinkHeader->sortLink;
131
132 if (LOS_ListEmpty(head)) {
133 return OS_SORT_LINK_INVALID_TIME;
134 }
135
136 SortLinkList *listSorted = LOS_DL_LIST_ENTRY(head->pstNext, SortLinkList, sortLinkNode);
137 return OsSortLinkGetTargetExpireTime(currTime, listSorted);
138}
if(tv==NULL)
Definition: time.c:430
函数调用图:
这是这个函数的调用关系图:

◆ OsSortLinkGetTargetExpireTime()

UINT64 OsSortLinkGetTargetExpireTime ( UINT64  currTime,
const SortLinkList targetSortList 
)

在文件 los_sortlink.c119 行定义.

120{
121 if (currTime >= targetSortList->responseTime) {
122 return 0;
123 }
124
125 return (UINT32)(targetSortList->responseTime - currTime);
126}
这是这个函数的调用关系图:

◆ OsSortLinkInit()

VOID OsSortLinkInit ( SortLinkAttribute sortLinkHeader)

排序链表初始化

在文件 los_sortlink.c34 行定义.

35{
36 LOS_ListInit(&sortLinkHeader->sortLink);
37 LOS_SpinInit(&sortLinkHeader->spinLock);
38 sortLinkHeader->nodeNum = 0;
39}
LITE_OS_SEC_ALW_INLINE STATIC INLINE VOID LOS_ListInit(LOS_DL_LIST *list)
Definition: los_list.h:104
VOID LOS_SpinInit(SPIN_LOCK_S *lock)
Definition: los_spinlock.c:37
函数调用图:
这是这个函数的调用关系图: