From: Chanwoo Choi Date: Thu, 27 Apr 2023 04:59:44 +0000 (+0900) Subject: halapi: Add support of RISC-V architecture type X-Git-Tag: accepted/tizen/unified/20230607.160240~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28a766b1e13636421c19c601f85668d4505ce68a;p=platform%2Fhal%2Fapi%2Fcommon.git halapi: Add support of RISC-V architecture type Change-Id: I7a41b523735c10973702557734c59ddbde1c8cc3 Reported-by: Woochang Kim Tested-by: Woochang Kim Signed-off-by: Chanwoo Choi --- diff --git a/src/common.h b/src/common.h index 93f7090..e9c5621 100644 --- a/src/common.h +++ b/src/common.h @@ -118,7 +118,7 @@ static inline const char* get_backend_library_name(struct __hal_module_info *inf if (!info) return NULL; -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined (__riscv) return info->library_name_64bit; #else return info->library_name; diff --git a/src/hal-api-common.c b/src/hal-api-common.c index 0984ef8..02a1ad8 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -644,7 +644,7 @@ static int __get_backend_library_data(enum hal_module module, DIR *dir; char *backend_module_name = NULL; int count, i, ret, len; -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined (__riscv) const char hal_backend_path[] = "/hal/lib64"; #else const char hal_backend_path[] = "/hal/lib"; diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index 064ff5f..791ed29 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -115,7 +115,7 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod new_info->module = info->module; new_info->license = info->license; new_info->module_name = g_strdup(info->module_name); -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined(__riscv) new_info->library_name_64bit = g_strdup_printf("/hal/lib64/%s", library_name); #else new_info->library_name = g_strdup_printf("/hal/lib/%s", library_name); diff --git a/tests/unittest/test-hal-api-common.cc b/tests/unittest/test-hal-api-common.cc index c544e76..e2cd0d1 100644 --- a/tests/unittest/test-hal-api-common.cc +++ b/tests/unittest/test-hal-api-common.cc @@ -575,7 +575,7 @@ TEST_P(HalInfoMatchedTest, get_backend_library_name) { ret = hal_common_get_backend_library_name(info.module_, ret_library_name, MAX_BUFF); EXPECT_TRUE(ret == TIZEN_ERROR_NONE); -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined(__riscv) EXPECT_STREQ(info.library_name_64bit_, ret_library_name) << "module name is " << info.module_name_; #else EXPECT_STREQ(info.library_name_, ret_library_name) << "module name is " << info.module_name_;