WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_mux_debug_pri.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2019. All rights reserved.
3 * Description: Mutex Debug Private HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2013-01-01
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
29#ifndef _LOS_MUX_DEBUG_PRI_H
30#define _LOS_MUX_DEBUG_PRI_H
31
32#include "los_mux_pri.h"
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
37/* Deadlock detection initialization interface */
40{
41#ifdef LOSCFG_DEBUG_MUTEX_DEADLOCK
42 return OsMuxDlockCheckInit();
43#else
44 return LOS_OK;
45#endif
46}
47
48/* Add holding mutex lock node information */
49extern VOID OsMuxDlockNodeInsert(UINT32 taskId, VOID *muxCB);
51{
52#ifdef LOSCFG_DEBUG_MUTEX_DEADLOCK
53 OsMuxDlockNodeInsert(taskId, muxCB);
54#else
55 (VOID)taskId;
56 (VOID)muxCB;
57#endif
58}
59
60/* Delete holding mutex lock node information */
61extern VOID OsMuxDlockNodeDelete(UINT32 taskId, const VOID *muxCB);
63{
64#ifdef LOSCFG_DEBUG_MUTEX_DEADLOCK
65 OsMuxDlockNodeDelete(taskId, muxCB);
66#else
67 (VOID)taskId;
68 (VOID)muxCB;
69#endif
70}
71
72/* Update the last time the task was executed */
73extern VOID OsTaskTimeUpdate(UINT32 taskId, UINT64 tickCount);
75{
76#ifdef LOSCFG_DEBUG_MUTEX_DEADLOCK
78#else
79 (VOID)taskId;
80#endif
81}
82
83/* mutex debug initialization interface */
86{
87#ifdef LOSCFG_DEBUG_MUTEX
88 return OsMuxDbgInit();
89#else
90 return LOS_OK;
91#endif
92}
93
94/* Update the last time the mutex was executed */
97{
98#ifdef LOSCFG_DEBUG_MUTEX
99 OsMuxDbgTimeUpdate(muxId);
100#else
101 (VOID)muxId;
102#endif
103}
104
105/* Update the MUX_DEBUG_CB of the mutex when created or deleted */
108{
109#ifdef LOSCFG_DEBUG_MUTEX
110 OsMuxDbgUpdate(muxId, creator);
111#else
112 (VOID)muxId;
113 (VOID)creator;
114#endif
115}
116
117/* check the leak of mutex */
120{
121#ifdef LOSCFG_DEBUG_MUTEX
122 OsMutexCheck();
123#endif
124}
125
126#ifdef __cplusplus
127}
128#endif /* __cplusplus */
129
130#endif /* _LOS_MUX_DEBUG_PRI_H */
#define STATIC
Definition common_def.h:57
#define INLINE
Definition common_def.h:65
void *(* TSK_ENTRY_FUNC)(void *param)
Define the type of a task entrance function.
Definition los_task.h:614
UINT64 LOS_TickCountGet(void)
Obtain the number of Ticks.
VOID OsTaskTimeUpdate(UINT32 taskId, UINT64 tickCount)
STATIC INLINE UINT32 OsMuxDlockCheckInitHook(VOID)
Definition los_mux_debug_pri.h:39
STATIC INLINE VOID OsMuxDbgUpdateHook(UINT32 muxId, TSK_ENTRY_FUNC creator)
Definition los_mux_debug_pri.h:107
VOID OsMuxDbgUpdate(UINT32 muxID, TSK_ENTRY_FUNC creator)
STATIC INLINE VOID OsMuxDlockNodeDeleteHook(UINT32 taskId, const VOID *muxCB)
Definition los_mux_debug_pri.h:62
STATIC INLINE VOID OsMuxDlockNodeInsertHook(UINT32 taskId, VOID *muxCB)
Definition los_mux_debug_pri.h:50
STATIC INLINE VOID OsTaskTimeUpdateHook(UINT32 taskId)
Definition los_mux_debug_pri.h:74
UINT32 OsMuxDbgInit(VOID)
STATIC INLINE UINT32 OsMuxDbgInitHook(VOID)
Definition los_mux_debug_pri.h:85
STATIC INLINE VOID OsMutexCheckHook(VOID)
Definition los_mux_debug_pri.h:119
VOID OsMuxDbgTimeUpdate(UINT32 muxId)
UINT32 OsMuxDlockCheckInit(VOID)
VOID OsMuxDlockNodeDelete(UINT32 taskId, const VOID *muxCB)
VOID OsMuxDlockNodeInsert(UINT32 taskId, VOID *muxCB)
STATIC INLINE VOID OsMuxDbgTimeUpdateHook(UINT32 muxId)
Definition los_mux_debug_pri.h:96
VOID OsMutexCheck(VOID)
unsigned long long UINT64
Definition los_typedef.h:72
#define VOID
Definition los_typedef.h:88
#define LOS_OK
Definition los_typedef.h:122
unsigned int UINT32
Definition los_typedef.h:52