提交 28df6989 编写于 作者: O openharmony_ci 提交者: Gitee

!185 多核情况下当系统持有调度锁异常时,无异常信息输出

Merge pull request !185 from zhangfanfan2/master
......@@ -189,6 +189,24 @@ STATIC INLINE UINT32 ArchIntUnlock(VOID)
return intSave;
}
STATIC INLINE VOID ArchIrqDisable(VOID)
{
__asm__ __volatile__(
"cpsid i "
:
:
: "memory", "cc");
}
STATIC INLINE VOID ArchIrqEnable(VOID)
{
__asm__ __volatile__(
"cpsie i "
:
:
: "memory", "cc");
}
#else
STATIC INLINE UINT32 ArchIntLock(VOID)
......
......@@ -185,18 +185,29 @@ STATIC INT32 OsDecodeDataFSR(UINT32 regDFSR)
#ifdef LOSCFG_KERNEL_VM
UINT32 OsArmSharedPageFault(UINT32 excType, ExcContext *frame, UINT32 far, UINT32 fsr)
{
PRINT_INFO("page fault entry!!!\n");
BOOL instruction_fault = FALSE;
BOOL instructionFault = FALSE;
UINT32 pfFlags = 0;
UINT32 fsrFlag;
BOOL write = FALSE;
UINT32 ret;
PRINT_INFO("page fault entry!!!\n");
if (OsGetSystemStatus() == OS_SYSTEM_EXC_CURR_CPU) {
return LOS_ERRNO_VM_NOT_FOUND;
}
#if defined(LOSCFG_KERNEL_SMP) && defined(LOSCFG_DEBUG_VERSION)
BOOL irqEnable = !(LOS_SpinHeld(&g_taskSpin) && (OsPercpuGet()->taskLockCnt != 0));
if (irqEnable) {
ArchIrqEnable();
} else {
PrintExcInfo("[ERR][%s] may be held scheduler lock when entering [%s]\n",
OsCurrTaskGet()->taskName, __FUNCTION__);
}
#else
ArchIrqEnable();
#endif
if (excType == OS_EXCEPT_PREFETCH_ABORT) {
instruction_fault = TRUE;
instructionFault = TRUE;
} else {
write = !!BIT_GET(fsr, WNR_BIT);
}
......@@ -214,13 +225,23 @@ UINT32 OsArmSharedPageFault(UINT32 excType, ExcContext *frame, UINT32 far, UINT3
BOOL user = (frame->regCPSR & CPSR_MODE_MASK) == CPSR_MODE_USR;
pfFlags |= write ? VM_MAP_PF_FLAG_WRITE : 0;
pfFlags |= user ? VM_MAP_PF_FLAG_USER : 0;
pfFlags |= instruction_fault ? VM_MAP_PF_FLAG_INSTRUCTION : 0;
pfFlags |= instructionFault ? VM_MAP_PF_FLAG_INSTRUCTION : 0;
pfFlags |= VM_MAP_PF_FLAG_NOT_PRESENT;
return OsVmPageFaultHandler(far, pfFlags, frame);
ret = OsVmPageFaultHandler(far, pfFlags, frame);
break;
}
default:
return LOS_ERRNO_VM_NOT_FOUND;
ret = LOS_ERRNO_VM_NOT_FOUND;
break;
}
#if defined(LOSCFG_KERNEL_SMP) && defined(LOSCFG_DEBUG_VERSION)
if (irqEnable) {
ArchIrqDisable();
}
#else
ArchIrqDisable();
#endif
return ret;
}
#endif
......
......@@ -331,9 +331,7 @@ _osExcPageFault:
MOV R5, R0
MOV R8, R2
MOV R9, R3
CPSIE I
BLX OsArmSharedPageFault
CPSID I
POP_FPU_REGS R1
MOV SP, R4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册