plugin-api: common: Remove abi_version module 48/308048/1 accepted/tizen/8.0/unified/20240318.143236
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 14 Mar 2024 08:04:43 +0000 (17:04 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Fri, 15 Mar 2024 11:03:35 +0000 (20:03 +0900)
system-plugin-backend packcages don't need to check the ABI (Application
Binary Interface) version because libsyscommon-plugin-api and
system-plguin-backend packages have been built always together.

Change-Id: I45272586624a0449e9b86cb33a912a99a1e5dbcb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/plugin-api/common/include/system/syscommon-plugin-common-interface.h
src/plugin-api/common/include/system/syscommon-plugin-common.h
src/plugin-api/common/src/common.h
src/plugin-api/common/src/syscommon-plugin-api-common.c
src/plugin-api/common/src/syscommon-plugin-api-conf.c
src/plugin-api/common/src/syscommon-plugin-api-conf.h
src/plugin-api/common/src/syscommon-plugin-api-list.h

index 7172d6502207ad762354272c6ac78309f9114f6a..a30f700022d9361f3357d94d0ddccac761394345 100644 (file)
 extern "C" {
 #endif
 
-enum syscommon_plugin_abi_version {
-       SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN = 0,
-       SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_7_0,
-       SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-       SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_9_0,
-       SYSCOMMON_PLUGIN_ABI_VERSION_END,
-};
-
-static const char *const syscommon_plugin_abi_version_str[] = {
-       [SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN]          = "Unknown PLUGIN ABI Version",
-       [SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_7_0]        = "PLUGIN_ABI_VERSION_TIZEN_7_0",
-       [SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0]        = "PLUGIN_ABI_VERSION_TIZEN_8_0",
-       [SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_9_0]        = "PLUGIN_ABI_VERSION_TIZEN_9_0",
-};
-
 typedef struct __syscommon_plugin_backend {
        const char *name;
        const char *vendor;
-       const unsigned int abi_version;
        int (*init) (void **data);
        int (*exit) (void *data);
 } syscommon_plugin_backend;
index 81d108133d47cef5222bd11d7bae1943d27e3a79..7993c080a1c517f022f9836698f0b76b2f9677d4 100644 (file)
@@ -105,24 +105,6 @@ int syscommon_plugin_common_put_backend_with_library_name(
                                        enum syscommon_plugin_module module,
                                        void *data, const char *library_name);
 
-/**
- * @brief Check PLUGIN ABI version whehter is suppored or not on current platform
- * @param[in] PLUGIN module id among enum plugin_moudle
- * @param[in] PLUGIN ABI version of backend module among enum plugin_abi_version
- * @return @c 0 on success, otherwise a negative error value
- */
-int syscommon_plugin_common_check_backend_abi_version(
-                               enum syscommon_plugin_module module,
-                               enum syscommon_plugin_abi_version abi_version);
-
-/**
- * @brief Get the backend PLUGIN ABI version according to the type of PLUGIN module
- * @param[in] PLUGIN module id among enum plugin_moudle
- * @return @c positive integer value on success, otherwise a zero error value
- */
-unsigned int syscommon_plugin_common_get_backend_abi_version(
-                                       enum syscommon_plugin_module module);
-
 /**
  * @brief Get the backend name according to the type of PLUGIN module
  * @param[in] PLUGIN module id among enum plugin_moudle
index e654ddc21b0500e050f86614fb86a71838b57c68..d6a370d8caf36982726bb1771f1dd2037d639cd8 100644 (file)
@@ -58,26 +58,6 @@ static const char *const plugin_group_string[] = {
        [PLUGIN_GROUP_UPDATE_CONTROL]   = "PLUGIN_GROUP_UPDATE_CONTROL",
 };
 
-/**
- * syscommon-plugin-api-common provides the PLUGIN ABI * (Application Binary Interface)
- * version check feature which is used to check the ABI compatibility between
- * PLUGIN API package and PLUGIN backend package.
- * In order to compare ABI version between two binary, Tizen core platform
- * always must maintain the current PLUGIN ABI version.
- * So that, define the below global variable (g_platform_curr_abi_version).
- *
- * 'g_platform_curr_abi_version' will be used for all PLUGIN API modules,
- * to check whether PLUGIN backend ABI version of each module is supported
- * or not with current PLUGIN ABI version.
- *
- * 'g_platform_curr_abi_version' must be updated when Tizen platform will be
- * released officially.
- */
-struct plugin_abi_version_match {
-       enum syscommon_plugin_abi_version platform_abi_version;
-       enum syscommon_plugin_abi_version backend_min_abi_version;
-};
-
 struct __plugin_module_info {
        int usage_count;
 
@@ -92,9 +72,6 @@ struct __plugin_module_info {
        void *handle;
        syscommon_plugin_backend *backend;
        char *symbol_name;
-
-       unsigned int num_abi_versions;
-       struct plugin_abi_version_match *abi_versions;
 };
 
 static inline const char* get_backend_library_name(struct __plugin_module_info *info)
index a22bdad11d60554f71d794962b609d42c73094c6..6127858eb9dc2fa8244c3f0fc85cf7481c774eb6 100644 (file)
@@ -46,7 +46,6 @@ extern char *program_invocation_name;
 #define EXPORT __attribute__ ((visibility("default")))
 #endif
 
-static enum syscommon_plugin_abi_version g_platform_curr_abi_version;
 G_LOCK_DEFINE_STATIC(plugin_common_lock);
 
 EXPORT
@@ -234,14 +233,6 @@ static int __init_backend(struct __plugin_module_info *info, void **data,
                return -EINVAL;
        }
 
-       /* Check PLUGIN ABI Version */
-       ret = syscommon_plugin_common_check_backend_abi_version(info->module,
-                                               info->backend->abi_version);
-       if (ret < 0) {
-               _E("%s: Failed to check ABI version\n", info->module_name);
-               return -EINVAL;
-       }
-
        /* Initialize backend */
        ret = info->backend->init(data);
        if (ret < 0) {
@@ -399,7 +390,7 @@ out:
        return ret;
 }
 
-static int __get_backend_data(enum syscommon_plugin_module module, unsigned int *abi_version,
+static int __get_backend_data(enum syscommon_plugin_module module,
                        char *name, int name_size, char *vendor, int vendor_size)
 {
        struct __plugin_module_info *info = NULL;
@@ -413,14 +404,14 @@ static int __get_backend_data(enum syscommon_plugin_module module, unsigned int
        G_LOCK(plugin_common_lock);
 
        if (_plugin_api_conf_init()) {
-               ret = SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN;
+               ret = -EINVAL;
                goto err_unlock;
        }
 
        info = _plugin_api_conf_get_module_info(module, NULL);
        if (info == NULL) {
                _E("Failed to get PLUGIN module(%d) information\n", module);
-               ret = SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN;
+               ret = -EINVAL;
                goto err_conf_exit;
        }
 
@@ -428,12 +419,8 @@ static int __get_backend_data(enum syscommon_plugin_module module, unsigned int
        if (ret < 0)
                goto err_conf_exit;
 
-       /* Return abi_verion of plugin_backend structure */
-       if (!name_size && !vendor_size) {
-               *abi_version = info->backend->abi_version;
-
        /* Return name of plugin_backend structure */
-       } else if (info->backend->name && name_size && !vendor_size) {
+       if (info->backend->name && name_size && !vendor_size) {
                len = strlen(info->backend->name);
 
                if (!info->backend->name || (len + 1 > name_size)) {
@@ -495,115 +482,16 @@ int syscommon_plugin_common_put_backend_with_library_name(enum syscommon_plugin_
        return __put_backend(module, data, library_name);
 }
 
-EXPORT
-int syscommon_plugin_common_check_backend_abi_version(enum syscommon_plugin_module module,
-                               enum syscommon_plugin_abi_version abi_version)
-{
-       struct __plugin_module_info *info = NULL;
-       int i;
-       int ret;
-
-       /* Check parameter whether is valid or not */
-       if (module <= SYSCOMMON_PLUGIN_MODULE_UNKNOWN || module >= SYSCOMMON_PLUGIN_MODULE_END) {
-               _E("Invalid paramer of PLUGIN module(%d)\n", module);
-               return -EINVAL;
-       }
-
-       if (abi_version <= SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN
-                       || abi_version >= SYSCOMMON_PLUGIN_ABI_VERSION_END) {
-               _E("Invalid paramer of PLUGIN ABI version(%d) for PLUGIN module(%d)\n",
-                               abi_version, module);
-               return -EINVAL;
-       }
-
-       if (_plugin_api_conf_init())
-               return -EINVAL;
-
-       info = _plugin_api_conf_get_module_info(module, NULL);
-       if (info == NULL) {
-               _E("Failed to get PLUGIN module(%d) information\n", module);
-               ret = -EINVAL;
-               goto out;
-       }
-
-       if (!info->num_abi_versions
-                       || !info->abi_versions) {
-               _E("%s: Doesn't have the ABI version information\n",
-                                               info->module_name);
-               ret = -EINVAL;
-               goto out;
-       }
-
-       g_platform_curr_abi_version = _plugin_api_conf_get_platform_abi_version();
-
-       if (g_platform_curr_abi_version <= SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN
-                       || g_platform_curr_abi_version >= SYSCOMMON_PLUGIN_ABI_VERSION_END) {
-               _E("Invalid paramer of current PLUGIN ABI version(%d)(%d)\n",
-                               g_platform_curr_abi_version, module);
-               ret = -EINVAL;
-               goto out;
-       }
-
-       for (i = 0; i < info->num_abi_versions; i++) {
-               struct plugin_abi_version_match *data
-                               = &info->abi_versions[i];
-
-               if (g_platform_curr_abi_version != data->platform_abi_version)
-                       continue;
-
-               if (data->backend_min_abi_version <= SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN ||
-                       data->backend_min_abi_version >= SYSCOMMON_PLUGIN_ABI_VERSION_END) {
-                       _E("%s: abi_versions[%d].backend_min_abi_version(%d) is invalid\n",
-                               info->module_name, i, data->backend_min_abi_version);
-                       ret = -EINVAL;
-                       goto out;
-               }
-
-               if (abi_version <= data->platform_abi_version
-                               && abi_version >= data->backend_min_abi_version) {
-                       ret = 0;
-                       goto out;
-               }
-
-               _E("%s: \'%s\' doesn't support \'%s\'\n",
-                               info->module_name,
-                               syscommon_plugin_abi_version_str[g_platform_curr_abi_version],
-                               syscommon_plugin_abi_version_str[abi_version]);
-               _E("%s: Must use ABI versions from \'%s\' to \'%s\'\n",
-                               info->module_name,
-                               syscommon_plugin_abi_version_str[data->backend_min_abi_version],
-                               syscommon_plugin_abi_version_str[data->platform_abi_version]);
-       }
-       ret = -EINVAL;
-
-out:
-       _plugin_api_conf_exit();
-       return ret;
-}
-
-EXPORT
-unsigned int syscommon_plugin_common_get_backend_abi_version(enum syscommon_plugin_module module)
-{
-       unsigned int abi_version;
-       int ret;
-
-       ret = __get_backend_data(module, &abi_version, NULL, 0, NULL, 0);
-       if (ret < 0)
-               return SYSCOMMON_PLUGIN_ABI_VERSION_UNKNOWN;
-
-       return abi_version;
-}
-
 EXPORT
 int syscommon_plugin_common_get_backend_name(enum syscommon_plugin_module module, char *name, int size)
 {
-       return __get_backend_data(module, NULL, name, size, NULL, 0);
+       return __get_backend_data(module, name, size, NULL, 0);
 }
 
 EXPORT
 int syscommon_plugin_common_get_backend_vendor(enum syscommon_plugin_module module, char *vendor, int size)
 {
-       return __get_backend_data(module, NULL, NULL, 0, vendor, size);
+       return __get_backend_data(module, NULL, 0, vendor, size);
 }
 
 
index fe64d8d5df82f35aff43f3b98edc172c106ce81f..af97e885ee7dd38b5ff94840e75da5c824f9684c 100644 (file)
@@ -128,8 +128,6 @@ static struct __plugin_module_info* _get_module_info_with_library_name(
        new_info->library_name = g_strdup_printf("/usr/lib/system/plugin/%s", library_name);
 #endif
        new_info->symbol_name = g_strdup(info->symbol_name);
-       new_info->num_abi_versions = info->num_abi_versions;
-       new_info->abi_versions = info->abi_versions;
 
        g_hash_table_insert(_module_hash, (gpointer)library_name, new_info);
 
@@ -152,12 +150,6 @@ struct __plugin_module_info* _plugin_api_conf_get_module_info(enum syscommon_plu
                return _get_module_info_with_library_name(module, library_name);
 }
 
-
-enum syscommon_plugin_abi_version _plugin_api_conf_get_platform_abi_version(void)
-{
-       return g_platform_curr_abi_version;
-}
-
 EXPORT
 int _plugin_api_conf_init(void)
 {
index 17dbbe8b9bfca183124f27497d4aa2bebe7c3333..a723961fa8bc3aabe2da6ec9e573a73656dba173 100644 (file)
@@ -41,8 +41,6 @@ struct __plugin_module_info *_plugin_api_conf_get_module_info(
                                        enum syscommon_plugin_module module,
                                        const char *library_name);
 
-enum syscommon_plugin_abi_version _plugin_api_conf_get_platform_abi_version(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 7904b875513185a034acd6e4a8816708ba016c24..8161a3118ab9ed4dcc758b6ec7a7ac7f4a099eda 100644 (file)
 
 #include "common.h"
 
-#define PLUGIN_ABI_VERSION_MAX 10
-
-enum syscommon_plugin_abi_version g_platform_curr_abi_version =
-                                       SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0;
-
-static struct plugin_abi_version_match abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_END][PLUGIN_ABI_VERSION_MAX] = {
-       [SYSCOMMON_PLUGIN_MODULE_RESOURCED_MEMORY_LMK] = {
-               [0] = {
-                       .platform_abi_version           = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-                       .backend_min_abi_version        = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-               },
-       },
-       /* PLUGIN_GROUP_DEVICED */
-       [SYSCOMMON_PLUGIN_MODULE_DEVICED_BATTERY] = {
-               [0] = {
-                       .platform_abi_version           = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-                       .backend_min_abi_version        = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-               },
-       },
-       [SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT] = {
-               [0] = {
-                       .platform_abi_version           = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-                       .backend_min_abi_version        = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-               },
-       },
-       [SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY] = {
-               [0] = {
-                       .platform_abi_version           = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-                       .backend_min_abi_version        = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-               },
-       },
-       [SYSCOMMON_PLUGIN_MODULE_RESOURCED_CPU_BOOSTING] = {
-               [0] = {
-                       .platform_abi_version           = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-                       .backend_min_abi_version        = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_8_0,
-               },
-       },
-       [SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL] = {
-               [0] = {
-                       .platform_abi_version           = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_9_0,
-                       .backend_min_abi_version        = SYSCOMMON_PLUGIN_ABI_VERSION_TIZEN_9_0,
-               },
-       },
-};
-
 static struct __plugin_module_info g_plugin_module_info[] = {
        [SYSCOMMON_PLUGIN_MODULE_RESOURCED_MEMORY_LMK] = {
                .group                  = PLUGIN_GROUP_RESOURCED,
@@ -84,8 +39,6 @@ static struct __plugin_module_info g_plugin_module_info[] = {
                .library_name           = "/usr/lib/system/plugin/libplugin-backend-resourced-memory-lmk.so",
                .library_name_64bit     = "/usr/lib64/system/plugin/libplugin-backend-resourced-memory-lmk.so",
                .symbol_name            = "system_plugin_backend_resourced_memory_lmk_data",
-               .num_abi_versions       = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_RESOURCED_MEMORY_LMK]),
-               .abi_versions           = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_RESOURCED_MEMORY_LMK],
        },
        [SYSCOMMON_PLUGIN_MODULE_DEVICED_BATTERY] = {
                .group                  = PLUGIN_GROUP_DEVICED,
@@ -96,8 +49,6 @@ static struct __plugin_module_info g_plugin_module_info[] = {
                .library_name           = "/usr/lib/system/plugin/libplugin-backend-deviced-battery.so",
                .library_name_64bit     = "/usr/lib64/system/plugin/libplugin-backend-deviced-battery.so",
                .symbol_name            = "system_plugin_backend_deviced_battery_data",
-               .num_abi_versions       = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_BATTERY]),
-               .abi_versions           = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_BATTERY],
        },
        [SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT] = {
                .group                  = PLUGIN_GROUP_DEVICED,
@@ -108,8 +59,6 @@ static struct __plugin_module_info g_plugin_module_info[] = {
                .library_name           = "/usr/lib/system/plugin/libplugin-backend-deviced-input.so",
                .library_name_64bit     = "/usr/lib64/system/plugin/libplugin-backend-deviced-input.so",
                .symbol_name            = "system_plugin_backend_deviced_input_data",
-               .num_abi_versions       = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT]),
-               .abi_versions           = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT],
        },
        [SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY] = {
                .group                  = PLUGIN_GROUP_DEVICED,
@@ -120,8 +69,6 @@ static struct __plugin_module_info g_plugin_module_info[] = {
                .library_name           = "/usr/lib/system/plugin/libplugin-backend-deviced-display.so",
                .library_name_64bit     = "/usr/lib64/system/plugin/libplugin-backend-deviced-display.so",
                .symbol_name            = "system_plugin_backend_deviced_display_data",
-               .num_abi_versions       = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY]),
-               .abi_versions           = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY],
        },
        [SYSCOMMON_PLUGIN_MODULE_RESOURCED_CPU_BOOSTING] = {
                .group                  = PLUGIN_GROUP_RESOURCED,
@@ -132,20 +79,16 @@ static struct __plugin_module_info g_plugin_module_info[] = {
                .library_name           = "/usr/lib/system/plugin/libplugin-backend-resourced-cpu-boosting.so",
                .library_name_64bit     = "/usr/lib64/system/plugin/libplugin-backend-resourced-cpu-boosting.so",
                .symbol_name            = "system_plugin_backend_resourced_cpu_boosting_data",
-               .num_abi_versions       = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_RESOURCED_CPU_BOOSTING]),
-               .abi_versions           = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_RESOURCED_CPU_BOOSTING],
        },
        [SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL] = {
-               .group                  = PLUGIN_GROUP_UPDATE_CONTROL,
-               .module                 = SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL,
+               .group                  = PLUGIN_GROUP_UPDATE_CONTROL,
+               .module                 = SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL,
                .license                = PLUGIN_LICENSE_APACHE_2_0,
                .module_name            = "SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL",
                .backend_module_name    = "update-control",
                .library_name           = "/usr/lib/system/plugin/libplugin-backend-update-control.so",
                .library_name_64bit     = "/usr/lib64/system/plugin/libplugin-backend-update-control.so",
                .symbol_name            = "system_plugin_backend_update_control_data",
-               .num_abi_versions       = ARRAY_SIZE(abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL]),
-               .abi_versions = abi_version_match_data[SYSCOMMON_PLUGIN_MODULE_UPDATE_CONTROL],
        },
 };