From: Youngjae Cho Date: Tue, 23 Apr 2024 06:41:20 +0000 (+0900) Subject: halapi: Add hal-api-manifest.xml X-Git-Tag: accepted/tizen/unified/20240611.122614~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6204958d8715858d61de3d8b8f94a93e701b203b;p=platform%2Fhal%2Fapi%2Fcommon.git halapi: Add hal-api-manifest.xml The hal-api specifies which version it requires to a hal backend module. The manifest file must be installed in the following directory: - /etc/hal-manifest/hal-api-manifest.xml Manifest scheme: HAL_MODULE_XXX 1.2 2.0 passthrough The above specifies that a platform has hal api version of both 1.0-2 and 2.0. The name, in this case the HAL_MODULE_XXX, must be one of an enum hal_module. (See include/hal-common.h) It expects for hal backend to have version that specified in . Here the 'compatible' means that backend version should have major version equal to platform, and minor equal to or lesser than platform. At the above case, here is compatible set of backend version: - Compatible backend version: 1.0, 1.1, 1.2, 2.0 - Incompatible backend version: 1.3, 2.1, 3.0, ... As aforementioned, a platform must contain all set of apis as it has specified on manifest . For example, a hal api that specified the above manifest must have all apis like below. // hal-xxx.h int hal_xxx_foo(); // Implemented as of v1.0 int hal_xxx_bar(); // Implemented as of v1.1 int hal_xxx_baz(); // Implemented as of v1.2 int hal_xxx_qux(); // Implemented as of v2.0 Note that, for backward compatibility, all functions with older minor version as well as the latest minor version must be provided together. And they cannot be removed as the minor bumps within the same major version. It works based on which backend version would have been. If a platform works on top of backend version of 1.1, the foo and bar will works whereas baz and qux won't, returning not supported error, for example. Note that even though the platform has implemented baz since v1.2, it won't work as backend has no idea about v1.2. For backend version of 1.3, for example, all the foo, bar, and baz won't work. (qux obviously won't too due to major version mismatch) The backend v1.3 might have implemented all v1.0 ~ v1.3 functionalities for backward compatibility though, it is possible that v1.2 platform could not understand semantic of v1.3 that will have been given in the future. To prevent this, platform refuses to work with backend of future minor version. If a new hal api is added with major or minor version bump, fix the manifest file through ACR process. Change-Id: I9d191f4fe63577eb6ce08aa7fe3ac058f80f0360 Signed-off-by: Youngjae Cho --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f9cb68..cdcc1b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ FILES_MATCHING PATTERN "*.h") INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/hal-manifest DESTINATION /etc) ADD_SUBDIRECTORY(tests) diff --git a/hal-manifest/hal-api-manifest.xml b/hal-manifest/hal-api-manifest.xml new file mode 100644 index 0000000..331df5a --- /dev/null +++ b/hal-manifest/hal-api-manifest.xml @@ -0,0 +1,132 @@ + + + HAL_MODULE_TBM + 1.0 + passthrough + + + HAL_MODULE_TDM + 1.0 + passthrough + + + HAL_MODULE_AUDIO + 1.0 + passthrough + + + HAL_MODULE_CAMERA + 1.0 + passthrough + + + HAL_MODULE_RADIO + 1.0 + passthrough + + + HAL_MODULE_BLUETOOTH + 1.0 + passthrough + + + HAL_MODULE_WIFI + 1.0 + passthrough + + + HAL_MODULE_NFC + 1.0 + passthrough + + + HAL_MODULE_ZIGBEE + 1.0 + passthrough + + + HAL_MODULE_UWB + 1.0 + passthrough + + + HAL_MODULE_LOCATION + 1.0 + passthrough + + + HAL_MODULE_POWER + 1.0 + passthrough + + + HAL_MODULE_SENSOR + 1.0 + passthrough + + + HAL_MODULE_DEVICE_BATTERY + 1.0 + passthrough + + + HAL_MODULE_DEVICE_BEZEL + 1.0 + passthrough + + + HAL_MODULE_DEVICE_DISPLAY + 1.0 + passthrough + + + HAL_MODULE_DEVICE_IR + 1.0 + passthrough + + + HAL_MODULE_DEVICE_TOUCHSCREEN + 1.0 + passthrough + + + HAL_MODULE_DEVICE_LED + 1.0 + passthrough + + + HAL_MODULE_DEVICE_BOARD + 1.0 + passthrough + + + HAL_MODULE_DEVICE_EXTERNAL_CONNECTION + 1.0 + passthrough + + + HAL_MODULE_DEVICE_THERMAL + 1.0 + passthrough + + + HAL_MODULE_DEVICE_HAPTIC + 1.0 + passthrough + + + HAL_MODULE_DEVICE_MEMORY + 1.0 + passthrough + + + HAL_MODULE_DEVICE_INPUT + 1.0 + passthrough + + + HAL_MODULE_DEVICE_POWER + 1.0 + passthrough + + diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index 9d8d790..187f069 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -97,6 +97,7 @@ rm -rf %{buildroot} %{_bindir}/lshal %{_bindir}/hal-compatibility-checker %{_sysconfdir}/ld.so.conf.d/libhal-api.conf +%{_sysconfdir}/hal-manifest %{_systemdgeneratordir}/systemd-hal-firmware-generator %{_systemdgeneratordir}/systemd-hal-compatibility-checker-generator