Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
5db6c623
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 2 年 前同步成功
通知
475
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5db6c623
编写于
11月 18, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 18, 2021
浏览文件
操作
浏览文件
下载
差异文件
!710 清理YES/NO宏
Merge pull request !710 from Caoruihong/remove_yesno
上级
fe4082ca
bba832ea
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
53 addition
and
73 deletion
+53
-73
kernel/base/misc/sysinfo_shellcmd.c
kernel/base/misc/sysinfo_shellcmd.c
+8
-8
kernel/extended/liteipc/hm_liteipc.c
kernel/extended/liteipc/hm_liteipc.c
+16
-16
kernel/extended/liteipc/hm_liteipc.h
kernel/extended/liteipc/hm_liteipc.h
+2
-2
kernel/include/los_typedef.h
kernel/include/los_typedef.h
+0
-10
testsuites/kernel/include/iCunit.h
testsuites/kernel/include/iCunit.h
+1
-1
testsuites/kernel/include/osTest.h
testsuites/kernel/include/osTest.h
+2
-2
testsuites/kernel/sample/kernel_base/core/task/It_los_task.c
testsuites/kernel/sample/kernel_base/core/task/It_los_task.c
+1
-1
testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c
...suites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c
+2
-2
testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h
...suites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h
+1
-1
testsuites/kernel/src/iCunit.c
testsuites/kernel/src/iCunit.c
+6
-6
testsuites/kernel/src/osTest.c
testsuites/kernel/src/osTest.c
+3
-3
testsuites/unittest/common/include/iCunit.h
testsuites/unittest/common/include/iCunit.h
+1
-1
testsuites/unittest/common/include/los_typedef.h
testsuites/unittest/common/include/los_typedef.h
+0
-10
testsuites/unittest/common/include/osTest.h
testsuites/unittest/common/include/osTest.h
+2
-2
testsuites/unittest/common/osTest.cpp
testsuites/unittest/common/osTest.cpp
+1
-1
testsuites/unittest/liteipc/it_test_liteipc.h
testsuites/unittest/liteipc/it_test_liteipc.h
+1
-1
testsuites/unittest/liteipc/liteipc.h
testsuites/unittest/liteipc/liteipc.h
+1
-1
testsuites/unittest/liteipc/smgr_demo.cpp
testsuites/unittest/liteipc/smgr_demo.cpp
+1
-1
testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp
testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp
+3
-3
testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp
testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp
+1
-1
未找到文件。
kernel/base/misc/sysinfo_shellcmd.c
浏览文件 @
5db6c623
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#endif
#endif
#define SYSINFO_ENABLED(x) (((x) ==
YES
) ? "YES" : "NO")
#define SYSINFO_ENABLED(x) (((x) ==
TRUE
) ? "YES" : "NO")
UINT32
OsShellCmdTaskCntGet
(
VOID
)
UINT32
OsShellCmdTaskCntGet
(
VOID
)
{
{
UINT32
loop
;
UINT32
loop
;
...
@@ -118,21 +118,21 @@ UINT32 OsShellCmdSwtmrCntGet(VOID)
...
@@ -118,21 +118,21 @@ UINT32 OsShellCmdSwtmrCntGet(VOID)
LITE_OS_SEC_TEXT_MINOR
VOID
OsShellCmdSystemInfoGet
(
VOID
)
LITE_OS_SEC_TEXT_MINOR
VOID
OsShellCmdSystemInfoGet
(
VOID
)
{
{
UINT8
isTaskEnable
=
YES
;
UINT8
isTaskEnable
=
TRUE
;
#ifdef LOSCFG_BASE_IPC_SEM
#ifdef LOSCFG_BASE_IPC_SEM
UINT8
isSemEnable
=
YES
;
UINT8
isSemEnable
=
TRUE
;
#else
#else
UINT8
isSemEnable
=
NO
;
UINT8
isSemEnable
=
FALSE
;
#endif
#endif
#ifdef LOSCFG_BASE_IPC_QUEUE
#ifdef LOSCFG_BASE_IPC_QUEUE
UINT8
isQueueEnable
=
YES
;
UINT8
isQueueEnable
=
TRUE
;
#else
#else
UINT8
isQueueEnable
=
NO
;
UINT8
isQueueEnable
=
FALSE
;
#endif
#endif
#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE
#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE
UINT8
isSwtmrEnable
=
YES
;
UINT8
isSwtmrEnable
=
TRUE
;
#else
#else
UINT8
isSwtmrEnable
=
NO
;
UINT8
isSwtmrEnable
=
FALSE
;
#endif
#endif
PRINTK
(
"
\n
Module Used Total Enabled
\n
"
);
PRINTK
(
"
\n
Module Used Total Enabled
\n
"
);
...
...
kernel/extended/liteipc/hm_liteipc.c
浏览文件 @
5db6c623
...
@@ -46,8 +46,8 @@
...
@@ -46,8 +46,8 @@
#include "los_vm_phys.h"
#include "los_vm_phys.h"
#include "los_hook.h"
#include "los_hook.h"
#define USE_TASKID_AS_HANDLE
YES
#define USE_TASKID_AS_HANDLE
1
#define USE_MMAP
YES
#define USE_MMAP
1
#define IPC_IO_DATA_MAX 8192UL
#define IPC_IO_DATA_MAX 8192UL
#define IPC_MSG_DATA_SZ_MAX (IPC_IO_DATA_MAX * sizeof(SpecialObj) / (sizeof(SpecialObj) + sizeof(size_t)))
#define IPC_MSG_DATA_SZ_MAX (IPC_IO_DATA_MAX * sizeof(SpecialObj) / (sizeof(SpecialObj) + sizeof(size_t)))
#define IPC_MSG_OBJECT_NUM_MAX (IPC_MSG_DATA_SZ_MAX / sizeof(SpecialObj))
#define IPC_MSG_OBJECT_NUM_MAX (IPC_MSG_DATA_SZ_MAX / sizeof(SpecialObj))
...
@@ -69,7 +69,7 @@ typedef struct {
...
@@ -69,7 +69,7 @@ typedef struct {
}
IpcUsedNode
;
}
IpcUsedNode
;
STATIC
LosMux
g_serviceHandleMapMux
;
STATIC
LosMux
g_serviceHandleMapMux
;
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
STATIC
HandleInfo
g_cmsTask
;
STATIC
HandleInfo
g_cmsTask
;
#else
#else
STATIC
HandleInfo
g_serviceHandleMap
[
MAX_SERVICE_NUM
];
STATIC
HandleInfo
g_serviceHandleMap
[
MAX_SERVICE_NUM
];
...
@@ -100,7 +100,7 @@ STATIC const struct file_operations_vfs g_liteIpcFops = {
...
@@ -100,7 +100,7 @@ STATIC const struct file_operations_vfs g_liteIpcFops = {
LITE_OS_SEC_TEXT_INIT
UINT32
OsLiteIpcInit
(
VOID
)
LITE_OS_SEC_TEXT_INIT
UINT32
OsLiteIpcInit
(
VOID
)
{
{
UINT32
ret
;
UINT32
ret
;
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
g_cmsTask
.
status
=
HANDLE_NOT_USED
;
g_cmsTask
.
status
=
HANDLE_NOT_USED
;
#else
#else
memset_s
(
g_serviceHandleMap
,
sizeof
(
g_serviceHandleMap
),
0
,
sizeof
(
g_serviceHandleMap
));
memset_s
(
g_serviceHandleMap
,
sizeof
(
g_serviceHandleMap
),
0
,
sizeof
(
g_serviceHandleMap
));
...
@@ -419,7 +419,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GetTid(UINT32 serviceHandle, UINT32 *taskID)
...
@@ -419,7 +419,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GetTid(UINT32 serviceHandle, UINT32 *taskID)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
*
taskID
=
serviceHandle
?
serviceHandle
:
g_cmsTask
.
taskID
;
*
taskID
=
serviceHandle
?
serviceHandle
:
g_cmsTask
.
taskID
;
(
VOID
)
LOS_MuxUnlock
(
&
g_serviceHandleMapMux
);
(
VOID
)
LOS_MuxUnlock
(
&
g_serviceHandleMapMux
);
return
LOS_OK
;
return
LOS_OK
;
...
@@ -437,7 +437,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GetTid(UINT32 serviceHandle, UINT32 *taskID)
...
@@ -437,7 +437,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GetTid(UINT32 serviceHandle, UINT32 *taskID)
LITE_OS_SEC_TEXT
STATIC
UINT32
GenerateServiceHandle
(
UINT32
taskID
,
HandleStatus
status
,
UINT32
*
serviceHandle
)
LITE_OS_SEC_TEXT
STATIC
UINT32
GenerateServiceHandle
(
UINT32
taskID
,
HandleStatus
status
,
UINT32
*
serviceHandle
)
{
{
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
*
serviceHandle
=
taskID
?
taskID
:
LOS_CurTaskIDGet
();
/* if taskID is 0, return curTaskID */
*
serviceHandle
=
taskID
?
taskID
:
LOS_CurTaskIDGet
();
/* if taskID is 0, return curTaskID */
if
(
*
serviceHandle
!=
g_cmsTask
.
taskID
)
{
if
(
*
serviceHandle
!=
g_cmsTask
.
taskID
)
{
(
VOID
)
LOS_MuxUnlock
(
&
g_serviceHandleMapMux
);
(
VOID
)
LOS_MuxUnlock
(
&
g_serviceHandleMapMux
);
...
@@ -460,7 +460,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GenerateServiceHandle(UINT32 taskID, HandleStatus
...
@@ -460,7 +460,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 GenerateServiceHandle(UINT32 taskID, HandleStatus
LITE_OS_SEC_TEXT
STATIC
VOID
RefreshServiceHandle
(
UINT32
serviceHandle
,
UINT32
result
)
LITE_OS_SEC_TEXT
STATIC
VOID
RefreshServiceHandle
(
UINT32
serviceHandle
,
UINT32
result
)
{
{
#if (USE_TASKID_AS_HANDLE ==
NO
)
#if (USE_TASKID_AS_HANDLE ==
0
)
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
if
((
result
==
LOS_OK
)
&&
(
g_serviceHandleMap
[
serviceHandle
].
status
==
HANDLE_REGISTING
))
{
if
((
result
==
LOS_OK
)
&&
(
g_serviceHandleMap
[
serviceHandle
].
status
==
HANDLE_REGISTING
))
{
g_serviceHandleMap
[
serviceHandle
].
status
=
HANDLE_REGISTED
;
g_serviceHandleMap
[
serviceHandle
].
status
=
HANDLE_REGISTED
;
...
@@ -582,7 +582,7 @@ LITE_OS_SEC_TEXT VOID LiteIpcRemoveServiceHandle(UINT32 taskID)
...
@@ -582,7 +582,7 @@ LITE_OS_SEC_TEXT VOID LiteIpcRemoveServiceHandle(UINT32 taskID)
return
;
return
;
}
}
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
UINT32
intSave
;
UINT32
intSave
;
LOS_DL_LIST
*
listHead
=
NULL
;
LOS_DL_LIST
*
listHead
=
NULL
;
...
@@ -643,7 +643,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetCms(UINTPTR maxMsgSize)
...
@@ -643,7 +643,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetCms(UINTPTR maxMsgSize)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
if
(
g_cmsTask
.
status
==
HANDLE_NOT_USED
)
{
if
(
g_cmsTask
.
status
==
HANDLE_NOT_USED
)
{
g_cmsTask
.
status
=
HANDLE_REGISTED
;
g_cmsTask
.
status
=
HANDLE_REGISTED
;
g_cmsTask
.
taskID
=
LOS_CurTaskIDGet
();
g_cmsTask
.
taskID
=
LOS_CurTaskIDGet
();
...
@@ -667,7 +667,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsSet(VOID)
...
@@ -667,7 +667,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsSet(VOID)
{
{
BOOL
ret
;
BOOL
ret
;
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
ret
=
g_cmsTask
.
status
==
HANDLE_REGISTED
;
ret
=
g_cmsTask
.
status
==
HANDLE_REGISTED
;
#else
#else
ret
=
g_serviceHandleMap
[
0
].
status
==
HANDLE_REGISTED
;
ret
=
g_serviceHandleMap
[
0
].
status
==
HANDLE_REGISTED
;
...
@@ -680,7 +680,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsTask(UINT32 taskID)
...
@@ -680,7 +680,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsTask(UINT32 taskID)
{
{
BOOL
ret
;
BOOL
ret
;
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
(
VOID
)
LOS_MuxLock
(
&
g_serviceHandleMapMux
,
LOS_WAIT_FOREVER
);
#if (USE_TASKID_AS_HANDLE ==
YES
)
#if (USE_TASKID_AS_HANDLE ==
1
)
ret
=
IsCmsSet
()
?
(
OS_TCB_FROM_TID
(
taskID
)
->
processID
==
OS_TCB_FROM_TID
(
g_cmsTask
.
taskID
)
->
processID
)
:
FALSE
;
ret
=
IsCmsSet
()
?
(
OS_TCB_FROM_TID
(
taskID
)
->
processID
==
OS_TCB_FROM_TID
(
g_cmsTask
.
taskID
)
->
processID
)
:
FALSE
;
#else
#else
ret
=
IsCmsSet
()
?
(
OS_TCB_FROM_TID
(
taskID
)
->
processID
==
ret
=
IsCmsSet
()
?
(
OS_TCB_FROM_TID
(
taskID
)
->
processID
==
...
@@ -939,7 +939,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
...
@@ -939,7 +939,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
UINT32
ret
;
UINT32
ret
;
IpcMsg
*
msg
=
content
->
outMsg
;
IpcMsg
*
msg
=
content
->
outMsg
;
UINT32
flag
=
content
->
flag
;
UINT32
flag
=
content
->
flag
;
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
UINT64
now
=
LOS_CurrNanosec
();
UINT64
now
=
LOS_CurrNanosec
();
#endif
#endif
if
(((
msg
->
dataSz
>
0
)
&&
(
msg
->
data
==
NULL
))
||
if
(((
msg
->
dataSz
>
0
)
&&
(
msg
->
data
==
NULL
))
||
...
@@ -960,7 +960,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
...
@@ -960,7 +960,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
PRINT_ERR
(
"Liteipc %s, %d
\n
"
,
__FUNCTION__
,
__LINE__
);
PRINT_ERR
(
"Liteipc %s, %d
\n
"
,
__FUNCTION__
,
__LINE__
);
return
-
EACCES
;
return
-
EACCES
;
}
}
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
msg
->
timestamp
=
now
;
msg
->
timestamp
=
now
;
#endif
#endif
break
;
break
;
...
@@ -972,7 +972,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
...
@@ -972,7 +972,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
if
(
!
IsValidReply
(
content
))
{
if
(
!
IsValidReply
(
content
))
{
return
-
EINVAL
;
return
-
EINVAL
;
}
}
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
if
(
now
>
msg
->
timestamp
+
LITEIPC_TIMEOUT_NS
)
{
if
(
now
>
msg
->
timestamp
+
LITEIPC_TIMEOUT_NS
)
{
#ifdef LOSCFG_KERNEL_HOOK
#ifdef LOSCFG_KERNEL_HOOK
ret
=
GetTid
(
msg
->
target
.
handle
,
dstTid
);
ret
=
GetTid
(
msg
->
target
.
handle
,
dstTid
);
...
@@ -990,7 +990,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
...
@@ -990,7 +990,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
break
;
break
;
case
MT_DEATH_NOTIFY
:
case
MT_DEATH_NOTIFY
:
*
dstTid
=
msg
->
target
.
handle
;
*
dstTid
=
msg
->
target
.
handle
;
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
msg
->
timestamp
=
now
;
msg
->
timestamp
=
now
;
#endif
#endif
break
;
break
;
...
@@ -1085,7 +1085,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c
...
@@ -1085,7 +1085,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c
PRINT_ERR
(
"%s, %d
\n
"
,
__FUNCTION__
,
__LINE__
);
PRINT_ERR
(
"%s, %d
\n
"
,
__FUNCTION__
,
__LINE__
);
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
}
}
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
if
(
node
->
msg
.
timestamp
!=
content
->
outMsg
->
timestamp
)
{
if
(
node
->
msg
.
timestamp
!=
content
->
outMsg
->
timestamp
)
{
PRINT_ERR
(
"Recieve a unmatch reply, drop it
\n
"
);
PRINT_ERR
(
"Recieve a unmatch reply, drop it
\n
"
);
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
...
...
kernel/extended/liteipc/hm_liteipc.h
浏览文件 @
5db6c623
...
@@ -46,7 +46,7 @@ extern "C" {
...
@@ -46,7 +46,7 @@ extern "C" {
#define LITEIPC_DRIVER "/dev/lite_ipc"
#define LITEIPC_DRIVER "/dev/lite_ipc"
#define LITEIPC_DRIVER_MODE 0644
#define LITEIPC_DRIVER_MODE 0644
#define MAX_SERVICE_NUM LOSCFG_BASE_CORE_TSK_LIMIT
#define MAX_SERVICE_NUM LOSCFG_BASE_CORE_TSK_LIMIT
#define USE_TIMESTAMP
YES
#define USE_TIMESTAMP
1
typedef
enum
{
typedef
enum
{
HANDLE_NOT_USED
,
HANDLE_NOT_USED
,
...
@@ -143,7 +143,7 @@ typedef struct {
...
@@ -143,7 +143,7 @@ typedef struct {
SvcIdentity
target
;
/**< serviceHandle or targetTaskId, depending on type */
SvcIdentity
target
;
/**< serviceHandle or targetTaskId, depending on type */
UINT32
code
;
/**< service function code */
UINT32
code
;
/**< service function code */
UINT32
flag
;
UINT32
flag
;
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
UINT64
timestamp
;
UINT64
timestamp
;
#endif
#endif
UINT32
dataSz
;
/**< size of data */
UINT32
dataSz
;
/**< size of data */
...
...
kernel/include/los_typedef.h
浏览文件 @
5db6c623
...
@@ -102,16 +102,6 @@ typedef size_t BOOL;
...
@@ -102,16 +102,6 @@ typedef size_t BOOL;
#define NULL ((VOID *)0)
#define NULL ((VOID *)0)
#endif
#endif
#ifdef YES
#undef YES
#endif
#define YES 1
#ifdef NO
#undef NO
#endif
#define NO 0
#define OS_NULL_BYTE ((UINT8)0xFF)
#define OS_NULL_BYTE ((UINT8)0xFF)
#define OS_NULL_SHORT ((UINT16)0xFFFF)
#define OS_NULL_SHORT ((UINT16)0xFFFF)
#define OS_NULL_INT ((UINT32)0xFFFFFFFF)
#define OS_NULL_INT ((UINT32)0xFFFFFFFF)
...
...
testsuites/kernel/include/iCunit.h
浏览文件 @
5db6c623
...
@@ -73,7 +73,7 @@ typedef unsigned long iiUINT32;
...
@@ -73,7 +73,7 @@ typedef unsigned long iiUINT32;
#define TEST_MODE (FUNCTION_TEST)
#define TEST_MODE (FUNCTION_TEST)
#define TEST_LESSER_MEM
NO
#define TEST_LESSER_MEM
0
typedef
iUINT32
(
*
CASE_FUNCTION
)(
void
);
typedef
iUINT32
(
*
CASE_FUNCTION
)(
void
);
...
...
testsuites/kernel/include/osTest.h
浏览文件 @
5db6c623
...
@@ -260,11 +260,11 @@ extern u_long TRandom(void);
...
@@ -260,11 +260,11 @@ extern u_long TRandom(void);
#define HUAWEI_ENV_NFS 0
#define HUAWEI_ENV_NFS 0
#ifndef TEST_RESOURCELEAK_CHECK
#ifndef TEST_RESOURCELEAK_CHECK
#define TEST_RESOURCELEAK_CHECK
YES
#define TEST_RESOURCELEAK_CHECK
1
#endif
#endif
#ifndef TEST_MODULE_CHECK
#ifndef TEST_MODULE_CHECK
#define TEST_MODULE_CHECK
YES
#define TEST_MODULE_CHECK
1
#endif
#endif
#define OS_PROCESS_STATUS_PEND OS_PROCESS_STATUS_PENDING
#define OS_PROCESS_STATUS_PEND OS_PROCESS_STATUS_PENDING
...
...
testsuites/kernel/sample/kernel_base/core/task/It_los_task.c
浏览文件 @
5db6c623
...
@@ -37,7 +37,7 @@ extern "C" {
...
@@ -37,7 +37,7 @@ extern "C" {
#endif
/* __cpluscplus */
#endif
/* __cpluscplus */
#endif
/* __cpluscplus */
#endif
/* __cpluscplus */
#define LOSCFG_TEST_UNSOLVED
YES
#define LOSCFG_TEST_UNSOLVED
1
volatile
UINT64
g_itTimesliceTestCount1
=
0
;
volatile
UINT64
g_itTimesliceTestCount1
=
0
;
volatile
INT32
g_timesliceTestCount
=
0
;
volatile
INT32
g_timesliceTestCount
=
0
;
...
...
testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c
浏览文件 @
5db6c623
...
@@ -75,7 +75,7 @@ VOID ItSuiteLosQueue(VOID)
...
@@ -75,7 +75,7 @@ VOID ItSuiteLosQueue(VOID)
#if defined(LOSCFG_TEST_SMOKE)
#if defined(LOSCFG_TEST_SMOKE)
ItLosQueue001
();
ItLosQueue001
();
ItLosQueue097
();
ItLosQueue097
();
#if (LOS_MEM_TLSF ==
YES
)
#if (LOS_MEM_TLSF ==
1
)
#else
#else
ItLosQueue100
();
ItLosQueue100
();
ItLosQueue105
();
ItLosQueue105
();
...
@@ -172,7 +172,7 @@ VOID ItSuiteLosQueue(VOID)
...
@@ -172,7 +172,7 @@ VOID ItSuiteLosQueue(VOID)
ItLosQueue096
();
ItLosQueue096
();
ItLosQueue098
();
ItLosQueue098
();
#if (LOS_MEM_TLSF ==
YES
)
#if (LOS_MEM_TLSF ==
1
)
#else
#else
ItLosQueue099
();
ItLosQueue099
();
ItLosQueue101
();
ItLosQueue101
();
...
...
testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h
浏览文件 @
5db6c623
...
@@ -65,7 +65,7 @@ extern VOID ItSuiteLosQueue(VOID);
...
@@ -65,7 +65,7 @@ extern VOID ItSuiteLosQueue(VOID);
#if defined(LOSCFG_TEST_SMOKE)
#if defined(LOSCFG_TEST_SMOKE)
VOID
ItLosQueue001
(
VOID
);
VOID
ItLosQueue001
(
VOID
);
VOID
ItLosQueue097
(
VOID
);
VOID
ItLosQueue097
(
VOID
);
#if (LOS_MEM_TLSF ==
YES
)
#if (LOS_MEM_TLSF ==
1
)
#else
#else
VOID
ItLosQueue100
(
VOID
);
VOID
ItLosQueue100
(
VOID
);
VOID
ItLosQueue105
(
VOID
);
VOID
ItLosQueue105
(
VOID
);
...
...
testsuites/kernel/src/iCunit.c
浏览文件 @
5db6c623
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include "iCunit.inc"
#include "iCunit.inc"
#include "iCunit_config.h"
#include "iCunit_config.h"
#include "osTest.h"
#include "osTest.h"
#if TEST_RESOURCELEAK_CHECK ==
YES
#if TEST_RESOURCELEAK_CHECK ==
1
#include "los_swtmr_pri.h"
#include "los_swtmr_pri.h"
#include "los_sem_pri.h"
#include "los_sem_pri.h"
#include "los_queue_pri.h"
#include "los_queue_pri.h"
...
@@ -81,7 +81,7 @@ char *g_strModule[] = {"TASK", "MEM", "SEM", "MUX", "EVENT", "QUE", "SWTMR", "HW
...
@@ -81,7 +81,7 @@ char *g_strModule[] = {"TASK", "MEM", "SEM", "MUX", "EVENT", "QUE", "SWTMR", "HW
};
};
UINT32
g_modelNum
=
sizeof
(
g_strModule
)
/
sizeof
(
g_strModule
[
0
]);
UINT32
g_modelNum
=
sizeof
(
g_strModule
)
/
sizeof
(
g_strModule
[
0
]);
#if TEST_MODULE_CHECK ==
YES
#if TEST_MODULE_CHECK ==
1
UINT32
g_failModelResult
[
sizeof
(
g_strModule
)
/
sizeof
(
g_strModule
[
0
])]
=
{
0
};
UINT32
g_failModelResult
[
sizeof
(
g_strModule
)
/
sizeof
(
g_strModule
[
0
])]
=
{
0
};
UINT32
g_passModelResult
[
sizeof
(
g_strModule
)
/
sizeof
(
g_strModule
[
0
])]
=
{
0
};
UINT32
g_passModelResult
[
sizeof
(
g_strModule
)
/
sizeof
(
g_strModule
[
0
])]
=
{
0
};
...
@@ -217,7 +217,7 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase)
...
@@ -217,7 +217,7 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase)
g_iCunitErrLineNo
=
0
;
g_iCunitErrLineNo
=
0
;
g_iCunitErrCode
=
0
;
g_iCunitErrCode
=
0
;
#if TEST_RESOURCELEAK_CHECK ==
YES
#if TEST_RESOURCELEAK_CHECK ==
1
extern
UINT32
LOS_MemTotalUsedGet
(
VOID
*
pPool
);
extern
UINT32
LOS_MemTotalUsedGet
(
VOID
*
pPool
);
extern
HwiHandleForm
g_hwiForm
[
OS_HWI_MAX_NUM
];
extern
HwiHandleForm
g_hwiForm
[
OS_HWI_MAX_NUM
];
extern
SWTMR_CTRL_S
*
g_swtmrCBArray
;
extern
SWTMR_CTRL_S
*
g_swtmrCBArray
;
...
@@ -399,14 +399,14 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase)
...
@@ -399,14 +399,14 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase)
psubCase
->
errLine
=
g_iCunitErrLineNo
;
psubCase
->
errLine
=
g_iCunitErrLineNo
;
psubCase
->
retCode
=
(
0
==
g_iCunitErrLineNo
)
?
(
caseRet
)
:
(
g_iCunitErrCode
);
psubCase
->
retCode
=
(
0
==
g_iCunitErrLineNo
)
?
(
caseRet
)
:
(
g_iCunitErrCode
);
#if TEST_MODULE_CHECK ==
YES
#if TEST_MODULE_CHECK ==
1
g_executModelNum
[
psubCase
->
testcase_module
]
++
;
g_executModelNum
[
psubCase
->
testcase_module
]
++
;
#endif
#endif
ENDING:
ENDING:
if
(
psubCase
->
errLine
==
0
&&
caseRet
==
0
)
{
if
(
psubCase
->
errLine
==
0
&&
caseRet
==
0
)
{
g_passResult
++
;
g_passResult
++
;
#if TEST_MODULE_CHECK ==
YES
#if TEST_MODULE_CHECK ==
1
g_passModelResult
[
psubCase
->
testcase_module
]
++
;
g_passModelResult
[
psubCase
->
testcase_module
]
++
;
#endif
#endif
...
@@ -416,7 +416,7 @@ ENDING:
...
@@ -416,7 +416,7 @@ ENDING:
g_strLevel
[
psubCase
->
testcase_level
],
g_strType
[
psubCase
->
testcase_type
]);
g_strLevel
[
psubCase
->
testcase_level
],
g_strType
[
psubCase
->
testcase_type
]);
}
}
}
else
{
}
else
{
#if TEST_MODULE_CHECK ==
YES
#if TEST_MODULE_CHECK ==
1
if
(
g_failResult
<
50
)
{
// 50
if
(
g_failResult
<
50
)
{
// 50
g_errorCase
[
g_failResult
]
=
*
psubCase
;
g_errorCase
[
g_failResult
]
=
*
psubCase
;
}
}
...
...
testsuites/kernel/src/osTest.c
浏览文件 @
5db6c623
...
@@ -103,7 +103,7 @@ UINT8 g_mIndex;
...
@@ -103,7 +103,7 @@ UINT8 g_mIndex;
UINT32
g_semID3
[
LOSCFG_BASE_IPC_SEM_CONFIG
+
1
];
UINT32
g_semID3
[
LOSCFG_BASE_IPC_SEM_CONFIG
+
1
];
LOS_MEM_POOL_STATUS
g_sysMemStatus
=
{
0
};
LOS_MEM_POOL_STATUS
g_sysMemStatus
=
{
0
};
#if TEST_MODULE_CHECK ==
YES
#if TEST_MODULE_CHECK ==
1
extern
UINT32
g_failModelResult
[];
extern
UINT32
g_failModelResult
[];
extern
UINT32
g_passModelResult
[];
extern
UINT32
g_passModelResult
[];
...
@@ -467,7 +467,7 @@ VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4)
...
@@ -467,7 +467,7 @@ VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4)
g_testCircleCount
=
0
;
g_testCircleCount
=
0
;
dprintf
(
"
\t\n
--- Test start---
\n
"
);
dprintf
(
"
\t\n
--- Test start---
\n
"
);
#if (TEST_LESSER_MEM ==
YES
)
#if (TEST_LESSER_MEM ==
1
)
UINT32
memusedfirst
=
0x600000
;
// 6M for fs or 3M for kernel
UINT32
memusedfirst
=
0x600000
;
// 6M for fs or 3M for kernel
LOS_MEM_POOL_STATUS
status
=
{
0
};
LOS_MEM_POOL_STATUS
status
=
{
0
};
LOS_MemInfoGet
(
OS_SYS_MEM_ADDR
,
&
status
);
LOS_MemInfoGet
(
OS_SYS_MEM_ADDR
,
&
status
);
...
@@ -483,7 +483,7 @@ VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4)
...
@@ -483,7 +483,7 @@ VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4)
TestKernelBase
();
TestKernelBase
();
TestPosix
();
TestPosix
();
#if (TEST_MODULE_CHECK ==
YES
) && defined(LOSCFG_TEST)
#if (TEST_MODULE_CHECK ==
1
) && defined(LOSCFG_TEST)
for
(
int
i
=
0
;
i
<
g_modelNum
-
1
;
i
++
)
{
for
(
int
i
=
0
;
i
<
g_modelNum
-
1
;
i
++
)
{
if
(
g_executModelNum
[
i
]
!=
0
)
{
if
(
g_executModelNum
[
i
]
!=
0
)
{
dprintf
(
"
\n
Executed Model: %s, Executed Model_Num: %d ,failed_count: %d , sucess_count :%d"
,
dprintf
(
"
\n
Executed Model: %s, Executed Model_Num: %d ,failed_count: %d , sucess_count :%d"
,
...
...
testsuites/unittest/common/include/iCunit.h
浏览文件 @
5db6c623
...
@@ -64,7 +64,7 @@ typedef unsigned long iiUINT32;
...
@@ -64,7 +64,7 @@ typedef unsigned long iiUINT32;
#define TEST_MODE (FUNCTION_TEST)
#define TEST_MODE (FUNCTION_TEST)
#define TEST_LESSER_MEM
NO
#define TEST_LESSER_MEM
0
#define TEST_ADD_CASE(string, TestCase, TEST_POSIX, TEST_MEM, TEST_LEVEL0, TEST_FUNCTION) \
#define TEST_ADD_CASE(string, TestCase, TEST_POSIX, TEST_MEM, TEST_LEVEL0, TEST_FUNCTION) \
do { \
do { \
...
...
testsuites/unittest/common/include/los_typedef.h
浏览文件 @
5db6c623
...
@@ -99,16 +99,6 @@ typedef size_t BOOL;
...
@@ -99,16 +99,6 @@ typedef size_t BOOL;
#define NULL ((VOID *)0)
#define NULL ((VOID *)0)
#endif
#endif
#ifdef YES
#undef YES
#endif
#define YES 1
#ifdef NO
#undef NO
#endif
#define NO 0
#define OS_NULL_BYTE ((UINT8)0xFF)
#define OS_NULL_BYTE ((UINT8)0xFF)
#define OS_NULL_SHORT ((UINT16)0xFFFF)
#define OS_NULL_SHORT ((UINT16)0xFFFF)
#define OS_NULL_INT ((UINT32)0xFFFFFFFF)
#define OS_NULL_INT ((UINT32)0xFFFFFFFF)
...
...
testsuites/unittest/common/include/osTest.h
浏览文件 @
5db6c623
...
@@ -249,11 +249,11 @@ UINT32 LosTaskDelay(UINT32 tick);
...
@@ -249,11 +249,11 @@ UINT32 LosTaskDelay(UINT32 tick);
#define HUAWEI_ENV_NFS 0
#define HUAWEI_ENV_NFS 0
#ifndef TEST_RESOURCELEAK_CHECK
#ifndef TEST_RESOURCELEAK_CHECK
#define TEST_RESOURCELEAK_CHECK
YES
#define TEST_RESOURCELEAK_CHECK
1
#endif
#endif
#ifndef TEST_MODULE_CHECK
#ifndef TEST_MODULE_CHECK
#define TEST_MODULE_CHECK
YES
#define TEST_MODULE_CHECK
1
#endif
#endif
extern
UINT32
g_shellTestQueueID
;
extern
UINT32
g_shellTestQueueID
;
...
...
testsuites/unittest/common/osTest.cpp
浏览文件 @
5db6c623
...
@@ -77,7 +77,7 @@ UINT32 g_testCircleCount = 0;
...
@@ -77,7 +77,7 @@ UINT32 g_testCircleCount = 0;
UINT32
g_fatFilesystem
;
UINT32
g_fatFilesystem
;
UINT8
g_mUsIndex
;
UINT8
g_mUsIndex
;
#if TEST_MODULE_CHECK ==
YES
#if TEST_MODULE_CHECK ==
1
extern
UINT32
g_FailModelResult
[];
extern
UINT32
g_FailModelResult
[];
extern
UINT32
g_PassModelResult
[];
extern
UINT32
g_PassModelResult
[];
...
...
testsuites/unittest/liteipc/it_test_liteipc.h
浏览文件 @
5db6c623
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include "osTest.h"
#include "osTest.h"
#include "sys/resource.h"
#include "sys/resource.h"
#define USE_TIMESTAMP
YES
#define USE_TIMESTAMP
1
extern
void
ItPosixLiteIpc001
(
void
);
extern
void
ItPosixLiteIpc001
(
void
);
extern
void
ItPosixLiteIpc002
(
void
);
extern
void
ItPosixLiteIpc002
(
void
);
...
...
testsuites/unittest/liteipc/liteipc.h
浏览文件 @
5db6c623
...
@@ -81,7 +81,7 @@ typedef struct {
...
@@ -81,7 +81,7 @@ typedef struct {
SvcIdentity
target
;
/**< serviceHandle or targetTaskId, depending on type */
SvcIdentity
target
;
/**< serviceHandle or targetTaskId, depending on type */
uint32_t
code
;
uint32_t
code
;
uint32_t
flag
;
uint32_t
flag
;
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
uint64_t
timestamp
;
uint64_t
timestamp
;
#endif
#endif
uint32_t
dataSz
;
/**< size of data */
uint32_t
dataSz
;
/**< size of data */
...
...
testsuites/unittest/liteipc/smgr_demo.cpp
浏览文件 @
5db6c623
...
@@ -71,7 +71,7 @@ void SendReply(int fd, IpcMsg *dataIn, uint32_t result, uint32_t serviceHandle)
...
@@ -71,7 +71,7 @@ void SendReply(int fd, IpcMsg *dataIn, uint32_t result, uint32_t serviceHandle)
data1
.
outMsg
->
target
.
handle
=
dataIn
->
taskID
;
data1
.
outMsg
->
target
.
handle
=
dataIn
->
taskID
;
data1
.
outMsg
->
target
.
token
=
dataIn
->
target
.
token
;
data1
.
outMsg
->
target
.
token
=
dataIn
->
target
.
token
;
data1
.
outMsg
->
code
=
dataIn
->
code
;
data1
.
outMsg
->
code
=
dataIn
->
code
;
#if (USE_TIMESTAMP ==
YES
)
#if (USE_TIMESTAMP ==
1
)
data1
.
outMsg
->
timestamp
=
dataIn
->
timestamp
;
data1
.
outMsg
->
timestamp
=
dataIn
->
timestamp
;
#endif
#endif
ptr
[
0
]
=
result
;
ptr
[
0
]
=
result
;
...
...
testsuites/unittest/liteipc/smoke/liteipc_test_002.cpp
浏览文件 @
5db6c623
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#include "smgr_demo.h"
#include "smgr_demo.h"
#define NEED_BREAK
YES
#define NEED_BREAK
1
static
int
g_ipcFd
;
static
int
g_ipcFd
;
char
g_serviceName
[]
=
"ohos.testservice"
;
char
g_serviceName
[]
=
"ohos.testservice"
;
...
@@ -71,7 +71,7 @@ static int CallTestServiceLoop(uint32_t id)
...
@@ -71,7 +71,7 @@ static int CallTestServiceLoop(uint32_t id)
while
(
1
)
{
while
(
1
)
{
num
++
;
num
++
;
#if (NEED_BREAK ==
YES
)
#if (NEED_BREAK ==
1
)
if
(
num
>
50000
)
{
if
(
num
>
50000
)
{
break
;
break
;
}
}
...
@@ -148,7 +148,7 @@ static int TestServiceLoop(void)
...
@@ -148,7 +148,7 @@ static int TestServiceLoop(void)
gettimeofday
(
&
last_time
,
0
);
gettimeofday
(
&
last_time
,
0
);
while
(
1
)
{
while
(
1
)
{
cnt
++
;
cnt
++
;
#if (NEED_BREAK ==
YES
)
#if (NEED_BREAK ==
1
)
if
(
cnt
>
100000
-
10
)
{
if
(
cnt
>
100000
-
10
)
{
printf
(
"TestServiceLoop break!
\n
"
);
printf
(
"TestServiceLoop break!
\n
"
);
break
;
break
;
...
...
testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp
浏览文件 @
5db6c623
...
@@ -1343,7 +1343,7 @@ HWTEST_F(PosixMqueueTest, ItPosixQueue203, TestSize.Level0)
...
@@ -1343,7 +1343,7 @@ HWTEST_F(PosixMqueueTest, ItPosixQueue203, TestSize.Level0)
ItPosixQueue203
();
ItPosixQueue203
();
}
}
#if (LOSCFG_USER_TEST_SMP ==
YES
)
#if (LOSCFG_USER_TEST_SMP ==
1
)
/**
/**
* @tc.name: IT_POSIX_QUEUE_204
* @tc.name: IT_POSIX_QUEUE_204
* @tc.desc: function for PosixMqueueTest
* @tc.desc: function for PosixMqueueTest
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录