diff options
| author | Bernard Xiong <[email protected]> | 2018-09-23 12:08:44 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-09-23 12:08:44 +0800 |
| commit | b98a0ba804f388f531106ff9602eb22ee66fe751 (patch) | |
| tree | a132d93019f1d6d0ac77c2c34b44ad78f757b134 /libcpu/arm | |
| parent | cf13f84c61c9a38458df0fb9c3ed81679e560ba1 (diff) | |
[Kernel] Add ARMCC 6.x support.
Diffstat (limited to 'libcpu/arm')
| -rw-r--r-- | libcpu/arm/cortex-m4/cpuport.c | 11 | ||||
| -rw-r--r-- | libcpu/arm/cortex-m7/cpuport.c | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/libcpu/arm/cortex-m4/cpuport.c b/libcpu/arm/cortex-m4/cpuport.c index ed7102f844..1d2184c2d7 100644 --- a/libcpu/arm/cortex-m4/cpuport.c +++ b/libcpu/arm/cortex-m4/cpuport.c @@ -22,9 +22,14 @@ #include <rtthread.h> -#define USE_FPU /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ - /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ +#if /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* Clang */ || (defined ( __CLANG_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ /* GNU */ || (defined ( __GNUC__ ) && defined ( __VFP_FP__ ) && !defined(__SOFTFP__)) ) +#define USE_FPU 1 +#else +#define USE_FPU 0 +#endif /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread; @@ -452,7 +457,7 @@ RT_WEAK void rt_hw_cpu_reset(void) * @return return the index of the first bit set. If value is 0, then this function * shall return 0. */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || defined(__CLANG_ARM) __asm int __rt_ffs(int value) { CMP r0, #0x00 diff --git a/libcpu/arm/cortex-m7/cpuport.c b/libcpu/arm/cortex-m7/cpuport.c index ed7102f844..1d2184c2d7 100644 --- a/libcpu/arm/cortex-m7/cpuport.c +++ b/libcpu/arm/cortex-m7/cpuport.c @@ -22,9 +22,14 @@ #include <rtthread.h> -#define USE_FPU /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ - /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ +#if /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* Clang */ || (defined ( __CLANG_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ /* GNU */ || (defined ( __GNUC__ ) && defined ( __VFP_FP__ ) && !defined(__SOFTFP__)) ) +#define USE_FPU 1 +#else +#define USE_FPU 0 +#endif /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread; @@ -452,7 +457,7 @@ RT_WEAK void rt_hw_cpu_reset(void) * @return return the index of the first bit set. If value is 0, then this function * shall return 0. */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || defined(__CLANG_ARM) __asm int __rt_ffs(int value) { CMP r0, #0x00 |
