From c251d7bc0e50deb4511cdc7ce5a5f28bd68c390c Mon Sep 17 00:00:00 2001 From: Kim Gunsoo Date: Thu, 3 Nov 2016 12:23:34 +0900 Subject: [PATCH] Modify the type reading CPU architecture type from sysinfo. - To support 64bit CPU architecture, the type reading from sysinfo was changed to string. Change-Id: I88ac5d7ad2e76d4c2a83cb2912fa2db49d3cc809 Signed-off-by: Kim Gunsoo --- src/sdb.c | 41 ++++++++++++----------------------------- src/sdb.h | 3 --- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/src/sdb.c b/src/sdb.c index d421ba7..0d8cf47 100644 --- 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 diff --git a/src/sdb.h b/src/sdb.h index 67f365f..b3b78f3 100644 --- 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 -- 2.7.4