From cf9c8387e3785d994aacf948b7c1b61324a3dd63 Mon Sep 17 00:00:00 2001 From: kenneth Date: Tue, 14 Dec 2021 14:37:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=AD=E6=96=AD=E5=90=91=E9=87=8F?= =?UTF-8?q?=E8=A1=A8=E5=AF=B9=E9=BD=90=E5=A4=A7=E5=B0=8F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据板端实际设置中断向量表对齐大小,支持可配置。 fix #I4M20E Signed-off-by: kenneth --- arch/arm/cortex-m3/keil/los_interrupt.c | 2 +- arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c | 2 +- arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c | 2 +- arch/arm/cortex-m33/iar/NTZ/los_interrupt.c | 2 +- arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c | 2 +- arch/arm/cortex-m4/gcc/los_interrupt.c | 9 ++------- arch/arm/cortex-m4/iar/los_interrupt.c | 2 +- arch/arm/cortex-m7/gcc/los_interrupt.c | 2 +- arch/arm/cortex-m7/iar/los_interrupt.c | 2 +- arch/xtensa/lx6/gcc/los_interrupt.c | 2 +- kernel/include/los_config.h | 8 ++++++++ 11 files changed, 19 insertions(+), 16 deletions(-) diff --git a/arch/arm/cortex-m3/keil/los_interrupt.c b/arch/arm/cortex-m3/keil/los_interrupt.c index 41f3544f..e5c1f50d 100644 --- a/arch/arm/cortex-m3/keil/los_interrupt.c +++ b/arch/arm/cortex-m3/keil/los_interrupt.c @@ -47,7 +47,7 @@ UINT32 g_intCount = 0; #ifdef __ICCARM__ #pragma location = ".data.vector" #elif defined(__CC_ARM) || defined(__GNUC__) -#pragma data_alignment=0x100 +#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN LITE_OS_SEC_VEC #endif /* * diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c b/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c index f0378c8f..c5835fbd 100755 --- a/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c +++ b/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c @@ -49,7 +49,7 @@ UINT32 g_intCount = 0; * @ingroup los_hwi * Hardware interrupt form mapping handling function array. */ -STATIC HWI_PROC_FUNC __attribute__((aligned(0x100))) g_hwiForm[OS_VECTOR_CNT] = {0}; +STATIC HWI_PROC_FUNC __attribute__((aligned(LOSCFG_ARCH_HWI_VECTOR_ALIGN))) g_hwiForm[OS_VECTOR_CNT] = {0}; #if (LOSCFG_PLATFORM_HWI_WITH_ARG == 1) diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c index f0378c8f..c5835fbd 100755 --- a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c +++ b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c @@ -49,7 +49,7 @@ UINT32 g_intCount = 0; * @ingroup los_hwi * Hardware interrupt form mapping handling function array. */ -STATIC HWI_PROC_FUNC __attribute__((aligned(0x100))) g_hwiForm[OS_VECTOR_CNT] = {0}; +STATIC HWI_PROC_FUNC __attribute__((aligned(LOSCFG_ARCH_HWI_VECTOR_ALIGN))) g_hwiForm[OS_VECTOR_CNT] = {0}; #if (LOSCFG_PLATFORM_HWI_WITH_ARG == 1) diff --git a/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c b/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c index b12bb5ac..0477c509 100644 --- a/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c +++ b/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c @@ -46,7 +46,7 @@ UINT32 g_intCount = 0; /*lint -restore*/ #pragma location = ".data.vector" -#pragma data_alignment=0x100 +#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN /* * * @ingroup los_hwi * hardware interrupt form mapping handling function array. diff --git a/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c b/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c index b12bb5ac..0477c509 100644 --- a/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c +++ b/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c @@ -46,7 +46,7 @@ UINT32 g_intCount = 0; /*lint -restore*/ #pragma location = ".data.vector" -#pragma data_alignment=0x100 +#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN /* * * @ingroup los_hwi * hardware interrupt form mapping handling function array. diff --git a/arch/arm/cortex-m4/gcc/los_interrupt.c b/arch/arm/cortex-m4/gcc/los_interrupt.c index 7aa9f794..b1eea747 100644 --- a/arch/arm/cortex-m4/gcc/los_interrupt.c +++ b/arch/arm/cortex-m4/gcc/los_interrupt.c @@ -44,17 +44,12 @@ UINT32 g_intCount = 0; /*lint -restore*/ -#ifdef __ICCARM__ -#pragma location = ".data.vector" -#pragma data_alignment=0x100 -#elif defined(__CC_ARM) || defined(__GNUC__) -LITE_OS_SEC_VEC -#endif + /* * * @ingroup los_hwi * Hardware interrupt form mapping handling function array. */ -STATIC HWI_PROC_FUNC __attribute__((aligned(0x100))) g_hwiForm[OS_VECTOR_CNT] = {0}; +STATIC HWI_PROC_FUNC __attribute__((aligned(LOSCFG_ARCH_HWI_VECTOR_ALIGN))) g_hwiForm[OS_VECTOR_CNT] = {0}; #if (LOSCFG_PLATFORM_HWI_WITH_ARG == 1) diff --git a/arch/arm/cortex-m4/iar/los_interrupt.c b/arch/arm/cortex-m4/iar/los_interrupt.c index fa60e5be..921f98d2 100644 --- a/arch/arm/cortex-m4/iar/los_interrupt.c +++ b/arch/arm/cortex-m4/iar/los_interrupt.c @@ -47,7 +47,7 @@ UINT32 g_intCount = 0; /*lint -restore*/ #ifdef __ICCARM__ #pragma location = ".data.vector" -#pragma data_alignment=0x100 +#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN #elif defined(__CC_ARM) || defined(__GNUC__) LITE_OS_SEC_VEC #endif diff --git a/arch/arm/cortex-m7/gcc/los_interrupt.c b/arch/arm/cortex-m7/gcc/los_interrupt.c index 65c55774..46a99401 100644 --- a/arch/arm/cortex-m7/gcc/los_interrupt.c +++ b/arch/arm/cortex-m7/gcc/los_interrupt.c @@ -49,7 +49,7 @@ UINT32 g_intCount = 0; * @ingroup los_hwi * Hardware interrupt form mapping handling function array. */ -STATIC HWI_PROC_FUNC __attribute__((aligned(0x100))) g_hwiForm[OS_VECTOR_CNT] = {0}; +STATIC HWI_PROC_FUNC __attribute__((aligned(LOSCFG_ARCH_HWI_VECTOR_ALIGN))) g_hwiForm[OS_VECTOR_CNT] = {0}; #if (LOSCFG_PLATFORM_HWI_WITH_ARG == 1) diff --git a/arch/arm/cortex-m7/iar/los_interrupt.c b/arch/arm/cortex-m7/iar/los_interrupt.c index 99f207e4..5d2bd6ee 100644 --- a/arch/arm/cortex-m7/iar/los_interrupt.c +++ b/arch/arm/cortex-m7/iar/los_interrupt.c @@ -46,7 +46,7 @@ UINT32 g_intCount = 0; /*lint -restore*/ #pragma location = ".data.vector" -#pragma data_alignment=0x100 +#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN /* * * @ingroup los_hwi * Hardware interrupt form mapping handling function array. diff --git a/arch/xtensa/lx6/gcc/los_interrupt.c b/arch/xtensa/lx6/gcc/los_interrupt.c index 6cd2879f..05aebef8 100644 --- a/arch/xtensa/lx6/gcc/los_interrupt.c +++ b/arch/xtensa/lx6/gcc/los_interrupt.c @@ -48,7 +48,7 @@ UINT32 g_intCount = 0; * @ingroup los_hwi * Hardware interrupt form mapping handling function array. */ -STATIC HWI_PROC_FUNC __attribute__((aligned(0x100))) g_hwiForm[OS_VECTOR_CNT] = {0}; +STATIC HWI_PROC_FUNC __attribute__((aligned(LOSCFG_ARCH_HWI_VECTOR_ALIGN))) g_hwiForm[OS_VECTOR_CNT] = {0}; #if (LOSCFG_PLATFORM_HWI_WITH_ARG == 1) diff --git a/kernel/include/los_config.h b/kernel/include/los_config.h index 9f81f09a..43993749 100644 --- a/kernel/include/los_config.h +++ b/kernel/include/los_config.h @@ -631,6 +631,14 @@ extern UINT8 *m_aucSysMem0; #define LOSCFG_PLATFORM_HWI_WITH_ARG 0 #endif +/** + * @ingroup los_config + * Configuration item to set interrupt vector align size. + */ +#ifndef LOSCFG_ARCH_HWI_VECTOR_ALIGN +#define LOSCFG_ARCH_HWI_VECTOR_ALIGN 0x100 +#endif + #ifdef __cplusplus #if __cplusplus }