diff options
| author | Fan YANG <[email protected]> | 2023-08-11 21:05:52 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2023-08-11 21:20:28 -0400 |
| commit | 5308cc47161d8e2f9fdb680738e023ef16af1e2b (patch) | |
| tree | 57ab3fe5b80c648d639c114d73e4bbdfd7f8ea66 /libcpu | |
| parent | f53fc15f034e09c093705f037cd7f010f7cf2511 (diff) | |
[libcpu][risc-v][common] Fix application crash on risc-v soc if FPU is
enabled
- Defined ARCH_RISCV_FPU once the __riscv_flen macro was detected
Signed-off-by: Fan YANG <[email protected]>
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/risc-v/common/cpuport.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libcpu/risc-v/common/cpuport.h b/libcpu/risc-v/common/cpuport.h index 06ee9c94ac..e485e91a4f 100644 --- a/libcpu/risc-v/common/cpuport.h +++ b/libcpu/risc-v/common/cpuport.h @@ -8,6 +8,7 @@ * 2018-10-03 Bernard The first version * 2020/11/20 BalanceTWK Add FPU support * 2023/01/04 WangShun Adapt to CH32 + * 2023/08/11 HPMicro Define ARCH_RISCV_FPU if FPU is enabled */ #ifndef CPUPORT_H__ @@ -29,10 +30,12 @@ typedef union { /* Preprocessor Definition */ #if __riscv_flen == 32 +#define ARCH_RISCV_FPU #define ARCH_RISCV_FPU_S #endif #if __riscv_flen == 64 +#define ARCH_RISCV_FPU #define ARCH_RISCV_FPU_D #endif |
