Compare commits

...

9 Commits

Author SHA1 Message Date
openharmony_ci 3d8536b450
!1122 liteos_m cpup 中断索引值越界修复
Merge pull request !1122 from hw_llm/master
2024-09-02 12:36:22 +00:00
hw_llm 413b08295d Description: liteos_m cpup 中断索引值越界修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_m/issues/I9RHZ7
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-08-29 15:28:16 +08:00
openharmony_ci 10e00b3047
!1120 【修复】OAT告警
Merge pull request !1120 from 石子怡/master
2024-06-05 08:04:36 +00:00
石子怡 88fd668b8f
修复OAT告警
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-06-05 06:47:40 +00:00
openharmony_ci ddaad05097
!1116 clear systick pending status
Merge pull request !1116 from hw_llm/master
2024-05-29 05:00:53 +00:00
openharmony_ci c739d4a164
!1114 【修复】OAT告警
Merge pull request !1114 from 石子怡/master
2024-05-27 11:39:31 +00:00
hw_llm 92fbcaf074 Description: clear systick pending status
IssueNo: https://gitee.com/openharmony/kernel_liteos_m/issues/I93ZUQ
Feature Or Bugfix: Feature
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-05-25 11:03:53 +08:00
石子怡 441d552355
修复OAT告警
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-05-25 02:21:53 +00:00
石子怡 e151e8369b
修复OAT告警
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-05-25 01:17:11 +00:00
16 changed files with 40 additions and 30 deletions

View File

@ -67,6 +67,9 @@
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--> <!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->
</filefilter> </filefilter>
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies"> <filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
<filteritem type="filepath"
name="figures/architecture-of-openharmony-the-liteos-cortex-m-kernel.png" desc="architecture-of-openharmony-the-liteos-cortex-m-kernel"/>
<filteritem type="filepath" name="figures/OpenHarmony-LiteOS-M核内核架构图.png" desc="内核驱动架构"/>
<!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/--> <!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/--> <!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/--> <!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->

View File

@ -86,7 +86,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;

View File

@ -85,7 +85,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -85,7 +85,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -85,7 +85,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -84,7 +84,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */ SysTick->LOAD = (UINT32)(nextResponseTime - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
NVIC_ClearPendingIRQ(SysTick_IRQn); SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
return nextResponseTime; return nextResponseTime;
} }

View File

@ -110,6 +110,12 @@ typedef struct {
*/ */
#define OS_RISCV_VECTOR_CNT (OS_RISCV_SYS_VECTOR_CNT + OS_RISCV_CUSTOM_IRQ_VECTOR_CNT) #define OS_RISCV_VECTOR_CNT (OS_RISCV_SYS_VECTOR_CNT + OS_RISCV_CUSTOM_IRQ_VECTOR_CNT)
/**
* @ingroup los_arch_interrupt
* Count of risc-v system interrupt vector.
*/
#define OS_SYS_VECTOR_CNT 0
/** /**
* Maximum number of supported hardware devices that generate hardware interrupts. * Maximum number of supported hardware devices that generate hardware interrupts.
* The maximum number of hardware devices that generate hardware interrupts supported by hi3518ev200 is 32. * The maximum number of hardware devices that generate hardware interrupts supported by hi3518ev200 is 32.

View File

@ -616,11 +616,11 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_CpupUsageMonitor(CPUP_TYPE_E type, CPUP_MODE_E
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1) #if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqStart(UINT32 intNum) LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqStart(UINT32 intNum)
{ {
if (g_irqCpupInitFlg == 0) { if ((g_irqCpupInitFlg == 0) || (intNum < OS_SYS_VECTOR_CNT)) {
return; return;
} }
UINT32 cpupIntNum = intNum - OS_SYS_VECTOR_CNT;
g_irqCpup[intNum].startTime = CpupTimeUsGet(); g_irqCpup[cpupIntNum].startTime = CpupTimeUsGet();
return; return;
} }
@ -629,33 +629,34 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT32 intNum)
UINT64 cpuTime; UINT64 cpuTime;
UINT64 usedTime; UINT64 usedTime;
if (g_irqCpupInitFlg == 0) { if ((g_irqCpupInitFlg == 0) || (intNum < OS_SYS_VECTOR_CNT)) {
return; return;
} }
if (g_irqCpup[intNum].startTime == 0) { UINT32 cpupIntNum = intNum - OS_SYS_VECTOR_CNT;
if (g_irqCpup[cpupIntNum].startTime == 0) {
return; return;
} }
cpuTime = CpupTimeUsGet(); cpuTime = CpupTimeUsGet();
if (cpuTime < g_irqCpup[intNum].startTime) { if (cpuTime < g_irqCpup[cpupIntNum].startTime) {
cpuTime += OS_US_PER_TICK; cpuTime += OS_US_PER_TICK;
} }
g_irqCpup[intNum].cpupID = intNum; g_irqCpup[cpupIntNum].cpupID = intNum;
g_irqCpup[intNum].status = OS_CPUP_USED; g_irqCpup[cpupIntNum].status = OS_CPUP_USED;
usedTime = cpuTime - g_irqCpup[intNum].startTime; usedTime = cpuTime - g_irqCpup[cpupIntNum].startTime;
if (g_irqCpup[intNum].count <= 1000) { /* 1000, Take 1000 samples */ if (g_irqCpup[cpupIntNum].count <= 1000) { /* 1000, Take 1000 samples */
g_irqCpup[intNum].allTime += usedTime; g_irqCpup[cpupIntNum].allTime += usedTime;
g_irqCpup[intNum].count++; g_irqCpup[cpupIntNum].count++;
} else { } else {
g_irqCpup[intNum].allTime = 0; g_irqCpup[cpupIntNum].allTime = 0;
g_irqCpup[intNum].count = 0; g_irqCpup[cpupIntNum].count = 0;
} }
g_irqCpup[intNum].startTime = 0; g_irqCpup[cpupIntNum].startTime = 0;
if (usedTime > g_irqCpup[intNum].timeMax) { if (usedTime > g_irqCpup[cpupIntNum].timeMax) {
g_irqCpup[intNum].timeMax = usedTime; g_irqCpup[cpupIntNum].timeMax = usedTime;
} }
return; return;
} }