WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_lockdep_pri.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
3 * Description: Lock Dependency Check Private HeadFile.
4 * Author: Huawei LiteOS Team
5 * Create: 2022-11-11
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_LOCKDEP_PRI_H
30#define _LOS_LOCKDEP_PRI_H
31
32#include "los_lockdep.h"
33#include "los_mux.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif /* __cplusplus */
38
40#ifdef LOSCFG_KERNEL_MUXDEP
41extern LosLockCheck *OsMuxLockDepGet(UINT32 id);
42#define MUXDEP_CHECK_INIT(id) do { \
43 LockDepMalloc(LOCK_MUTEX, id); \
44 OsLockDepCheckInit(LOCK_MUTEX, OsMuxLockDepGet(id), id); \
45} while (0)
46
47#define MUXDEP_CHECK_DEINIT(id) OsLockDepCheckDeInit(LOCK_MUTEX, OsMuxLockDepGet(id), id)
48#define MUXDEP_CHECK_IN(id) OsLockDepCheckIn(LOCK_MUTEX, OsMuxLockDepGet(id), id)
49#define MUXDEP_RECORD(id) OsLockDepRecord(LOCK_MUTEX, OsMuxLockDepGet(id), id)
50#define MUXDEP_CHECK_OUT(id) OsLockDepCheckOut(LOCK_MUTEX, OsMuxLockDepGet(id), id)
51#else
52#define MUXDEP_CHECK_INIT(id)
53#define MUXDEP_CHECK_DEINIT(id)
54#define MUXDEP_CHECK_IN(id)
55#define MUXDEP_RECORD(id)
56#define MUXDEP_CHECK_OUT(id)
57#endif
58
59#ifdef LOSCFG_KERNEL_SEMDEP
60extern LosLockCheck *OsSemLockDepGet(UINT32 id);
61#define SEMDEP_CHECK_INIT(type, id) do { \
62 if (type == OS_SEM_BINARY) { \
63 LockDepMalloc(LOCK_SEM, id); \
64 OsLockDepCheckInit(LOCK_SEM, OsSemLockDepGet(id), id); \
65 } \
66} while (0)
67
68#define SEMDEP_CHECK_DEINIT(type, id) do { \
69 if (type == OS_SEM_BINARY) { \
70 OsLockDepCheckDeInit(LOCK_SEM, OsSemLockDepGet(id), id); \
71 } \
72} while (0)
73
74#define SEMDEP_CHECK_IN(type, id) do { \
75 if (type == OS_SEM_BINARY) { \
76 OsLockDepCheckIn(LOCK_SEM, OsSemLockDepGet(id), id); \
77 } \
78} while (0)
79
80#define SEMDEP_RECORD(type, id) do { \
81 if (type == OS_SEM_BINARY) { \
82 OsLockDepRecord(LOCK_SEM, OsSemLockDepGet(id), id); \
83 } \
84} while (0)
85
86#define SEMDEP_CHECK_OUT(type, id) do { \
87 if (type == OS_SEM_BINARY) { \
88 OsLockDepCheckOut(LOCK_SEM, OsSemLockDepGet(id), id); \
89 } \
90} while (0)
91#else
92#define SEMDEP_CHECK_INIT(type, id)
93#define SEMDEP_CHECK_DEINIT(type, id)
94#define SEMDEP_CHECK_IN(type, id)
95#define SEMDEP_RECORD(type, id)
96#define SEMDEP_CHECK_OUT(type, id)
97#endif
98
99#ifdef LOSCFG_PTHREAD_MUXDEP
100extern VOID OsLockDepListInit(VOID);
101extern VOID OsLockDepPthreadMuxInsert(MuxBaseCB *muxCB);
102extern LosLockCheck *OsLockDepPthreadMuxGet(MuxBaseCB *muxCB);
103extern VOID OsLockDepPthreadMuxDelete(MuxBaseCB *muxCB);
104
105#define PTHREAD_MUXDEP_CHECK_INIT() OsLockDepListInit()
106#define PTHREAD_MUXDEP_CHECK_DEINIT(muxCB) OsLockDepPthreadMuxDelete(muxCB)
107#define PTHREAD_MUXDEP_CHECK_IN(muxCB) OsLockDepCheckIn(LOCK_PTHREAD, OsLockDepPthreadMuxGet(muxCB), 0)
108#define PTHREAD_MUXDEP_RECORD(muxCB) OsLockDepRecord(LOCK_PTHREAD, OsLockDepPthreadMuxGet(muxCB), 0)
109#define PTHREAD_MUXDEP_CHECK_OUT(muxCB) OsLockDepCheckOut(LOCK_PTHREAD, OsLockDepPthreadMuxGet(muxCB), 0)
110#define PTHREAD_MUXDEP_INSERT(muxCB) OsLockDepPthreadMuxInsert(muxCB)
111#else
112#define PTHREAD_MUXDEP_CHECK_INIT(muxCB)
113#define PTHREAD_MUXDEP_CHECK_DEINIT(muxCB)
114#define PTHREAD_MUXDEP_CHECK_IN(muxCB)
115#define PTHREAD_MUXDEP_RECORD(muxCB)
116#define PTHREAD_MUXDEP_CHECK_OUT(muxCB)
117#define PTHREAD_MUXDEP_INSERT(muxCB)
118#endif
119
120#ifdef __cplusplus
121}
122#endif /* __cplusplus */
123#endif /* _LOS_LOCKDEP_PRI_H */
LockType
Definition los_lockdep.h:45
VOID LockDepMalloc(enum LockType type, UINT32 id)
#define VOID
Definition los_typedef.h:88
unsigned int UINT32
Definition los_typedef.h:52
osal_u8 type
Definition oal_net.h:0
Definition los_lockdep.h:62
Definition los_mux.h:51