Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos M
提交
844c5952
K
Kernel Liteos M
项目概览
OpenHarmony
/
Kernel Liteos M
大约 1 年 前同步成功
通知
20
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos M
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
844c5952
编写于
10月 26, 2021
作者:
O
openharmony_ci
提交者:
Gitee
10月 26, 2021
浏览文件
操作
浏览文件
下载
差异文件
!356 系统pend类接口未对软件定时器任务进行限制,容易引发软件定时器任务非正常挂起,出现响应不及时的问题。
Merge pull request !356 from zhangfanfan2/swtmr
上级
3fefeba1
c886629e
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
71 addition
and
7 deletion
+71
-7
kernel/include/los_event.h
kernel/include/los_event.h
+9
-0
kernel/include/los_mux.h
kernel/include/los_mux.h
+10
-0
kernel/include/los_sem.h
kernel/include/los_sem.h
+9
-0
kernel/include/los_task.h
kernel/include/los_task.h
+12
-3
kernel/src/los_event.c
kernel/src/los_event.c
+4
-2
kernel/src/los_mux.c
kernel/src/los_mux.c
+4
-0
kernel/src/los_sem.c
kernel/src/los_sem.c
+3
-0
kernel/src/los_swtmr.c
kernel/src/los_swtmr.c
+3
-2
kernel/src/los_task.c
kernel/src/los_task.c
+17
-0
未找到文件。
kernel/include/los_event.h
浏览文件 @
844c5952
...
...
@@ -155,6 +155,15 @@ extern "C" {
*/
#define LOS_ERRNO_EVENT_SHOULD_NOT_DESTROYED LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x08)
/**
* @ingroup los_event
* Event reading error code: The event is being read in a system-level task.
* Value: 0x02001c09
*
* Solution: Read the event in a valid task.
*/
#define LOS_ERRNO_EVENT_READ_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x09)
/**
* @ingroup los_event
* Event control structure
...
...
kernel/include/los_mux.h
浏览文件 @
844c5952
...
...
@@ -172,6 +172,16 @@ extern "C" {
*/
#define LOS_ERRNO_MUX_MAXNUM_ZERO LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0C)
/**
* @ingroup los_mux
*
* Mutex error code: The API is called in a system-level task, which is forbidden.
* Value: 0x02001d0D
*
* Solution: Do not call the API in system-level tasks.
*/
#define LOS_ERRNO_MUX_PEND_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0D)
/**
* @ingroup los_mux
* @brief Create a mutex.
...
...
kernel/include/los_sem.h
浏览文件 @
844c5952
...
...
@@ -156,6 +156,15 @@ extern "C" {
*/
#define LOS_ERRNO_SEM_MAXNUM_ZERO LOS_ERRNO_OS_ERROR(LOS_MOD_SEM, 0x0A)
/**
* @ingroup los_sem
* Semaphore error code: The API is called in a system-level task, which is forbidden.
* Value: 0x0200070B
*
* Solution: Do not call the API in system-level tasks.
*/
#define LOS_ERRNO_SEM_PEND_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_SEM, 0x0B)
/**
* @ingroup los_sem
* @brief Create a Counting semaphore.
...
...
kernel/include/los_task.h
浏览文件 @
844c5952
...
...
@@ -241,13 +241,14 @@ extern "C" {
/**
* @ingroup los_task
* Task error code: The operation is performed on the
idle
task.
* Task error code: The operation is performed on the
system-level
task.
*
* Value: 0x02000214
*
* Solution: Check the task ID and do not operate on the
idle
task.
* Solution: Check the task ID and do not operate on the
system-level
task.
*/
#define LOS_ERRNO_TSK_OPERATE_IDLE LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14)
#define LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_TSK, 0x14)
#define LOS_ERRNO_TSK_OPERATE_IDLE LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
/**
* @ingroup los_task
...
...
@@ -1284,6 +1285,14 @@ extern UINT32 LOS_TaskDetach(UINT32 taskID);
*/
#define OS_TASK_STATUS_EXIT 0x0100
/**
* @ingroup los_task
* Flag that indicates the task property.
*
* The task is system-level task, like idle, swtmr and etc.
*/
#define OS_TASK_FLAG_SYSTEM_TASK 0x1000U
/**
* @ingroup los_task
* Flag that indicates the task or task control block status.
...
...
kernel/src/los_event.c
浏览文件 @
844c5952
...
...
@@ -108,6 +108,9 @@ LITE_OS_SEC_TEXT UINT32 LOS_EventRead(PEVENT_CB_S eventCB, UINT32 eventMask, UIN
if
(
OS_INT_ACTIVE
)
{
return
LOS_ERRNO_EVENT_READ_IN_INTERRUPT
;
}
if
(
g_losTask
.
runTask
->
taskStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
return
LOS_ERRNO_EVENT_READ_IN_SYSTEM_TASK
;
}
intSave
=
LOS_IntLock
();
ret
=
LOS_EventPoll
(
&
(
eventCB
->
uwEventID
),
eventMask
,
mode
);
OsHookCall
(
LOS_HOOK_TYPE_EVENT_READ
,
eventCB
,
eventMask
,
mode
,
timeOut
);
...
...
@@ -204,6 +207,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_EventDestroy(PEVENT_CB_S eventCB)
OsHookCall
(
LOS_HOOK_TYPE_EVENT_DESTROY
,
eventCB
);
return
LOS_OK
;
}
LITE_OS_SEC_TEXT_MINOR
UINT32
LOS_EventClear
(
PEVENT_CB_S
eventCB
,
UINT32
eventMask
)
{
UINT32
intSave
;
...
...
@@ -216,5 +220,3 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_EventClear(PEVENT_CB_S eventCB, UINT32 eventMa
LOS_IntRestore
(
intSave
);
return
LOS_OK
;
}
kernel/src/los_mux.c
浏览文件 @
844c5952
...
...
@@ -172,6 +172,10 @@ STATIC_INLINE UINT32 OsMuxValidCheck(LosMuxCB *muxPended)
return
LOS_ERRNO_MUX_PEND_IN_LOCK
;
}
if
(
g_losTask
.
runTask
->
taskStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
return
LOS_ERRNO_MUX_PEND_IN_SYSTEM_TASK
;
}
return
LOS_OK
;
}
...
...
kernel/src/los_sem.c
浏览文件 @
844c5952
...
...
@@ -202,6 +202,9 @@ STATIC_INLINE UINT32 OsSemValidCheck(LosSemCB *semPended)
return
LOS_ERRNO_SEM_PEND_IN_LOCK
;
}
if
(
g_losTask
.
runTask
->
taskStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
return
LOS_ERRNO_SEM_PEND_IN_SYSTEM_TASK
;
}
return
LOS_OK
;
}
...
...
kernel/src/los_swtmr.c
浏览文件 @
844c5952
...
...
@@ -116,6 +116,9 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrTaskCreate(VOID)
swtmrTask
.
pcName
=
"Swt_Task"
;
swtmrTask
.
usTaskPrio
=
0
;
ret
=
LOS_TaskCreate
(
&
g_swtmrTaskID
,
&
swtmrTask
);
if
(
ret
==
LOS_OK
)
{
OS_TCB_FROM_TID
(
g_swtmrTaskID
)
->
taskStatus
|=
OS_TASK_FLAG_SYSTEM_TASK
;
}
return
ret
;
}
...
...
@@ -667,5 +670,3 @@ LITE_OS_SEC_TEXT UINT32 LOS_SwtmrDelete(UINT32 swtmrId)
}
#endif
/* (LOSCFG_BASE_CORE_SWTMR == 1) */
kernel/src/los_task.c
浏览文件 @
844c5952
...
...
@@ -876,11 +876,17 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskSuspend(UINT32 taskID)
taskCB
=
OS_TCB_FROM_TID
(
taskID
);
intSave
=
LOS_IntLock
();
tempStatus
=
taskCB
->
taskStatus
;
if
(
tempStatus
&
OS_TASK_STATUS_UNUSED
)
{
retErr
=
LOS_ERRNO_TSK_NOT_CREATED
;
OS_GOTO_ERREND
();
}
if
(
tempStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
retErr
=
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
;
OS_GOTO_ERREND
();
}
if
(
tempStatus
&
OS_TASK_STATUS_SUSPEND
)
{
retErr
=
LOS_ERRNO_TSK_ALREADY_SUSPENDED
;
OS_GOTO_ERREND
();
...
...
@@ -1069,6 +1075,10 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskDelete(UINT32 taskID)
taskCB
=
OS_TCB_FROM_TID
(
taskID
);
intSave
=
LOS_IntLock
();
if
(
taskCB
->
taskStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
LOS_IntRestore
(
intSave
);
return
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
;
}
if
(
taskCB
->
taskStatus
&
OS_TASK_STATUS_UNUSED
)
{
LOS_IntRestore
(
intSave
);
...
...
@@ -1133,6 +1143,9 @@ LITE_OS_SEC_TEXT UINT32 LOS_TaskDelay(UINT32 tick)
return
LOS_ERRNO_TSK_DELAY_IN_LOCK
;
}
if
(
g_losTask
.
runTask
->
taskStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
return
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
;
}
OsHookCall
(
LOS_HOOK_TYPE_TASK_DELAY
,
tick
);
if
(
tick
==
0
)
{
return
LOS_TaskYield
();
...
...
@@ -1201,6 +1214,10 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskPriSet(UINT32 taskID, UINT16 taskPrio)
LOS_IntRestore
(
intSave
);
return
LOS_ERRNO_TSK_NOT_CREATED
;
}
if
(
tempStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
{
LOS_IntRestore
(
intSave
);
return
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
;
}
isReady
=
OsSchedModifyTaskSchedParam
(
taskCB
,
taskPrio
);
LOS_IntRestore
(
intSave
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录