diff --git a/kernel/arch/arm/cortex-m3/keil/los_interrupt.c b/kernel/arch/arm/cortex-m3/keil/los_interrupt.c index 2b7384f29824598b7452ecfa1fa69f3bc7ab7457..92d2cbc9d00944191dae49b69370bc2b8a867aac 100644 --- a/kernel/arch/arm/cortex-m3/keil/los_interrupt.c +++ b/kernel/arch/arm/cortex-m3/keil/los_interrupt.c @@ -273,6 +273,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -520,8 +521,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c b/kernel/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c index ca5fc647f4898a0c5075662941083043ada26549..489abf217517eab442c046ba3d1ac1d4cfad0a1b 100755 --- a/kernel/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c +++ b/kernel/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c @@ -263,6 +263,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -510,8 +511,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c b/kernel/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c index ca5fc647f4898a0c5075662941083043ada26549..489abf217517eab442c046ba3d1ac1d4cfad0a1b 100755 --- a/kernel/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c +++ b/kernel/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c @@ -263,6 +263,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -510,8 +511,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m33/gcc/los_interrupt.c b/kernel/arch/arm/cortex-m33/gcc/los_interrupt.c index 364fd1f5be68efd6810ce61938a5a33afc92b978..68c7ff8e016b3756f898cd19c0a5951d52c01907 100644 --- a/kernel/arch/arm/cortex-m33/gcc/los_interrupt.c +++ b/kernel/arch/arm/cortex-m33/gcc/los_interrupt.c @@ -263,6 +263,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -510,8 +511,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m4/gcc/los_interrupt.c b/kernel/arch/arm/cortex-m4/gcc/los_interrupt.c index 51007500b6c5381a44f809606801b28e4d09e28e..8fadd0b4aa88e84ba60555b9e9c0aacee41eb745 100644 --- a/kernel/arch/arm/cortex-m4/gcc/los_interrupt.c +++ b/kernel/arch/arm/cortex-m4/gcc/los_interrupt.c @@ -273,6 +273,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -530,8 +531,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m4/iar/los_interrupt.c b/kernel/arch/arm/cortex-m4/iar/los_interrupt.c index 1530fbe30c327a552d7e7f9145ff99fefe57eebf..1a6e66e0f07a7f8a26c9cad09fb22eb8e0989508 100644 --- a/kernel/arch/arm/cortex-m4/iar/los_interrupt.c +++ b/kernel/arch/arm/cortex-m4/iar/los_interrupt.c @@ -166,9 +166,7 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID) #endif intSave = LOS_IntLock(); - g_intCount++; - LOS_IntRestore(intSave); hwiIndex = HalIntNumGet(); @@ -276,6 +274,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -523,8 +522,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m7/gcc/los_interrupt.c b/kernel/arch/arm/cortex-m7/gcc/los_interrupt.c index 17e9fab7663d9e8dea82e042154213ebec7535fc..4d3340dcd33b7e86eaba851ed3a411ebbe8ba812 100644 --- a/kernel/arch/arm/cortex-m7/gcc/los_interrupt.c +++ b/kernel/arch/arm/cortex-m7/gcc/los_interrupt.c @@ -263,6 +263,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -510,8 +511,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; } diff --git a/kernel/arch/arm/cortex-m7/iar/los_interrupt.c b/kernel/arch/arm/cortex-m7/iar/los_interrupt.c index 04028be49b9dfca61df43ae121ea4ee1dc706590..69326c9744877d060dde8053dbec8ca1e48c07c5 100644 --- a/kernel/arch/arm/cortex-m7/iar/los_interrupt.c +++ b/kernel/arch/arm/cortex-m7/iar/los_interrupt.c @@ -162,9 +162,7 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID) #endif intSave = LOS_IntLock(); - g_intCount++; - LOS_IntRestore(intSave); hwiIndex = HalIntNumGet(); @@ -272,6 +270,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 HalHwiDelete(HWI_HANDLE_T hwiNum) #define BUSFAULT (1 << 17) #define MEMFAULT (1 << 16) #define DIV0FAULT (1 << 4) +#define UNALIGNFAULT (1 << 3) #define HARDFAULT_IRQN (-13) ExcInfo g_excInfo = {0}; @@ -519,8 +518,9 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID) /* Enable USGFAULT, BUSFAULT, MEMFAULT */ *(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT); + /* Enable DIV 0 and unaligned exception */ - *(volatile UINT32 *)OS_NVIC_CCR |= DIV0FAULT; + *(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT); return; }