Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 1 | From 98d277655e411f56fba705c0bf2efc6562c23807 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 15 Nov 2020 11:37:33 -0800 |
| 4 | Subject: [PATCH] Add support of arch riscv32 |
| 5 | |
| 6 | Upstream-Status: Submitted [https://github.com/pocoproject/poco/pull/3138] |
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 8 | --- |
| 9 | Foundation/include/Poco/Platform.h | 13 +++++++++---- |
| 10 | 1 file changed, 9 insertions(+), 4 deletions(-) |
| 11 | |
| 12 | diff --git a/Foundation/include/Poco/Platform.h b/Foundation/include/Poco/Platform.h |
| 13 | index 799db417e..b8506a248 100644 |
| 14 | --- a/Foundation/include/Poco/Platform.h |
| 15 | +++ b/Foundation/include/Poco/Platform.h |
| 16 | @@ -135,6 +135,7 @@ |
| 17 | #define POCO_ARCH_AARCH64 0x0f |
| 18 | #define POCO_ARCH_ARM64 0x0f // same as POCO_ARCH_AARCH64 |
| 19 | #define POCO_ARCH_RISCV64 0x10 |
| 20 | +#define POCO_ARCH_RISCV32 0x11 |
| 21 | |
| 22 | |
| 23 | #if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA) |
| 24 | @@ -225,12 +226,16 @@ |
| 25 | #elif defined(__AARCH64EB__) |
| 26 | #define POCO_ARCH POCO_ARCH_AARCH64 |
| 27 | #define POCO_ARCH_BIG_ENDIAN 1 |
| 28 | -#elif defined(__riscv) && (__riscv_xlen == 64) |
| 29 | - #define POCO_ARCH POCO_ARCH_RISCV64 |
| 30 | - #define POCO_ARCH_LITTLE_ENDIAN 1 |
| 31 | +#elif defined(__riscv) |
| 32 | + #if (__riscv_xlen == 64) |
| 33 | + #define POCO_ARCH POCO_ARCH_RISCV64 |
| 34 | + #define POCO_ARCH_LITTLE_ENDIAN 1 |
| 35 | + #elif(__riscv_xlen == 32) |
| 36 | + #define POCO_ARCH POCO_ARCH_RISCV32 |
| 37 | + #define POCO_ARCH_LITTLE_ENDIAN 1 |
| 38 | + #endif |
| 39 | #endif |
| 40 | |
| 41 | - |
| 42 | #if defined(__clang__) |
| 43 | #define POCO_COMPILER_CLANG |
| 44 | #elif defined(_MSC_VER) |
| 45 | -- |
| 46 | 2.29.2 |
| 47 | |