Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
d724a975
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看板
提交
d724a975
编写于
5月 14, 2021
作者:
O
openharmony_ci
提交者:
Gitee
5月 14, 2021
浏览文件
操作
浏览文件
下载
差异文件
!234 用户态异常处理,进程退出时恢复系统正常运行的过程依赖编译器行为,存在风险
Merge pull request !234 from zhushengle/exc
上级
842399a4
e840188a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
16 deletion
+16
-16
arch/arm/arm/src/include/los_exc_pri.h
arch/arm/arm/src/include/los_exc_pri.h
+0
-5
arch/arm/arm/src/los_exc.c
arch/arm/arm/src/los_exc.c
+9
-11
arch/arm/arm/src/los_hw_exc.S
arch/arm/arm/src/los_hw_exc.S
+7
-0
未找到文件。
arch/arm/arm/src/include/los_exc_pri.h
浏览文件 @
d724a975
...
...
@@ -40,11 +40,6 @@ extern "C" {
#endif
/* __cplusplus */
#endif
/* __cplusplus */
STATIC
INLINE
VOID
OsSetCurrCpuSp
(
UINTPTR
regSp
)
{
__asm__
__volatile__
(
"mov sp, %0"
::
"r"
(
regSp
));
}
#define OS_SYSTEM_NORMAL 0
#define OS_SYSTEM_EXC_CURR_CPU 1
#define OS_SYSTEM_EXC_OTHER_CPU 2
...
...
arch/arm/arm/src/los_exc.c
浏览文件 @
d724a975
...
...
@@ -525,7 +525,7 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr)
}
}
STATIC
VOID
OsExcRestore
(
UINTPTR
taskStackPointer
)
STATIC
VOID
OsExcRestore
(
VOID
)
{
UINT32
currCpuID
=
ArchCurrCpuid
();
...
...
@@ -536,8 +536,6 @@ STATIC VOID OsExcRestore(UINTPTR taskStackPointer)
OsPercpuGet
()
->
excFlag
=
CPU_RUNNING
;
#endif
OsPercpuGet
()
->
taskLockCnt
=
0
;
OsSetCurrCpuSp
(
taskStackPointer
);
}
STATIC
VOID
OsUserExcHandle
(
ExcContext
*
excBufAddr
)
...
...
@@ -564,8 +562,6 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr)
#endif
runProcess
->
processStatus
&=
~
OS_PROCESS_FLAG_EXIT
;
OsExcRestore
(
excBufAddr
->
SP
);
#if (LOSCFG_KERNEL_SMP == YES)
#ifdef LOSCFG_FS_VFS
OsWakeConsoleSendTask
();
...
...
@@ -577,6 +573,9 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr)
#endif
OsProcessExitCodeSignalSet
(
runProcess
,
SIGUSR2
);
/* Exception handling All operations should be kept prior to that operation */
OsExcRestore
();
/* kill user exc process */
LOS_Exit
(
OS_PRO_EXIT_OK
);
...
...
@@ -962,7 +961,7 @@ STATIC VOID OsWaitOtherCoresHandleExcEnd(UINT32 currCpuID)
}
}
STATIC
VOID
OsCheckAllCpuStatus
(
UINTPTR
taskStackPointer
)
STATIC
VOID
OsCheckAllCpuStatus
(
VOID
)
{
UINT32
currCpuID
=
ArchCurrCpuid
();
UINT32
ret
,
target
;
...
...
@@ -982,7 +981,7 @@ STATIC VOID OsCheckAllCpuStatus(UINTPTR taskStackPointer)
}
else
if
(
g_excFromUserMode
[
currCpuID
]
==
TRUE
)
{
if
(
OsCurrProcessGet
()
->
processID
==
g_currHandleExcPID
)
{
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
OsExcRestore
(
taskStackPointer
);
OsExcRestore
();
while
(
1
)
{
ret
=
LOS_TaskSuspend
(
OsCurrTaskGet
()
->
taskID
);
PrintExcInfo
(
"%s supend task :%u failed: 0x%x
\n
"
,
__FUNCTION__
,
OsCurrTaskGet
()
->
taskID
,
ret
);
...
...
@@ -1010,12 +1009,11 @@ STATIC VOID OsCheckAllCpuStatus(UINTPTR taskStackPointer)
}
#endif
STATIC
VOID
OsCheckCpuStatus
(
UINTPTR
taskStackPointer
)
STATIC
VOID
OsCheckCpuStatus
(
VOID
)
{
#if (LOSCFG_KERNEL_SMP == YES)
OsCheckAllCpuStatus
(
taskStackPointer
);
OsCheckAllCpuStatus
();
#else
(
VOID
)
taskStackPointer
;
g_currHandleExcCpuID
=
ArchCurrCpuid
();
#endif
}
...
...
@@ -1036,7 +1034,7 @@ LITE_OS_SEC_TEXT VOID STATIC OsExcPriorDisposal(ExcContext *excBufAddr)
g_excFromUserMode
[
ArchCurrCpuid
()]
=
FALSE
;
}
OsCheckCpuStatus
(
excBufAddr
->
SP
);
OsCheckCpuStatus
();
if
(
g_excFromUserMode
[
ArchCurrCpuid
()]
==
TRUE
)
{
while
(
1
)
{
...
...
arch/arm/arm/src/los_hw_exc.S
浏览文件 @
d724a975
...
...
@@ -371,6 +371,13 @@ _osExceptDispatch:
MOV
R1
,
SP
#ifdef LOSCFG_KERNEL_VM
LDR
R2
,
[
SP
,
#(
19
*
4
)]
@
Get
CPSR
AND
R2
,
R2
,
#
CPSR_MASK_MODE
@
Interrupted
mode
CMP
R2
,
#
CPSR_USER_MODE
@
User
mode
BEQ
_osExceptionGetSP
#endif
EXC_SP_SET
__exc_stack_top
,
OS_EXC_STACK_SIZE
,
R6
,
R7
MRC
P15
,
0
,
R4
,
C0
,
C0
,
5
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录