Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
3dd32b99
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
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看板
提交
3dd32b99
编写于
12月 26, 2020
作者:
L
likailong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Description: add protect flag to resource task
Reviewed-by: shenwei and zhangfanfan
上级
05e11d40
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
21 addition
and
4 deletion
+21
-4
kernel/base/core/los_process.c
kernel/base/core/los_process.c
+0
-1
kernel/base/core/los_task.c
kernel/base/core/los_task.c
+12
-2
kernel/base/include/los_task_pri.h
kernel/base/include/los_task_pri.h
+8
-0
kernel/common/console.c
kernel/common/console.c
+1
-1
未找到文件。
kernel/base/core/los_process.c
浏览文件 @
3dd32b99
...
...
@@ -610,7 +610,6 @@ STATIC LosProcessCB *OsGetFreePCB(VOID)
if
(
LOS_ListEmpty
(
&
g_freeProcess
))
{
SCHEDULER_UNLOCK
(
intSave
);
PRINT_ERR
(
"No idle PCB in the system!
\n
"
);
__asm__
__volatile__
(
"swi 0"
);
return
NULL
;
}
...
...
kernel/base/core/los_task.c
浏览文件 @
3dd32b99
...
...
@@ -766,7 +766,6 @@ LITE_OS_SEC_TEXT LosTaskCB *OsGetFreeTaskCB(VOID)
if
(
LOS_ListEmpty
(
&
g_losFreeTask
))
{
SCHEDULER_UNLOCK
(
intSave
);
PRINT_ERR
(
"No idle TCB in the system!
\n
"
);
LOS_Panic
(
"**************error***************
\n
"
);
return
NULL
;
}
...
...
@@ -1205,6 +1204,13 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskDelete(UINT32 taskID)
OS_GOTO_ERREND
();
}
if
((
taskCB
->
taskStatus
&
OS_TASK_FLAG_SYSTEM_TASK
)
||
(
taskCB
->
taskStatus
&
OS_TASK_FLAG_NO_DELETE
))
{
SCHEDULER_UNLOCK
(
intSave
);
OsBackTrace
();
__asm__
__volatile__
(
"swi 0"
);
return
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
;
}
processCB
=
OS_PCB_FROM_PID
(
taskCB
->
processID
);
if
(
processCB
->
threadNumber
==
1
)
{
if
(
processCB
==
OsCurrProcessGet
())
{
...
...
@@ -1990,7 +1996,11 @@ LITE_OS_SEC_TEXT UINT32 OsCreateResourceFreeTask(VOID)
taskInitParam
.
uwStackSize
=
OS_TASK_RESOURCE_STATCI_SIZE
;
taskInitParam
.
pcName
=
"ResourcesTask"
;
taskInitParam
.
usTaskPrio
=
OS_TASK_RESOURCE_FREE_PRIORITY
;
return
LOS_TaskCreate
(
&
taskID
,
&
taskInitParam
);
ret
=
LOS_TaskCreate
(
&
taskID
,
&
taskInitParam
);
if
(
ret
==
LOS_OK
)
{
OS_TCB_FROM_TID
(
taskID
)
->
taskStatus
|=
OS_TASK_FLAG_NO_DELETE
;
}
return
ret
;
}
#ifdef __cplusplus
...
...
kernel/base/include/los_task_pri.h
浏览文件 @
3dd32b99
...
...
@@ -211,6 +211,14 @@ extern SPIN_LOCK_S g_taskSpin;
*/
#define OS_TASK_FLAG_SPECIFIES_PROCESS 0x4000U
/**
* @ingroup los_task
* Flag that indicates the task property.
*
* The task is system-level task, like ResourcesTask.
*/
#define OS_TASK_FLAG_NO_DELETE 0x8000U
/**
* @ingroup los_task
* Boundary on which the stack size is aligned.
...
...
kernel/common/console.c
浏览文件 @
3dd32b99
...
...
@@ -1626,7 +1626,7 @@ VOID OsWaitConsoleSendTaskPend(UINT32 taskID)
UINT32
i
;
CONSOLE_CB
*
console
=
NULL
;
LosTaskCB
*
taskCB
=
NULL
;
INT32
waitTime
=
3000
0
;
/* 30000: 30
seconds*/
INT32
waitTime
=
3000
;
/* 3000: 3
seconds*/
for
(
i
=
0
;
i
<
CONSOLE_NUM
;
i
++
)
{
console
=
g_console
[
i
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录