Improve RISC-V support

Check __riscv_xlen == 64 rather than _LP64 and define _LP64 if missing.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Brooks Davis <brooks.davis@sri.com>
Closes #14128
This commit is contained in:
Brooks Davis 2022-10-28 00:58:41 +01:00 committed by Brian Behlendorf
parent da3d266672
commit 5229071ba1
2 changed files with 10 additions and 2 deletions

View File

@ -206,9 +206,13 @@
* RISC-V arch specific defines
* only RV64G (including atomic) LP64 is supported yet
*/
#elif defined(__riscv) && defined(_LP64) && _LP64 && \
#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 && \
defined(__riscv_atomic) && __riscv_atomic
#if !defined(_LP64)
#define _LP64 1
#endif
#ifndef __riscv__
#define __riscv__
#endif

View File

@ -227,9 +227,13 @@ extern "C" {
* RISC-V arch specific defines
* only RV64G (including atomic) LP64 is supported yet
*/
#elif defined(__riscv) && defined(_LP64) && _LP64 && \
#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 && \
defined(__riscv_atomic) && __riscv_atomic
#if !defined(_LP64)
#define _LP64 1
#endif
#ifndef __riscv__
#define __riscv__
#endif