systeminfo: add initial risc-v support for cpu.arch 44/312744/3 accepted/tizen/unified/20240618.195744 accepted/tizen/unified/dev/20240620.004736 accepted/tizen/unified/x/20240618.033354
authorMateusz Bieganski <m.bieganski@samsung.com>
Thu, 13 Jun 2024 14:45:15 +0000 (16:45 +0200)
committerMateusz Bieganski <m.bieganski@samsung.com>
Mon, 17 Jun 2024 10:06:28 +0000 (12:06 +0200)
Change-Id: I212a894b66c7217c6b62af1d12af70a1dfc41611
Signed-off-by: Mateusz Bieganski <m.bieganski@samsung.com>
src/systeminfo/systeminfo_device_capability.cc

index 47d9620e74899e325e2cb864bd7c84e1a20841fc..2b8b9e40082e3a40082e82f0e61583bb468ded69 100644 (file)
@@ -57,6 +57,8 @@ const char* kPlatformCoreArmv8 = "armv8";
 const char* kPlatformCoreAarch64 = "aarch64";
 const char* kPlatformCoreX86 = "x86";
 const char* kPlatformCoreX86_64 = "x86_64";
+const char* kPlatformCoreRISCV64 = "riscv64";
+const char* kPlatformCoreRISCV32 = "riscv32";
 // core fpu arch
 const char* kPlatformCoreSse2 = "sse2";
 const char* kPlatformCoreSse3 = "sse3";
@@ -417,7 +419,29 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreCpuArch(std::string* re
   bool bool_result = false;
   std::string arch = "";
 
-  PlatformResult ret = GetValueStringNative("tizen.org/feature/platform.core.cpu.arch", &arch);
+  PlatformResult ret = GetValueBoolNative("tizen.org/feature/platform.core.cpu.arch.riscv64", &bool_result);
+  if (ret.IsError()) {
+    LoggerE("GetValueBoolNative Error");
+    return ret;
+  }
+
+  if (bool_result) {
+    *return_value = std::string(kPlatformCoreRISCV64);
+    return PlatformResult(ErrorCode::NO_ERROR);
+  }
+
+  ret = GetValueBoolNative("tizen.org/feature/platform.core.cpu.arch.riscv32", &bool_result);
+  if (ret.IsError()) {
+    LoggerE("GetValueBoolNative Error");
+    return ret;
+  }
+
+  if (bool_result) {
+    *return_value = std::string(kPlatformCoreRISCV32);
+    return PlatformResult(ErrorCode::NO_ERROR);
+  }
+
+  ret = GetValueStringNative("tizen.org/feature/platform.core.cpu.arch", &arch);
   if (ret.IsError()) {
     LoggerE("GetValueStringNative Error");
   }