Modify the type reading CPU architecture type from sysinfo. 51/95351/1
authorKim Gunsoo <gunsoo83.kim@samsung.com>
Thu, 3 Nov 2016 03:23:34 +0000 (12:23 +0900)
committerKim Gunsoo <gunsoo83.kim@samsung.com>
Thu, 3 Nov 2016 03:23:34 +0000 (12:23 +0900)
- To support 64bit CPU architecture, the type reading from
  sysinfo was changed to string.

Change-Id: I88ac5d7ad2e76d4c2a83cb2912fa2db49d3cc809
Signed-off-by: Kim Gunsoo <gunsoo83.kim@samsung.com>
src/sdb.c
src/sdb.h

index d421ba7..0d8cf47 100644 (file)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -1943,33 +1943,6 @@ int request_plugin_verification(const char* cmd, const char* in_buf) {
     return 1;
 }
 
-static char* get_cpu_architecture()
-{
-    int ret = 0;
-    bool b_value = false;
-
-    ret = system_info_get_platform_bool(
-            "http://tizen.org/feature/platform.core.cpu.arch.armv6", &b_value);
-    if (ret == SYSTEM_INFO_ERROR_NONE && b_value) {
-        return CPUARCH_ARMV6;
-    }
-
-    ret = system_info_get_platform_bool(
-            "http://tizen.org/feature/platform.core.cpu.arch.armv7", &b_value);
-    if (ret == SYSTEM_INFO_ERROR_NONE && b_value) {
-        return CPUARCH_ARMV7;
-    }
-
-    ret = system_info_get_platform_bool(
-            "http://tizen.org/feature/platform.core.cpu.arch.x86", &b_value);
-    if (ret == SYSTEM_INFO_ERROR_NONE && b_value) {
-        return CPUARCH_X86;
-    }
-
-    D("fail to get the CPU architecture of model:%d\n", errno);
-    return UNKNOWN;
-}
-
 static void init_capabilities(void) {
     int ret = -1;
     char *value = NULL;
@@ -1977,8 +1950,18 @@ static void init_capabilities(void) {
     memset(&g_capabilities, 0, sizeof(g_capabilities));
 
     // CPU Architecture of model
-    snprintf(g_capabilities.cpu_arch, sizeof(g_capabilities.cpu_arch),
-                "%s", get_cpu_architecture());
+    ret = system_info_get_platform_string("http://tizen.org/feature/platform.core.cpu.arch", &value);
+    if (ret != SYSTEM_INFO_ERROR_NONE) {
+        snprintf(g_capabilities.cpu_arch, sizeof(g_capabilities.cpu_arch),
+                    "%s", UNKNOWN);
+        D("fail to get the CPU architecture of model:%d\n", errno);
+    } else {
+        snprintf(g_capabilities.cpu_arch, sizeof(g_capabilities.cpu_arch),
+                    "%s", value);
+        if (value != NULL) {
+            free(value);
+        }
+    }
 
 
     // Secure protocol support
index 67f365f..b3b78f3 100644 (file)
--- a/src/sdb.h
+++ b/src/sdb.h
@@ -240,9 +240,6 @@ typedef struct platform_info {
 
 #define ENABLED "enabled"
 #define DISABLED "disabled"
-#define CPUARCH_ARMV6 "armv6"
-#define CPUARCH_ARMV7 "armv7"
-#define CPUARCH_X86 "x86"
 #define CAPBUF_SIZE 4096
 #define CAPBUF_ITEMSIZE 32
 #define CAPBUF_L_ITEMSIZE 256