summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-05-13 06:50:19 (GMT)
committer Hanhui <sylixos@gmail.com>2019-04-18 15:50:21 (GMT)
commit9c8b36c18958402f5c4565db454544f0104eed89 (patch)
tree860c42456e61b29ef5c70f970e389d12766b97ae
parente7f7e0875462ccd591148c2014c298119b778591 (diff)
downloadAIC-OS-9c8b36c18958402f5c4565db454544f0104eed89.zip
Fixed process or thread delete run cleanup and atexit must exit kernel space.
-rw-r--r--SylixOS/kernel/interface/ThreadDelete.c2
-rw-r--r--SylixOS/loader/src/loader_vppatch.c2
-rw-r--r--SylixOS/system/ioLib/ioInterface.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/SylixOS/kernel/interface/ThreadDelete.c b/SylixOS/kernel/interface/ThreadDelete.c
index fbd7d9d..7c473ca 100644
--- a/SylixOS/kernel/interface/ThreadDelete.c
+++ b/SylixOS/kernel/interface/ThreadDelete.c
@@ -360,6 +360,8 @@ ULONG API_ThreadDelete (LW_OBJECT_HANDLE *pulId, PVOID pvRetVal)
ptcbCur->TCB_ulThreadSafeCounter++; /* LW_THREAD_SAFE(); */
+ __KERNEL_SPACE_SET2(ptcbDel, 0); /* 目标任务退出内核环境 */
+
__KERNEL_EXIT(); /* 退出内核 */
if (ptcbDel == ptcbCur) {
diff --git a/SylixOS/loader/src/loader_vppatch.c b/SylixOS/loader/src/loader_vppatch.c
index 387aa52..950e55a 100644
--- a/SylixOS/loader/src/loader_vppatch.c
+++ b/SylixOS/loader/src/loader_vppatch.c
@@ -1091,6 +1091,8 @@ VOID vprocExit (LW_LD_VPROC *pvproc, LW_OBJECT_HANDLE ulId, INT iCode)
LW_TCB_GET_CUR_SAFE(ptcbCur);
+ __KERNEL_SPACE_SET2(ptcbCur, 0); /* 当前任务退出内核环境 */
+
__recheck:
#if LW_CFG_THREAD_EXT_EN > 0
_TCBCleanupPopExt(ptcbCur); /* 提前执行 cleanup pop 操作 */
diff --git a/SylixOS/system/ioLib/ioInterface.c b/SylixOS/system/ioLib/ioInterface.c
index 4dae6d9..f5b2948 100644
--- a/SylixOS/system/ioLib/ioInterface.c
+++ b/SylixOS/system/ioLib/ioInterface.c
@@ -276,7 +276,7 @@ __error_handle:
** 函数名称: mknod
** 功能描述: create a new file named by the pathname to which the argument path points.
** 输 入 : pcFifoName 目录名
-** mode 方式 (目前未使用)
+** mode 类型
** dev 目前未使用
** 输 出 : ERROR_NONE 没有错误
** 其他值表示错误