From: Youngjae Cho Date: Tue, 2 Apr 2024 06:48:13 +0000 (+0900) Subject: halcc: Use major/minor version instead of abi version for checking compatibility X-Git-Tag: accepted/tizen/unified/20240611.122614~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d9608224fbe3074c08b9fccb55da9154902331d;p=platform%2Fhal%2Fapi%2Fcommon.git halcc: Use major/minor version instead of abi version for checking compatibility Change-Id: Ib7fa6ed4e9a482ac5f9cdc356626444d3d762730 Signed-off-by: Youngjae Cho --- diff --git a/halcc/src/hal-compatibility-checker.c b/halcc/src/hal-compatibility-checker.c index 38272f6..4bb91cb 100644 --- a/halcc/src/hal-compatibility-checker.c +++ b/halcc/src/hal-compatibility-checker.c @@ -79,9 +79,13 @@ static int parse_directory(const char *manifest_dir, halcc_manifest *manifest) return 0; } -static halcc_compatibility_e is_compatible(int major, int minor, unsigned int abi_version) +static halcc_compatibility_e is_compatible(int platform_major, int platform_minor, + int backend_major, int backend_minor) { - if (abi_version == HAL_ABI_VERSION_UNKNOWN) + if (platform_major != backend_major) + return HALCC_INCOMPATIBLE; + + if (platform_minor < backend_minor) return HALCC_INCOMPATIBLE; return HALCC_COMPATIBLE; @@ -118,7 +122,7 @@ static void foreach_hal(void *data, void *user_data) for (module = HAL_MODULE_UNKNOWN; module < HAL_MODULE_END; ++module) { char module_name[128] = { 0 , }; - unsigned int abi_version; + int backend_major, backend_minor; int ret; ret = hal_common_get_backend_module_name(module, module_name, sizeof(module_name)); @@ -129,11 +133,11 @@ static void foreach_hal(void *data, void *user_data) if (ret != 0) continue; - abi_version = hal_common_get_backend_abi_version(module); - if (abi_version == HAL_ABI_VERSION_UNKNOWN) - break; + ret = hal_common_get_backend_version(module, &backend_major, &backend_minor); + if (ret != 0) + continue; - compatible = is_compatible(major, minor, abi_version); + compatible = is_compatible(major, minor, backend_major, backend_minor); break; }