halapi: Add support of RISC-V architecture type 93/292093/1
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 27 Apr 2023 04:59:44 +0000 (13:59 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 27 Apr 2023 07:11:41 +0000 (16:11 +0900)
Change-Id: I7a41b523735c10973702557734c59ddbde1c8cc3
Reported-by: Woochang Kim <wchang.kim@samsung.com>
Tested-by: Woochang Kim <wchang.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/common.h
src/hal-api-common.c
src/hal-api-conf.c
tests/unittest/test-hal-api-common.cc

index 93f7090..e9c5621 100644 (file)
@@ -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;
index 0984ef8..02a1ad8 100644 (file)
@@ -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";
index 064ff5f..791ed29 100644 (file)
@@ -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);
index c544e76..e2cd0d1 100644 (file)
@@ -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_;