compiler: add __ARM_ARCH, __ARM_FEATURE_DSP macro definition in ghs

when we build mbedtls in vela with ghs compiler, the mbedtls need to
access __ARM_ARCH and __ARM_FEATURE_DSP, and to construct the inline asm
code based on these two macros.
With ghs compiler, these two macros are not defined, and will be
evaluated as 0 by default, and thus will using to wrong inline asm code,
in order to handle this issue, we need to add conversion between the ghs
and gcc with __ARM_ARCH, __ARM_FEATURE_DSP

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao
2024-11-04 14:43:54 +08:00
committed by Xiang Xiao
parent 0679d45d5b
commit 6036a318f4
8 changed files with 32 additions and 0 deletions
+4
View File
@@ -43,6 +43,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 6
#endif
/* Configuration ************************************************************/
/* If this is a kernel build,
+4
View File
@@ -42,6 +42,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 7
#endif
/* IRQ Stack Frame Format:
*
* Context is always saved/restored in the same way:
+4
View File
@@ -42,6 +42,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 7
#endif
/* Configuration ************************************************************/
/* If this is a kernel build, how many nested system calls should we
+4
View File
@@ -42,6 +42,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 7
#endif
/* IRQ Stack Frame Format:
*
* Context is always saved/restored in the same way:
+4
View File
@@ -42,6 +42,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 8
#endif
/* Configuration ************************************************************/
/* If this is a kernel build, how many nested system calls should we
+4
View File
@@ -42,6 +42,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 8
#endif
/* IRQ Stack Frame Format:
*
* Context is always saved/restored in the same way:
+4
View File
@@ -75,6 +75,10 @@
* Pre-processor Prototypes
****************************************************************************/
#if defined(__ghs__) && defined(__ARM_DSP__)
# define __ARM_FEATURE_DSP 1
#endif
#ifndef __ASSEMBLY__
#ifndef up_switch_context
+4
View File
@@ -49,6 +49,10 @@
* Pre-processor Prototypes
****************************************************************************/
#ifdef __ghs__
# define __ARM_ARCH 8
#endif
#define up_getsp() (uintptr_t)__builtin_frame_address(0)
/* MPIDR_EL1, Multiprocessor Affinity Register */