From: Chanwoo Choi Date: Mon, 15 Mar 2021 06:02:54 +0000 (+0900) Subject: halapi: Replace hal-api.json with hal-api-list.h X-Git-Tag: accepted/tizen/unified/20210317.034405~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd82d44aed96afd79b673029957cc45165643d79;p=platform%2Fhal%2Fapi%2Fcommon.git halapi: Replace hal-api.json with hal-api-list.h When using hal-api.json, the segmentation falut happen when trying to use json-c library because of some library including json-c statically. In order to fix this issue rapily, use the 'hal-api-list.h' temporarily instead of 'hal-api.json'. After fixing this issue, revert this patch for using 'hal-api.json'. Change-Id: I22ba800b536e974879cbfa758f9160b896813c63 Signed-off-by: Chanwoo Choi --- diff --git a/include/hal-common.h b/include/hal-common.h index 369a78a..45c4a10 100644 --- a/include/hal-common.h +++ b/include/hal-common.h @@ -112,6 +112,7 @@ enum hal_module { HAL_MODULE_END, }; +#ifdef HAL_API_CONF_JSON static const char *const hal_module_string[] = { [HAL_MODULE_UNKNOWN] = "HAL_MODULE_UNKNOWN", @@ -164,6 +165,7 @@ static const char *const hal_module_string[] = { [HAL_MODULE_END] = "HAL_MODULE_END", }; +#endif /** * @brief Get the backend library name according to the type of HAL module diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index 87b4c0c..4465fe6 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -25,18 +25,44 @@ #include "hal-common.h" #include "hal-common-interface.h" -#include "hal-api-conf.h" - #include "common.h" +#include "hal-api-conf.h" +#include "hal-api-list.h" +#ifdef HAL_API_CONF_JSON static enum hal_abi_version _platform_abi_version = HAL_ABI_VERSION_END; static json_object *_json_file_object = NULL; +#endif static GHashTable *_module_hash = NULL; static int _usage_count = 0; +__attribute__ ((visibility("default"))) +void _destroy_module_info(gpointer data) +{ +#define SAFE_FREE_AND_NULL(x) \ +do { \ + if (x) { \ + free(x); \ + x = NULL; \ + } \ +} while (0); + + struct __hal_module_info *info = (struct __hal_module_info *)data; + + if (info) { + SAFE_FREE_AND_NULL(info->module_name); + SAFE_FREE_AND_NULL(info->library_name); + SAFE_FREE_AND_NULL(info->library_name_64bit); + SAFE_FREE_AND_NULL(info->symbol_name); + SAFE_FREE_AND_NULL(info->abi_versions); + SAFE_FREE_AND_NULL(info); + } +} + +#ifdef HAL_API_CONF_JSON static enum hal_abi_version __convert_abi_version_str_to_enum(const char *abi_version) { int version; for (version = HAL_ABI_VERSION_UNKNOWN + 1; version < HAL_ABI_VERSION_END; version++){ @@ -78,29 +104,6 @@ static enum hal_license __convert_license_str_to_enum(const char *license) return HAL_LICENSE_UNKNOWN; } -__attribute__ ((visibility("default"))) -void _destroy_module_info(gpointer data) -{ -#define SAFE_FREE_AND_NULL(x) \ -do { \ - if (x) { \ - free(x); \ - x = NULL; \ - } \ -} while (0); - - struct __hal_module_info *info = (struct __hal_module_info *)data; - - if (info) { - SAFE_FREE_AND_NULL(info->module_name); - SAFE_FREE_AND_NULL(info->library_name); - SAFE_FREE_AND_NULL(info->library_name_64bit); - SAFE_FREE_AND_NULL(info->symbol_name); - SAFE_FREE_AND_NULL(info->abi_versions); - SAFE_FREE_AND_NULL(info); - } -} - static const char * __get_json_object_string(json_object *object, const char *key) { json_object *temp_object = NULL; @@ -205,6 +208,12 @@ static struct __hal_module_info* _get_module_info(enum hal_module module) return info; } +#else +static struct __hal_module_info* _get_module_info(enum hal_module module) +{ + return &g_hal_module_info[module]; +} +#endif static struct __hal_module_info* _get_module_info_with_library_name(enum hal_module module, const char *library_name) @@ -215,7 +224,12 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod const char *module_name = NULL; int ret; - if (!_json_file_object || !_module_hash | !library_name) +#ifdef HAL_API_CONF_JSON + if (!_json_file_object) + return NULL; +#endif + + if (!_module_hash | !library_name) return NULL; if (!g_str_has_prefix(library_name, "libhal-backend-")) { @@ -276,7 +290,12 @@ struct __hal_module_info* _hal_api_conf_get_module_info(enum hal_module module, const char *key = NULL; int i; - if (!_json_file_object || !_module_hash) +#ifdef HAL_API_CONF_JSON + if (!_json_file_object) + return NULL; +#endif + + if (!_module_hash) return NULL; if (!library_name) @@ -288,6 +307,7 @@ struct __hal_module_info* _hal_api_conf_get_module_info(enum hal_module module, enum hal_abi_version _hal_api_conf_get_platform_abi_version(void) { +#ifdef HAL_API_CONF_JSON const char *abi_version = NULL; bool ret_initialized; json_object *platform_obj = NULL; @@ -302,6 +322,9 @@ enum hal_abi_version _hal_api_conf_get_platform_abi_version(void) _platform_abi_version = __convert_abi_version_str_to_enum(abi_version); return _platform_abi_version; +#else + return g_platform_curr_abi_version; +#endif } __attribute__ ((visibility("default"))) @@ -310,16 +333,19 @@ int _hal_api_conf_init(void) if (_usage_count++ > 0) return 0; +#ifdef HAL_API_CONF_JSON _json_file_object = json_object_from_file(HAL_CONFIGURATION_PATH); if (_json_file_object == NULL) { _E("Failed to parsing json configuration file : %s\n", json_util_get_last_err()); goto err; } +#endif _module_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, _destroy_module_info); return 0; +#ifdef HAL_API_CONF_JSON err: _usage_count--; @@ -329,6 +355,7 @@ err: } return -EINVAL; +#endif } __attribute__ ((visibility("default"))) @@ -338,10 +365,12 @@ void _hal_api_conf_exit(void) if (_usage_count != 0) return; +#ifdef HAL_API_CONF_JSON if (_json_file_object) { json_object_put(_json_file_object); _json_file_object = NULL; } +#endif if (_module_hash) { g_hash_table_remove_all(_module_hash); diff --git a/src/hal-api-list.h b/src/hal-api-list.h new file mode 100644 index 0000000..a7e0ece --- /dev/null +++ b/src/hal-api-list.h @@ -0,0 +1,706 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __HAL_API_LIST_H__ +#define __HAL_API_LIST_H__ + +#include "hal-common.h" + +#include "common.h" + +#define HAL_ABI_VERSION_MAX 10 + +enum hal_abi_version g_platform_curr_abi_version = HAL_ABI_VERSION_TIZEN_6_5; + +static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_ABI_VERSION_MAX] = { + /* HAL_GROUP_GRAPHICS */ + [HAL_MODULE_TBM] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_TDM] = { + /* FIXME: Need to be filled from configuration file. */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_COREGL] = { + /** + * Don't need to add abi verion for this module. + * because this module don't support HAL API. + */ + }, + [HAL_MODULE_INPUT] = { + /** + * Don't need to add abi verion for this module. + * because this module don't support HAL API. + */ + }, + + /* HAL_GROUP_MULTIMEDIA */ + [HAL_MODULE_AUDIO] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_CAMERA] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_RADIO] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_CODEC] = { + /** + * Don't need to add abi verion for this module. + * because this module don't support HAL API. + */ + }, + [HAL_MODULE_USB_AUDIO] = { + /** + * Don't need to add abi verion for this module. + * because this module don't support HAL API. + */ + }, + [HAL_MODULE_ALSAUCM] = { + /** + * Don't need to add abi verion for this module. + * because this module don't support HAL API. + */ + }, + + /* HAL_GROUP_CONNECTIVITY */ + [HAL_MODULE_BLUETOOTH] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_WIFI] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_NAN] = { + }, + [HAL_MODULE_NFC] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_ZIGBEE] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_UWB] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_MTP] = { + /** + * Don't need to add abi verion for this module. + * because this module don't support HAL API. + */ + }, + + /* HAL_GROUP_TELEPHONY */ + [HAL_MODULE_TELEPHONY] = { + /* FIXME: Need to be determined whehter support HAL API or not. */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + + /* HAL_GROUP_LOCATION */ + [HAL_MODULE_LOCATION] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + + /* HAL_GROUP_SYSTEM */ + [HAL_MODULE_COMMON] = { + }, + [HAL_MODULE_POWER] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_SENSOR] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_PERIPHERAL] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + + [HAL_MODULE_DEVICE_BATTERY] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_BEZEL] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_DISPLAY] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_IR] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_TOUCHSCREEN] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_LED] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_BOARD] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_EXTERNAL_CONNECTION] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_THERMAL] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_USB_GADGET] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_HAPTIC] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, + [HAL_MODULE_DEVICE_MEMORY] = { + /* FIXME: Need to be initialized by configuration file like xml */ + [0] = { + .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + }, + }, +}; + +static struct __hal_module_info g_hal_module_info[] = { + /* HAL_GROUP_GRAPHICS */ + [HAL_MODULE_TBM] = { + .group = HAL_GROUP_GRAPHICS, + .module = HAL_MODULE_TBM, + .license = HAL_LICENSE_MIT, + .module_name = "HAL_MODULE_TBM", + .library_name = "/hal/lib/libhal-backend-tbm.so", + .library_name_64bit = "/hal/lib64/libhal-backend-tbm.so", + .symbol_name = "hal_backend_tbm_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_TBM]), + .abi_versions = abi_version_match_data[HAL_MODULE_TBM], + .hal_api = true, + }, + [HAL_MODULE_TDM] = { + .group = HAL_GROUP_GRAPHICS, + .module = HAL_MODULE_TDM, + .license = HAL_LICENSE_MIT, + .module_name = "HAL_MODULE_TDM", + .library_name = "/hal/lib/libhal-backend-tdm.so", + .library_name_64bit = "/hal/lib64/libhal-backend-tdm.so", + .symbol_name = "hal_backend_tdm_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_TDM]), + .abi_versions = abi_version_match_data[HAL_MODULE_TDM], + .hal_api = true, + }, + [HAL_MODULE_COREGL] = { + .group = HAL_GROUP_GRAPHICS, + .module = HAL_MODULE_COREGL, + .license = HAL_LICENSE_UNKNOWN, + .module_name = "HAL_MODULE_COREGL", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + [HAL_MODULE_INPUT] = { + .group = HAL_GROUP_GRAPHICS, + .module = HAL_MODULE_INPUT, + .license = HAL_LICENSE_MIT, + .module_name = "HAL_MODULE_INPUT", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + + /* HAL_GROUP_MULTIMEDIA */ + [HAL_MODULE_AUDIO] = { + .group = HAL_GROUP_MULTIMEDIA, + .module = HAL_MODULE_AUDIO, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_AUDIO", + .library_name = "/hal/lib/libhal-backend-audio.so", + .library_name_64bit = "/hal/lib64/libhal-backend-audio.so", + .symbol_name = "hal_backend_audio_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_AUDIO]), + .abi_versions = abi_version_match_data[HAL_MODULE_AUDIO], + .hal_api = true, + }, + [HAL_MODULE_CAMERA] = { + .group = HAL_GROUP_MULTIMEDIA, + .module = HAL_MODULE_CAMERA, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_CAMERA", + .library_name = "/hal/lib/libhal-backend-camera.so", + .library_name_64bit = "/hal/lib64/libhal-backend-camera.so", + .symbol_name = "hal_backend_camera_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_CAMERA]), + .abi_versions = abi_version_match_data[HAL_MODULE_CAMERA], + .hal_api = true, + }, + [HAL_MODULE_RADIO] = { + .group = HAL_GROUP_MULTIMEDIA, + .module = HAL_MODULE_RADIO, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_RADIO", + .library_name = "/hal/lib/libhal-backend-radio.so", + .library_name_64bit = "/hal/lib64/libhal-backend-radio.so", + .symbol_name = "hal_backend_radio_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_RADIO]), + .abi_versions = abi_version_match_data[HAL_MODULE_RADIO], + .hal_api = true, + }, + [HAL_MODULE_CODEC] = { + .group = HAL_GROUP_MULTIMEDIA, + .module = HAL_MODULE_CODEC, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_CODEC", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + [HAL_MODULE_USB_AUDIO] = { + .group = HAL_GROUP_MULTIMEDIA, + .module = HAL_MODULE_USB_AUDIO, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_USB_AUDIO", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + [HAL_MODULE_ALSAUCM] = { + .group = HAL_GROUP_MULTIMEDIA, + .module = HAL_MODULE_ALSAUCM, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_ALSAUCM", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + + /* HAL_GROUP_CONNECTIVITY */ + [HAL_MODULE_BLUETOOTH] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_BLUETOOTH, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_BLUETOOTH", + .library_name = "/hal/lib/libhal-backend-bluetooth.so", + .library_name_64bit = "/hal/lib64/libhal-backend-bluetooth.so", + .symbol_name = "hal_backend_bluetooth_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_BLUETOOTH]), + .abi_versions = abi_version_match_data[HAL_MODULE_BLUETOOTH], + .hal_api = true, + }, + [HAL_MODULE_WIFI] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_WIFI, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_WIFI", + .library_name = "/hal/lib/libhal-backend-wifi.so", + .library_name_64bit = "/hal/lib64/libhal-backend-wifi.so", + .symbol_name = "hal_backend_wifi_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_WIFI]), + .abi_versions = abi_version_match_data[HAL_MODULE_WIFI], + .hal_api = true, + }, + [HAL_MODULE_NAN] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_NAN, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_NAN", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + [HAL_MODULE_NFC] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_NFC, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_NFC", + .library_name = "/hal/lib/libhal-backend-nfc.so", + .library_name_64bit = "/hal/lib64/libhal-backend-nfc.so", + .symbol_name = "hal_backend_nfc_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_NFC]), + .abi_versions = abi_version_match_data[HAL_MODULE_NFC], + .hal_api = true, + }, + [HAL_MODULE_ZIGBEE] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_ZIGBEE, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_ZIGBEE", + .library_name = "/hal/lib/libhal-backend-zigbee.so", + .library_name_64bit = "/hal/lib64/libhal-backend-zigbee.so", + .symbol_name = "hal_backend_zigbee_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_ZIGBEE]), + .abi_versions = abi_version_match_data[HAL_MODULE_ZIGBEE], + .hal_api = true, + }, + [HAL_MODULE_UWB] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_UWB, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_UWB", + .library_name = "/hal/lib/libhal-backend-uwb.so", + .library_name_64bit = "/hal/lib64/libhal-backend-uwb.so", + .symbol_name = "hal_backend_uwb_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_UWB]), + .abi_versions = abi_version_match_data[HAL_MODULE_UWB], + .hal_api = true, + }, + [HAL_MODULE_MTP] = { + .group = HAL_GROUP_CONNECTIVITY, + .module = HAL_MODULE_MTP, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_MTP", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + + /* HAL_GROUP_TELEPHONY */ + [HAL_MODULE_TELEPHONY] = { + .group = HAL_GROUP_TELEPHONY, + .module = HAL_MODULE_TELEPHONY, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_TELEPHONY", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + + /* HAL_GROUP_LOCATION */ + [HAL_MODULE_LOCATION] = { + .group = HAL_GROUP_LOCATION, + .module = HAL_MODULE_LOCATION, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_LOCATION", + .library_name = "/hal/lib/libhal-backend-location.so", + .library_name_64bit = "/hal/lib64/libhal-backend-location.so", + .symbol_name = "hal_backend_location_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_LOCATION]), + .abi_versions = abi_version_match_data[HAL_MODULE_LOCATION], + .hal_api = true, + }, + + /* HAL_GROUP_SYSTEM */ + [HAL_MODULE_COMMON] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_COMMON, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_COMMON", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = true, + }, + [HAL_MODULE_POWER] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_POWER, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_POWER", + .library_name = "/hal/lib/libhal-backend-power.so", + .library_name_64bit = "/hal/lib64/libhal-backend-power.so", + .symbol_name = "hal_backend_power_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_POWER]), + .abi_versions = abi_version_match_data[HAL_MODULE_POWER], + .hal_api = true, + }, + [HAL_MODULE_SENSOR] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_SENSOR, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_SENSOR", + .library_name = "/hal/lib/libhal-backend-sensor.so", + .library_name_64bit = "/hal/lib64/libhal-backend-sensor.so", + .symbol_name = "hal_backend_sensor_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_SENSOR]), + .abi_versions = abi_version_match_data[HAL_MODULE_SENSOR], + .hal_api = true, + }, + [HAL_MODULE_PERIPHERAL] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_PERIPHERAL, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_PERIPHERAL", + .library_name = NULL, + .library_name_64bit = NULL, + .symbol_name = NULL, + .num_abi_versions = 0, + .abi_versions = NULL, + .hal_api = false, + }, + [HAL_MODULE_DEVICE_BATTERY] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_BATTERY, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_BATTERY", + .library_name = "/hal/lib/libhal-backend-device-battery.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-battery.so", + .symbol_name = "hal_backend_device_battery_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_BATTERY]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_BATTERY], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_BEZEL] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_BEZEL, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_BEZEL", + .library_name = "/hal/lib/libhal-backend-device-bezel.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-bezel.so", + .symbol_name = "hal_backend_device_bezel_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_BEZEL]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_BEZEL], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_DISPLAY] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_DISPLAY, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_DISPLAY", + .library_name = "/hal/lib/libhal-backend-device-display.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-display.so", + .symbol_name = "hal_backend_device_display_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_DISPLAY]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_DISPLAY], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_IR] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_IR, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_IR", + .library_name = "/hal/lib/libhal-backend-device-ir.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-ir.so", + .symbol_name = "hal_backend_device_ir_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_IR]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_IR], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_TOUCHSCREEN] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_TOUCHSCREEN, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_TOUCHSCREEN", + .library_name = "/hal/lib/libhal-backend-device-touchscreen.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-touchscreen.so", + .symbol_name = "hal_backend_device_touchscreen_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_TOUCHSCREEN]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_TOUCHSCREEN], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_LED] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_LED, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_LED", + .library_name = "/hal/lib/libhal-backend-device-led.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-led.so", + .symbol_name = "hal_backend_device_led_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_LED]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_LED], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_BOARD] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_BOARD, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_BOARD", + .library_name = "/hal/lib/libhal-backend-device-board.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-board.so", + .symbol_name = "hal_backend_device_board_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_BOARD]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_BOARD], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_EXTERNAL_CONNECTION] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_EXTERNAL_CONNECTION, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_EXTERNAL_CONNECTION", + .library_name = "/hal/lib/libhal-backend-device-external-connection.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-external-connection.so", + .symbol_name = "hal_backend_device_external_connection_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_EXTERNAL_CONNECTION]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_EXTERNAL_CONNECTION], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_THERMAL] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_THERMAL, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_THERMAL", + .library_name = "/hal/lib/libhal-backend-device-thermal.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-thermal.so", + .symbol_name = "hal_backend_device_thermal_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_THERMAL]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_THERMAL], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_USB_GADGET] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_USB_GADGET, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_USB_GADGET", + .library_name = "/hal/lib/libhal-backend-device-usb-gadget.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-usb-gadget.so", + .symbol_name = "hal_backend_device_usb_gadget_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_USB_GADGET]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_USB_GADGET], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_HAPTIC] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_HAPTIC, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_HAPTIC", + .library_name = "/hal/lib/libhal-backend-device-haptic.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-haptic.so", + .symbol_name = "hal_backend_device_haptic_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_HAPTIC]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_HAPTIC], + .hal_api = true, + }, + [HAL_MODULE_DEVICE_MEMORY] = { + .group = HAL_GROUP_SYSTEM, + .module = HAL_MODULE_DEVICE_MEMORY, + .license = HAL_LICENSE_APACHE_2_0, + .module_name = "HAL_MODULE_DEVICE_MEMORY", + .library_name = "/hal/lib/libhal-backend-device-memory.so", + .library_name_64bit = "/hal/lib64/libhal-backend-device-memory.so", + .symbol_name = "hal_backend_device_memory_data", + .num_abi_versions = ARRAY_SIZE(abi_version_match_data[HAL_MODULE_DEVICE_MEMORY]), + .abi_versions = abi_version_match_data[HAL_MODULE_DEVICE_MEMORY], + .hal_api = true, + }, +}; + +#endif /* __HAL_API_LIST_H__ */