Youngjae Cho [Mon, 14 Oct 2024 07:42:32 +0000 (16:42 +0900)]
Add dependency to capi-base-common
It is required for the header tizen.h and enums such as TIZEN_ERROR_*
defined at the header. Those are accessible by the dependency to the
capi-base-common, which is currently pulled in by the dlog. However,
some build environment lack of such indirect dependency would blame
this. Therefore explicitly state the dependency.
Change-Id: I215b2eb2b16bbb931e7565d0d1adb436a425a6d0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 14 Oct 2024 07:41:30 +0000 (16:41 +0900)]
Revert "tests: Remove unnecessary header <tizen.h>"
This reverts commit
a6e22bdbc0245ddfe066154ac58d8dcf83f26a6e.
Change-Id: I54fae1421d436e19db7ca768b5e0b3259cd7e7b3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 26 Sep 2024 06:57:28 +0000 (15:57 +0900)]
tests: Remove unnecessary header <tizen.h>
Change-Id: I92cbc7872c9a0062bd58244f2463754c580373cf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 18 Jul 2024 06:51:42 +0000 (15:51 +0900)]
halcc: Remove checking SYSTEMD_SCOPE environment variable
The environment variable is used for testing whether the execution
context is systemd system generator. And for this, getenv() had been
utilized. However, there was a blame that the getenv() is vulnerable
as the environment variable could be controlled externally. Therefore,
removed using SYSTEMD_SCOPE environment variable.
Due to this, it has become that someone can create compatibility result
file, /opt/etc/hal/.hal-backend-compatibility, outside of systemd system
generator context. Nevertheless, we can screen out the worst case that
unprivileged process generates the file because the directory /opt/etc
has attribute of {root,system_share,0775}.
Change-Id: I89fd5abc5c2445ce827371f61244bbc9e388d438
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Wed, 10 Jul 2024 02:18:43 +0000 (11:18 +0900)]
packaging: Add data migration script to remove /opt/etc/hal/.hal-backend-compatibility
Remove /opt/etc/hal/.hal-backend-compatibility for data migration of OS
Upgarde to remove the invalid result of hal backend compatibility.
/opt/etc/hal/.hal-backend-compatibility should be created on first
booting by comparing the supported HAL interface version in HAL manifest
with hal-backend version.
Change-Id: Id6980ced56f7f8c2fee0f7b178e6534ad168b1cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 1 Jul 2024 09:26:32 +0000 (18:26 +0900)]
halapi: common: Fix typo to hal_module
Change-Id: I56e70c0676381dde7b5b3dbaf368468a836b14a4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 27 Jun 2024 12:56:46 +0000 (21:56 +0900)]
halapi: common: Add hal_common_get/put_backend_v2 to support ABI compatibility
Add hal_common_get_backend_v2 and put_backend_v2 to support ABI
compatibility between HAL interface and HAL backend.
In order to suport HAL ABI compatibility, need to allocate the memory of
hal interface structure instead of hal bakcend.
So that hal_common_get/put_backend_v2 functions requires the init/exit_backend
function pointer of which initialize and deinitialze the
hal_backend_[module]_funcs instance like allocation/free memory.
[Newly added function to get/put backend]
int hal_common_get_backend_v2(enum hal_module module,
void **data, void *user_data,
int (*init_backend)(void **data, void *user_data));
int hal_common_put_backend_v2(enum hal_module module,
void *data, void *user_data,
int (*exit_backend)(void *data, void *user_data));
int hal_common_get_backend_with_library_name_v2(enum hal_module module,
void **data, void *user_data,
int (*init_backend)(void **data, void *user_data),
const char *library_name);
int hal_common_put_backend_with_library_name_v2(enum hal_module module,
void **data, void *user_data,
int (*exit_backend)(void *data, void *user_data),
const char *library_name);
Change-Id: I71de896383162032bc5b03348888dd97dedb5f52
Suggested-by: Jeongmo Yang <jm80.yang@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Wed, 26 Jun 2024 06:31:09 +0000 (15:31 +0900)]
halcc: Fix default compatibility to HAL_COMMON_BACKEND_COMPATIBLITY_UNKNOWN
It makes difference when there is no installed backend. Previously it
was regarded as HAL_COMMON_BACKEND_COMPATIBILITY_INCOMPATIBLE, but
it has changed to as HAL_COMMON_BACKEND_COMPATIBILITY_UNKNOWN. This
mainly affects lshal to print 'Compatibility' column empty if there
is no installed backend, which previously printed 'Incompatible' on
that column.
Change-Id: I00d87c66c76b22a35af8f8da87cdb3f75937225a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 26 Jun 2024 03:40:59 +0000 (12:40 +0900)]
halcc: Remove unused code
Change-Id: I08ed786774a6d0e7f25c1a232d688dd4f71ddac7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 26 Jun 2024 03:26:04 +0000 (12:26 +0900)]
tests: Separate functions exclusively used for testing
Change-Id: Ib3f1c089e1d1cfdbf1aafa4ab95e6cdc05acccf5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 09:53:03 +0000 (18:53 +0900)]
halcc: Add cache not to open() file multiple times on a same module
Change-Id: I623b0a7fd0fb223750aa24ea1737a2c7c2fe0a66
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 04:05:40 +0000 (13:05 +0900)]
tool: lshal: Replace 'Backend Verification' with 'Compatibility'
------------------------------------------------------------------
| ... | |
HAL Module Name | ... | Compatibility |
------------------------------------------------------------------
HAL_MODULE_TBM | ... | |
HAL_MODULE_TDM | ... | |
...
HAL_MODULE_POWER | ... | Compatible |
HAL_MODULE_SENSOR | ... | Incompatible |
The column 'Backend Verification' has been removed and replaced with
'Compatibility'.
Change-Id: I4f364b0d64b24c326101666b0685f2abf4963563
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 24 Jun 2024 10:03:10 +0000 (19:03 +0900)]
tool: lshal: Print interface and backend version
The last 2 columns have been added. For example
--------------------------------------------------------------------
| ... | Interface | Backend |
HAL Module Name | ... | Versions | Version |
--------------------------------------------------------------------
... | | | |
--------------------------------------------------------------------
HAL_MODULE_DEVICE_DISPLAY | ... | 1.0, 2.3, 3.2, 4.1 | 1.0 |
--------------------------------------------------------------------
... | | | |
- Interface Versions
: Versions specified at the manifest file,
/etc/hal/hal-api-{module}-manifest.xml. Can be more than one
if it has specified multiple supporting versions.
- Backend Version
: Version that an actual backend has been implemented with.
Change-Id: I035617f86396a7b730d26e7e6312d0dd20c86429
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 24 Jun 2024 08:32:09 +0000 (17:32 +0900)]
halcc: Add hal_common_get_supported_interface_versions()
It gets versions specified at manifest file.
Change-Id: Icdaa1e8c4615fa2aa046c1a6cd698f8061905a00
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 02:31:08 +0000 (11:31 +0900)]
halcc: Add module name info to error log
Change-Id: Ic1c1992dfc913f205f651c40005240700f9f6c07
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 01:38:37 +0000 (10:38 +0900)]
halcc: Fix errno not to be overwritten before returning
Change-Id: Iddc5f3e1abd43c6a9881fdde55ae354c47850b6a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 01:34:15 +0000 (10:34 +0900)]
halcc: Fix file descriptor leak
Change-Id: I5cc2d7f628686d65513a740d4df15ca92cddca3b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 07:17:54 +0000 (16:17 +0900)]
systemd-hal-compatibility-checker-generator: Remove lost option --redirect-all
It has changed to have no choice but to emit log to dlog.
Change-Id: Ic15e4c8d47f199ec0410ee8ac19ff9ef78c0ec48
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 05:26:54 +0000 (14:26 +0900)]
halcc: Fix not to ask for HAL_MODULE_UNKNOWN to prevent error log spam
Change-Id: Icf874c346b00684960452c2023746bdbb67b4efb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 03:55:32 +0000 (12:55 +0900)]
tool: hal-compatibility-checker: Fix --skip-if-result-exist to work
To prevent checking repeatedly for every booting, the option skips
checking if there was result file.
Change-Id: If55a3a59c12765591e33c5c2899028af86452907
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 03:47:56 +0000 (12:47 +0900)]
halcc: Fix error log to dlog instead of stdout
It was printf() because it should work before dlog daemon start up.
However, it can be written to dlog even without dlog daemon. Therefore
replace printf() with dlog function. And by this, it becomes
unnecessary for tool hal-compatibility-checker that redirecting outputs.
Thus removed related options and operations.
Change-Id: I0e3a81f666b22b6f9ae909c81f7d62ea7431cc47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Jun 2024 12:37:59 +0000 (21:37 +0900)]
halcc: Check only explicitly specified manifest file
halcc has changed to work only on top of manifest file specified in
hal-api-list.h instead of entire xml files at a directory.
Due to above, it becomes necessary that calling parsing function for
every single files, every requested hal module. To make it work,
fixed related function to operates on each single manifest file.
Change-Id: I67e48afb4d0248be37144b127d7068d9dff3452f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 01:52:27 +0000 (10:52 +0900)]
tool: hal-compatibility-checker: Fix file path used by --reset
Change-Id: I3cd0a7b7d303e6c8d0d1aead41ed1f5cf49f5c8d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Jun 2024 11:14:01 +0000 (20:14 +0900)]
tool: hal-compatibility-checker: Add option --reset to remove result file
Change-Id: I023148c4534625a073282324e7567b26e54fe5d2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Jun 2024 08:19:36 +0000 (17:19 +0900)]
halcc: Fix default manifest directory to '/etc/hal'
Change-Id: I07382d0e890f85924e31f73ae2f77aa46f7d823d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Jun 2024 07:08:07 +0000 (16:08 +0900)]
halcc: Create directory for .hal-backend-compatibility if not exist
Change-Id: I1ba61268f2ba5503ef85ef2c106d7bd5f456231d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 22 May 2024 02:27:11 +0000 (11:27 +0900)]
halcc: Fix parser to accept <hal-api> instead of <root>
Change-Id: Ibe6fbc1c1be51c2133da9eb0abe4772e23fbca2b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 22 May 2024 02:18:59 +0000 (11:18 +0900)]
halcc: Fix parser to accept <hal-module> instead of <hal>
Change-Id: Ie3aabd00c9c25b2f5d5da58719e63821346476d6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 22 May 2024 02:08:13 +0000 (11:08 +0900)]
halcc: Temporarily allow incompatible backend version
It needs time to deploy compatibility manifest to all hal modules.
After that, incompatible cases should terminate the function, returning
error.
Change-Id: I65ecdac80b96c12980e545c95744005db6435203
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 17 May 2024 05:43:20 +0000 (14:43 +0900)]
Revert "halapi: Add hal-api-manifest.xml"
This reverts commit
6204958d8715858d61de3d8b8f94a93e701b203b.
The hal-api-manifest.xml has been removed and it would be deployed to
each repository of hal api module instead. Although the commit has been
reverted, manifest scheme will follows description on that commit.
Change-Id: I5c2121b600ef0f3eccc122913dcf82e6e432a33f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 16 May 2024 06:01:18 +0000 (15:01 +0900)]
tests: Add test manifest.xml and testcases for halcc
Change-Id: Ie2f7f5db53e1a91c35ce22f135d8f591fa89cca5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 17 May 2024 04:31:47 +0000 (13:31 +0900)]
halcc: Remove spamming error log
Those removed logs used to be emitted even when the manifest xml is
well structured because current xml scheme doesn't use all the text
node but selectively on some elements. Therefore such elements that
have no text node used to emit error log quite frequently.
Change-Id: I6e2c256033efbb6033969ace020e2e8a30d45b29
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 14 May 2024 08:39:01 +0000 (17:39 +0900)]
halcc: Rework halcc compatibility checker
As compatibility manifest has changed to specify multiple version for
hal, the halcc compatibility checker has also been fixed to follow
that scheme.
1. The result file format has changed so that the halcc can now randomly
access to module index for which the halcc has requested.
2. Operation for generating result file will be rejected unless it is
invoked by generator of systemd system manager. Therefore, if there
is no result file when checking compatibility, and it is not on
generator context, compatibility checking will do the entire
routine, for every invocation, that should have done when creating
the result file.
3. For updating manifest file from a hal api repository, add below
command at %post rpm scriptlet.
: rm -rf /opt/etc/hal/.hal-backend-compatibility
: systemctl daemon-reload
systemctl daemon-reload triggers generator so it is able to create
a new result file from updated manifest.
Change-Id: Ia8b140c2edc8d6de3c205716b8bed7d0fc92f602
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 14 May 2024 11:27:02 +0000 (20:27 +0900)]
halcc: Fix manifest scheme
Attribute "version" has changed to "platform-version" and attribute
"type" has been removed.
As-is: <manifest version="1.0" type="platform">
To-be: <manifest platform-version="9.0">
Change-Id: I296c0b119913d117d1b453e5947ed71c50d76946
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 13 May 2024 08:10:40 +0000 (17:10 +0900)]
halcc: Remove all operations based on forward/backward semantic
Those function family
- halcc_manifest_find_hal_*()
- halcc_manifest_steal_hal_*()
was given with major/minor specifying which version of hal would be
selected in terms of forward/backward compatibility. However, as
halcc_hal has changed to manage multiple version within a list, it
cannot test a specific version is in the list but can test whether
the version can be compatible with the list using
halcc_hal_is_compatible_with_version().
Logically, all those find functions can be replaced with combination
of below two functions:
halcc_manifest_find_hal(manifest, hal_name, major, minor, hal)
-> halcc_manifest_find_hal(manifest, hal_name, hal)
+ halcc_hal_is_compatible_with_version(hal, major, minor)
Additionally, the halcc_manifest_find_hal_by_name() has been renamed to
halcc_manifest_find_hal() as the default behavior of finding hal is
not based on version, but only on name.
Change-Id: Ia7a39b5fd279fd8499cb4482eff7c37fc1a57354
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 13 May 2024 07:57:09 +0000 (16:57 +0900)]
halcc: Add halcc_hal_is_compatible_with_version()
The function checks whether the given major/minor version is covered
by the given hal. The hal manages version list and one of its element
version can support the given major/minor version if its version
meets BOTH of the below:
- equal to the given major version
- equal to or greater than the given minor version
Change-Id: I72198000f6f4574dd96ac8ad1a76fd4a887024a5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 13 May 2024 05:49:01 +0000 (14:49 +0900)]
halcc: Fix parser to accept multiple version for hal
Make halcc_hal manage multiple version internally. The parser accepts
versions whenever it meets <version> element, consumes and updates
version list of halcc_hal.
Currently, the only first incoming version is set as version of a hal,
and all of the version-related operations works on top if it. This is
for making the whole code work in the current structure, but it will be
fixed to take the entire version list into account when it counts
compatibility.
Change-Id: I6b95a7692fc2ffbe3630db04b94dd6dc0f3a66cc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 3 May 2024 08:53:42 +0000 (17:53 +0900)]
halcc: Remove hal dependency scheme from manifest
It is currently not used. And for support multi-versioning hal manifest,
the current style should be totally reformed somehow. Therefore, removed
the hal dependency scheme and related operations.
Change-Id: I1857b558f6debc9463fb3babfbc1447326dfc4bb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 2 May 2024 03:10:41 +0000 (12:10 +0900)]
halcc: Fix not to use min-max semantic for minor versioning
Removed use of version format of MAJOR.MIN_MINOR-MAX_MINOR. It has
changed to have only form of MAJOR.MINOR.
Change-Id: I3fa0e0220a97f7a5dcb2c817b291a4fbd96fb5fa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 10 May 2024 07:38:00 +0000 (16:38 +0900)]
Revert removal of enum hal_abi_version definition
This has been removed since
70757d52a56abd1e9820c181bfe10aefbeee7caf.
However, the definition is still required as the reference from another
repository hasn't been totally removed yet. Those code referring the
definition and the definition itself would be removed together.
Change-Id: I6d985d2290d6aaf755e4dcca2b3a00f9820a7acb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 30 Apr 2024 06:15:04 +0000 (15:15 +0900)]
halcc: Fix thread-unsafe function, getpwnam(), getgpnam()
Change them to getpwnam_r(), getgrnam_r().
Change-Id: I3841bd9018ac30b7adb0701b4cb439009ea74dc3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 30 Apr 2024 04:44:38 +0000 (13:44 +0900)]
halcc: Make parser maintain hal to have the latest version
If halcc parser picks a hal that can be covered by hal that has been
parsed before, put the hal back. Here 'cover' means that one can
supports the other in terms of backward compatibility, for example,
v2.3 covers v2.0~v2.3. On the other hand, if a hal being picked can
cover a hal that has been parsed before, the previous hal is replaced
with the newly picked one.
Change-Id: Ie273d5065e53cd541b5edb3138b97f3c3deb1ff7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 30 Apr 2024 01:56:21 +0000 (10:56 +0900)]
halcc: Fix manifest scheme to have multiple <manifest> element
To have multiple <manifest> element, halcc parser now recognizes root
element <root> and searches for its children <manifest>.
Change-Id: I72ca77a6331f172c6a0f6e4eb3c660dccef7e71c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 23 Apr 2024 08:22:22 +0000 (17:22 +0900)]
halapi: Fix directory where halcc searches for manifest.xml
The hal manifest install path has changed to a directory, /etc/hal-manifest,
regardless of tizen version specified at /hal/etc/hal-info.ini.
Change-Id: Ib6941b89ed4688e43f954cf278add0dc8008a92b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 23 Apr 2024 06:41:20 +0000 (15:41 +0900)]
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:
<manifest version="1.0" type="platform">
<hal>
<name>HAL_MODULE_XXX</name>
<version>1.2</version>
<version>2.0</version>
<transport>passthrough</transport>
</hal>
</manifest>
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 <version>. 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 <version>. 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 <y0.cho@samsung.com>
Youngjae Cho [Tue, 23 Apr 2024 05:53:01 +0000 (14:53 +0900)]
tools: hal-compatibility-checker: Print error log
Change-Id: Id7adda83f8625065c2a48f4284265f5525c374b9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 19 Apr 2024 02:46:07 +0000 (11:46 +0900)]
halapi: Disable dependency checking between hal-api
Temporarily disable it. For now, it is unclear that dependency checking
is necessary. Because, those hal-api header and manifest.xml aren't
managed by ACR process so they could be transformed anyhow, breaking
dependency. Currently, our policy has no specification that force them
to think about and comply with dependency among hal-apis.
Change-Id: Iab1fc46674e4af0e0b6771c630d6e1a093dda8f9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 19 Apr 2024 02:23:10 +0000 (11:23 +0900)]
halapi: Remove 'level' from manifest scheme
It hasn't been used and had no role.
Change-Id: Ied4007d00e4596618a9f11e993780c343c42b1c7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 16 Apr 2024 06:08:38 +0000 (15:08 +0900)]
tests: Fix hooking to be done via wrapper provided by linker
For MCD(Module Circular Dependency) score, remove direct reference
from hal-api-common to hal-api-common-hook.c.
Change-Id: I1095243186f270cc1fb8d1ed30f7c8e954deb16d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 9 Apr 2024 07:16:11 +0000 (16:16 +0900)]
halapi: Eliminate HAL abi and its operations
HAL abi won't be used anymore. Compatibility manifest and compatibility
checker take over the role. However, the .abi_version member variable
of struct __hal_backend has not been removed but just deprecated as it
is referenced by too many modules for now. After completely removing
them, this field will be removed.
Change-Id: I2ad812be1d1b8d8d16eeca776c20837d582aa25f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 12 Apr 2024 11:09:02 +0000 (20:09 +0900)]
halapi: Separate g_compatibility_info into manifest and backend
To load those data separately, manifest and backend, separate their
data structure. It holds major/minor version instead of compatibility.
The compatibility could easily be knonw if major/minor versions of
manifest and backend have been held on memory.
In addition, storing format has been changed. Each segment is separated
by ':'.
{index}:{module_name}:{manifest_major}.{manifest_minor}:
{backend_major}.{backend_minor}:{manifest_desciption}:
{backend_description}:{compatibility}
Change-Id: Ifd59eebc60e092e0c465e92b36ffde81e1185f15
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 12 Apr 2024 06:39:49 +0000 (15:39 +0900)]
halapi: Fix storing function to accept overwrite parameter
This wipes out the access() for checking existance of file and code
branch. Due to this, code readability becomes more coherent.
Change-Id: I5e4cac06002818677051e8f4cf066d60cf7f1ca0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 12 Apr 2024 05:43:11 +0000 (14:43 +0900)]
halapi: Move hal_common family function to hal-api-common.c
Place the below functions under hal-api-common.c.
- hal_common_check_backend_compatibility()
- hal_common_check_backend_compatibility_all()
And their implementation details, which are internal use only, has
been listed on hal-api-compatibility-checker.h.
Change-Id: I208363f860c75627f8b7c3d3e1c564d62e6196f3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 9 Apr 2024 04:46:43 +0000 (13:46 +0900)]
Revert "packaging: Add some packages as Requires(post)"
This reverts commit
2bf62bbf6f24df736e3fc2360abbb70ce90eea6e.
It seems better that the /sbin/ldconfig is taken by the same package
on installing and uninstalling.
Change-Id: Iba4940fcce2ca6e2539bcfbd9897a83cd34e0880
Youngjae Cho [Fri, 12 Apr 2024 05:27:07 +0000 (14:27 +0900)]
halapi: Fix escaping condition to 'ret < 0' for consistency
Change-Id: I6ef8a25ffcb54609c42fd21bf214984fb2241002
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 8 Apr 2024 12:07:38 +0000 (21:07 +0900)]
halapi: Apply compatibility check when __init_backend()
Change-Id: Ic4938993fd3a7ce589e6d634423140a9d71bb562
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 8 Apr 2024 11:34:54 +0000 (20:34 +0900)]
halapi: Add function checking HAL compatibility
int hal_common_check_backend_compatibility()
: It checks compatibility of the given hal module.
Change-Id: I1f4e7a61b709b4bc364400a9ec7f6b920f4eb550
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 11 Apr 2024 03:30:37 +0000 (12:30 +0900)]
halapi: Add function checking all of the HAL compatibility
Previously, the API provides callbacks that give responsibility to
the caller that storing compatibility result in their own way. However,
to provide a unified way of storing and loading HAL compatibility,
hal-api-common has become responsible for storing and loading
compatibility in a unified manner.
int hal_common_check_backend_compatibility_all()
: It gets compatibility of all the hal modules. Additionally, it
stores compatibility of all modules to backing storage if there
hasn't been for later use.
Currently, the result is stored in /opt/etc/hal/.hal-compatibility and
the below is an example of result generated by hal-compatibility-checker:
root:/opt/etc/hal> cat .hal-compatibility
0:Not defined:0:Manifest hasn't specified the module
1:HAL_MODULE_TBM:0:Manifest hasn't specified the module
2:HAL_MODULE_TDM:0:Manifest hasn't specified the module
...
26:HAL_MODULE_DEVICE_DISPLAY:2:Compatible
27:HAL_MODULE_DEVICE_IR:0:Manifest hasn't specified the module
28:HAL_MODULE_DEVICE_TOUCHSCREEN:1:Backend has incompatible version
29:HAL_MODULE_DEVICE_LED:2:Compatible
30:HAL_MODULE_DEVICE_BOARD:0:Manifest hasn't specified the module
...
It has foramt of
"{index}:{module_name}:{compatibility}:{description}"
The tool hal-compatibility-checker, therefore, has changed to just call
the API, and removed callback code.
Change-Id: I4e1319bb98c81e1389e22924ae4ed70a66e46f7b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 8 Apr 2024 02:59:41 +0000 (11:59 +0900)]
halcc: Move libhalcc into libhal-api-common
There were cyclic dependencies that
: libhalcc requires libhal-api-common due to loading and checking
backend version
: libhal-api-common requires libhalcc due to checking compatibility
To remove dependency on each other, the libhalcc has been added to
the libhal-api-common.
Change-Id: I6b12310e2ffea0e038609d57158b51b973a470ce
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 8 Apr 2024 09:52:34 +0000 (18:52 +0900)]
halapi: Move 'g_platform_curr_abi_version' from header to source code
Declaring variable with initializer on header might cause muiltiple
definition. Linker would be confused when linking multiple object files
that had been compiled seperately with the header included as the linker
can see multiple definitions to which symbol g_platform_curr_abi_version
could be linked. As multiple object files are complied seperately by each
translation unit, #ifndef-#define-#endif guard has no effect in the case.
Therefore, it is general that define variable in source code and provide
getter function or directly with extern keyword.
Change-Id: Ieb30dd5c9452cd846b318c7288221c9455e1f0ae
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Fri, 5 Apr 2024 10:30:34 +0000 (19:30 +0900)]
packaging: Remove hal-rpmdb-checker.service
hal-rpmdb-checker.service checks the RPM packages version
used by each hal-backend in order to check the compatibility between
hal-backand and used RPM packages. But hal-rpmdb-checker will be
replaced with each HAL module version checker of HAL compatibility
checker. So that remove hal-rpmdb-checker.service.
Change-Id: If33924c83b4d1619d9e8fd80711fe195a846d0a4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Tue, 2 Apr 2024 06:48:13 +0000 (15:48 +0900)]
halcc: Use major/minor version instead of abi version for checking compatibility
Change-Id: Ib7fa6ed4e9a482ac5f9cdc356626444d3d762730
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Wed, 21 Feb 2024 06:26:13 +0000 (15:26 +0900)]
hal-common-interface: Add hal_common_get_backend_abi_version()
To apply HAL ABI Versioning, hal-backend major/minor version information is added.
Platform can decide whether to support hal-backend with major/minor version information.
To get major/minor versions from the hal-backend, this function is added.
int hal_common_get_backend_version(enum hal_module module, unsigned int *major_version, unsigned int *minor_version);
- It obtains version information from hal-backend.
These variables are added to hal_backend structure.
- const unsigned int major_version;
- const unsigned int minor_version;
Change-Id: I8e548aabdeb66c27304a3ea99c2853d30e600c63
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Wed, 21 Feb 2024 06:38:24 +0000 (15:38 +0900)]
halapi: Add checking abi_version pointer existence
When obtainig the backend data, abi_version pointer checking part is necessary.
Although the absence of abi_version is the intended action, it occurs error.
Checking the pointer existence part was omitted.
Change-Id: I5852bdcfd288aec485643e599af56d358b2d7739
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Thu, 14 Mar 2024 02:25:18 +0000 (11:25 +0900)]
tests: Use strict string length for xml input
As libxml2 is upgraded to version 2.12.5, there added internal
logic that tests whether the parser would have succssfully reached at
the end of the given string when it completes parsing.
The previous sizeof(str[]) is always greater by 1 than the sizeof(str[])
as it counts the terminating '\0'. And it makes libxml2 parser see that
there are some stuffs after parsing completion, reporting parse error.
Change-Id: I86cd16cb4a6b5460249900a138a6ee8dcb652d2c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 23 Feb 2024 02:40:05 +0000 (11:40 +0900)]
tools: hal-compatibility-checker: Add stdout/stderr redirection to dlog
Options, --redirect-all, --redirect-stdout, --redirect-stderr, can now
recognize special symbol "dlog" as a parameter, which redirects output
to dlog SYSTEM buffer with log tag HAL_COMPATIBILITY_CHECKER.
Change-Id: I80425f5643709d0b0b16f8aaaa98b2a3021d263a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 20 Feb 2024 10:19:54 +0000 (19:19 +0900)]
halcc: Add fail log for halcc-object operations
Change-Id: I2ced0da3de13b627dc6d8a528bf9a91a102960d6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Wed, 14 Feb 2024 10:10:06 +0000 (19:10 +0900)]
halcc: Add checking halcc_manifest_add_hal() return value
If halcc_manifest_add_hal() returns error, halcc_hal should be free.
Omitted handling code is added.
Change-Id: Ic566968760537f2375cd84e25b877115beeaddb3
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Jaehoon Chung [Fri, 23 Feb 2024 06:52:22 +0000 (15:52 +0900)]
halapi: common: Add HAL_ABI_VERSION_TIZEN_9_0
Add HAL_ABI_VERSION_TIZEN_9_0 after released Tizen-8.0.
It needs to add HAL_ABI_VERSION_TIZEN_9_0 for using correct Tizen Version.
If it's not backward compatible, it has to modify a compatible by module
owner.
Change-Id: I65359722e02e88e5deb10ee5358578da0716ff07
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Chanwoo Choi [Wed, 17 Jan 2024 23:45:33 +0000 (08:45 +0900)]
halcc: Rename to systemd-hal-compatibility-checker-generator
Use full name of HAL Compatibilicy Checker instead of non-standand short
name as following:
- systemd-hal-compatibility-checker-generator
Change-Id: I04897575f5f2fec964e554ae640d1302834bcd5e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Thu, 18 Jan 2024 01:40:33 +0000 (10:40 +0900)]
systemd-hal-cc-generator: Fix typo of PATH= environment variable
Change-Id: I444adc46255d630365d9fa6203fd6505aa2f4366
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 11 Jan 2024 08:50:58 +0000 (17:50 +0900)]
halcc: Add support for hal-api dependency checking
Optionally, hal-api can specify dependency, name and version of another
hal-api, that it must work with.
| <!--hal-api-xxx.xml-->
|
| <manifest version="1.0" type="platform" level="2">
| <hal>
| <name>AAA</name>
| <version>1.0</version>
| <dependency>
| <hal>
| <name>BBB</name>
| <version>1.0</version>
| </hal>
| ...
| </dependency>
| </hal>
| <hal>
| <name>BBB</name>
| <version>1.5</version>
| </hal>
| ...
| </manifest>
The halcc-object.c now provides
- halcc_manifest_validate_hal_dependency()
This validates dependencies between hals within manifest. It try to
find compatible hal that specified by hal-api dependency. If it
couldn't find compatible one for the dependency, the resolution fails
and the hal is regarded as not supported.
Let's say a manifest contains below specification about 4 hals
- AAA@1.5 : success
- BBB@2.3 : success
- CCC@3.3 : success
- DDD@1.0 : success
If there are no dependencies between each other, no problem.
Case1] If AAA@1.5 depends on YYY@1.0.
- AAA@1.5 -> YYY@1.0 : fail, YYY@1.0 is not specified
- BBB@2.3 : success
- CCC@3.3 : success
- DDD@1.0 : success
Case2] If AAA@1.5 depends on BBB@1.0.
- AAA@1.5 -> BBB@1.0 : fail, BBB@1.0 isn't compatible with
the specified BBB@2.3
- BBB@2.3 : success
- CCC@3.3 : success
- DDD@1.0 : success
Caser3] If AAA@1.5 depends on BBB@2.0, CCC@4.0
- AAA@1.5 -> BBB@2.0, CCC@4.0 : fail, BBB@2.0 is backward compatible
with the specified BBB@2.3, but CCC@4.0 isn't
compatible with the specified CCC@3.3.
- BBB@2.3 : success
- CCC@3.3 : success
- DDD@1.0 : success
If multiple dependencies are specified on a hal, it success only when
all the dependencies are satisfied.
Case4] If AAA@1.5 depends on BBB@2.0
and BBB@2.3 depends on CCC@3.0
and CCC@3.3 depends on DDD@1.5
- AAA@1.5 -> BBB@2.0 : fail, BBB@2.0 is backward compatible with the
specified BBB@2.3, but BBB@2.3 has failed to
validate dependency
- BBB@2.3 -> CCC@3.0 : fail, CCC@3.0 is backward compatible with the
specified CCC@3.3, but CCC@3.3 has failed to
validate dependency
- CCC@3.3 -> DDD@1.5 : fail, DDD@1.5 isn't compatible with the
specified DDD@1.0
- DDD@1.0 : success
The failure is propagated to all hals that have dependency on that
failed hal.
Case5] If AAA@1.5 depends on BBB@2.1
and BBB@2.3 depends on CCC@3.0
and CCC@3.3 depends on AAA@1.0
- AAA@1.5 -> BBB@2.1 : fail, cyclic dependency
- BBB@2.3 -> CCC@3.0 : fail, cyclic dependency
- CCC@3.3 -> AAA@1.0 : fail, cyclic dependency
- DDD@1.0 : success
All hals that make dependency cycle are failure.
Case6] If AAA@1.5 depends on BBB@2.0
and BBB@2.3 depends on CCC@3.0
- AAA@1.5 -> BBB@2.0 : success
- BBB@2.3 -> CCC@3.0 : success
- CCC@3.3 : success
- DDD@1.0 : success
In addition, the tool hal-compatibility-checker has changed to validate
dependency, by default, before it checks compatibility.
Change-Id: I34ce0f78a9ae9c05f65c77b20199353c93072851
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 3 Jan 2024 04:14:45 +0000 (13:14 +0900)]
systemd-hal-cc-generator: Add hal compatibility checker
In early booting state, the hal-compatibility-checker operates aided
by systemd-generator. It checks compatibility manifested by hal-api
and abi-version of hal-backend. Once it successfully checks and stores
result, those next following bootings won't do this again but just
reuse the result.
Change-Id: Id9a50a921f8e0d21de292d1aab81e490973cb2d1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 2 Jan 2024 11:14:35 +0000 (20:14 +0900)]
tools: Add hal-compatibility-checker
Provide tool for executing compatibility checker of libhalcc by command.
See 'hal-compatibility-checker --help'.
Change-Id: I3bfd46496997471dcd41d790cc702cc57664a01b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 19 Dec 2023 06:24:38 +0000 (15:24 +0900)]
halcc: Introduce halcc library
The halcc stands for hal compatibility checker.
Tizen hal-apis can specify what feature and version it expects to
hal-backends in manifest file. The halcc library deserializes and
utilizes the information for checking compatibility between
hal-api and hal-backend.
For example, a hal-api specifies what it needs in xml file:
| <!--hal-api-xxx.xml-->
|
| <manifest version="1.0" type="platform" level="2">
| <hal>
| <name>AAA</name>
| <version>3.1</version>
| <transport>passthrough</transport>
| </hal>
| ...
| </manifest>
It means that the hal-api expects and requires hal-backend module name
of AAA, and version of 3.x where x >= 1.
(See semantic versioning, https://semver.org)
These are collected and tested by the halcc library.
Currently only the function below is provieded
- int halcc_check_compatibility(const char *hal_api_manifest_dir,
halcc_compatibility_cb callback, void *user_data)
: It collects manifest files at hal_api_manifest_dir and checks
whether the hal-backends have compatible what hal-apis have
specified. For each specified <hal> in manifests, callback is
invoked.
Change-Id: Ibb16c378f6fbe08750b6df7db99ee6626bcfd033
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 22 Dec 2023 01:18:16 +0000 (10:18 +0900)]
halapi: Add NULL check for strncpy() dest buffer
Change-Id: I6dbd911d246edc49b2eecabe4eb2400affb86b9e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 13 Dec 2023 04:55:41 +0000 (13:55 +0900)]
halapi: Fix strncpy() warnings
Those strncpy() cause warnings, -Wstringop-truncate, -Wstringop-overflow
due to the length calculated by strlen(). Replace the length with the
explicit size specified by the parameter. It is logically the same as
before.
Change-Id: I5b06f8595aa89f32fc7a6becab31130eb1178116
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Unsung Lee [Sat, 25 Nov 2023 12:51:34 +0000 (21:51 +0900)]
CMakeLists.txt: Add security compiling option (RELRO, SC, and FORTIFY)
Add security compiling option (RELRO, SC, and FORTIFY) in CFLAGS.
Change-Id: Ic32765cd1967b7f8d028acac238a3ccf001c6992
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Chanwoo Choi [Mon, 10 Jul 2023 09:02:51 +0000 (18:02 +0900)]
halapi: common: Add new HAL_ABI_VERSION_TIZEN_8_0
Add new HAL_ABI_VERSION_TIZEN_8_0 and then HAL_ABI_VERSION_TIZEN_7_5 is
deprecated because of changes of tizen major version.
Change-Id: I8f26b12f2f81dccda0997b624b055c4479cc7ab8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 4 Jul 2023 23:14:11 +0000 (08:14 +0900)]
tools: lshal: Add missing flag to print hal backend information
Need to pass LSHAL_FLAG_* flags in order to print the hal backend
information. commit
9746f25a833a (tools: lshal: Fix wrong operation
when checking flag is set or not) fixed the wrong bitmap operation.
In result, the unknown issue occurred. So that add missing flag
to print all hal backend information.
Change-Id: If07f0908e4b4d50862ba942a3678d7e52fff8ce5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 31 May 2023 05:19:49 +0000 (14:19 +0900)]
Revert "halapi: Fix mismatch by closing backend"
This reverts commit
82c338c4db17f1517e3efec3e4c482034f4b6b0d
because it causes the system halt.
Change-Id: I67a0ea9f324dfa46e894a3b49050eba972821cf3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 27 Apr 2023 04:59:44 +0000 (13:59 +0900)]
halapi: Add support of RISC-V architecture type
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>
Chanwoo Choi [Fri, 21 Apr 2023 02:04:15 +0000 (11:04 +0900)]
tools: lshal: Fix wrong operation when checking flag is set or not
When using bit operation for flag, should use 'and' operation.
But, lshal.c used the wrong operation. It fix the operatin from 'or' to
'and'.
Change-Id: I3a2badb8c61f73a6fc8d98b737fa6d7d4134c9eb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 13 Mar 2023 21:17:42 +0000 (06:17 +0900)]
tools: Add lshal tool to get hal backends
Provide lshal to get the detailed informaiton of hal backends on device.
[Description of each attribute of lshal tool]
- HAL Module Name : HAL Module Name (fixed, not be changed)
- ID : HAL Module Unique ID (fixed, not be changed)
- Backend Library Name : HAL Backend Library Name (fixed, not be changed)
- Backend Open Count : HAL Backend Open Count (it's changed according to user count)
- Backend Verification : If there is HAL backend, print "YES".
: If HAL backend is verified (get/put_backen), print "VERIFIED".
- Backend Symbol Name : HAL Backend Symbol Name (fixed, not be changed)
- Backend ABI Version : HAL Backend ABI Version (Written by Backend Developer)
- Backend Name : HAL Backend Name (Written by Backend Developer)
- Vendor Name : HAL Backend Vendor Name (Written by Backend Developer)
- TOTAL : The number of HAL modules and backends
[Example on rpi4 armv7l environment]
root:~> lshal
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| | | Backend | Backend | Backend | Backend ABI Version | Backend Name | Vendor Name |
HAL Module Name | ID | Backend Library Name | Open Count | Verification | Symbol Name | (Written by Developer) | (Written by Developer) | (Written by Developer) |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HAL_MODULE_TBM | 1 | /hal/lib/libhal-backend-tbm.so | 4 | YES | VERIFIED | hal_backend_tbm_data | HAL_ABI_VERSION_TIZEN_6_5 | vc4 | Samsung |
HAL_MODULE_TDM | 2 | /hal/lib/libhal-backend-tdm.so | 2 | YES | VERIFIED | hal_backend_tdm_data | HAL_ABI_VERSION_TIZEN_6_5 | vc4 | Samsung |
HAL_MODULE_COREGL | 3 | | | | | | | | |
HAL_MODULE_INPUT | 4 | | | | | | | | |
HAL_MODULE_AUDIO | 5 | /hal/lib/libhal-backend-audio.so | 1 | YES | VERIFIED | hal_backend_audio_data | HAL_ABI_VERSION_TIZEN_6_5 | audio-rpi | Broadcom |
HAL_MODULE_CAMERA | 6 | /hal/lib/libhal-backend-camera.so | 1 | YES | VERIFIED | hal_backend_camera_data | HAL_ABI_VERSION_TIZEN_6_5 | camera-v4l2 | TIZEN |
HAL_MODULE_RADIO | 7 | /hal/lib/libhal-backend-radio.so | 0 | NO | | hal_backend_radio_data | | | |
HAL_MODULE_CODEC | 8 | | | | | | | | |
HAL_MODULE_USB_AUDIO | 9 | | | | | | | | |
HAL_MODULE_ALSAUCM | 10 | | | | | | | | |
HAL_MODULE_BLUETOOTH | 11 | /hal/lib/libhal-backend-bluetooth.so | 1 | YES | VERIFIED | hal_backend_bluetooth_data | HAL_ABI_VERSION_TIZEN_6_5 | bluetooth | broadcom |
HAL_MODULE_WIFI | 12 | /hal/lib/libhal-backend-wifi.so | 0 | NO | | hal_backend_wifi_data | | | |
HAL_MODULE_NAN | 13 | | | | | | | | |
HAL_MODULE_NFC | 14 | /hal/lib/libhal-backend-nfc.so | 0 | NO | | hal_backend_nfc_data | | | |
HAL_MODULE_ZIGBEE | 15 | /hal/lib/libhal-backend-zigbee.so | 0 | NO | | hal_backend_zigbee_data | | | |
HAL_MODULE_UWB | 16 | /hal/lib/libhal-backend-uwb.so | 0 | NO | | hal_backend_uwb_data | | | |
HAL_MODULE_MTP | 17 | | | | | | | | |
HAL_MODULE_TELEPHONY | 18 | | | | | | | | |
HAL_MODULE_LOCATION | 19 | /hal/lib/libhal-backend-location.so | 3 | YES | VERIFIED | hal_backend_location_data | HAL_ABI_VERSION_TIZEN_6_5 | location-backend | replay |
HAL_MODULE_COMMON | 20 | | | | | | | | |
HAL_MODULE_POWER | 21 | /hal/lib/libhal-backend-power.so | 1 | YES | VERIFIED | hal_backend_power_data | HAL_ABI_VERSION_TIZEN_6_5 | power-rpi4 | Rasberry Pi |
HAL_MODULE_SENSOR | 22 | /hal/lib/libhal-backend-sensor.so | 0 | NO | | hal_backend_sensor_data | | | |
HAL_MODULE_PERIPHERAL | 23 | | | | | | | | |
HAL_MODULE_DEVICE_BATTERY | 24 | /hal/lib/libhal-backend-device-battery.so | 0 | NO | | hal_backend_device_battery_data | | | |
HAL_MODULE_DEVICE_BEZEL | 25 | /hal/lib/libhal-backend-device-bezel.so | 0 | NO | | hal_backend_device_bezel_data | | | |
HAL_MODULE_DEVICE_DISPLAY | 26 | /hal/lib/libhal-backend-device-display.so | 2 | YES | VERIFIED | hal_backend_device_display_data | HAL_ABI_VERSION_TIZEN_7_0 | display | RPI |
HAL_MODULE_DEVICE_IR | 27 | /hal/lib/libhal-backend-device-ir.so | 0 | NO | | hal_backend_device_ir_data | | | |
HAL_MODULE_DEVICE_TOUCHSCREEN | 28 | /hal/lib/libhal-backend-device-touchscreen.so | 1 | YES | VERIFIED | hal_backend_device_touchscreen_data | HAL_ABI_VERSION_TIZEN_7_0 | touchscreen | RPI |
HAL_MODULE_DEVICE_LED | 29 | /hal/lib/libhal-backend-device-led.so | 1 | YES | VERIFIED | hal_backend_device_led_data | HAL_ABI_VERSION_TIZEN_7_0 | led | RPI |
HAL_MODULE_DEVICE_BOARD | 30 | /hal/lib/libhal-backend-device-board.so | 1 | YES | VERIFIED | hal_backend_device_board_data | HAL_ABI_VERSION_TIZEN_7_0 | board | RPI |
HAL_MODULE_DEVICE_EXTERNAL_CONNECTION | 31 | /hal/lib/libhal-backend-device-external-connection.so | 0 | NO | | hal_backend_device_external_connection_data | | | |
HAL_MODULE_DEVICE_THERMAL | 32 | /hal/lib/libhal-backend-device-thermal.so | 1 | YES | VERIFIED | hal_backend_device_thermal_data | HAL_ABI_VERSION_TIZEN_7_0 | thermal | RPI |
HAL_MODULE_DEVICE_USB_GADGET | 33 | /hal/lib/libhal-backend-device-usb-gadget.so | 0 | NO | | hal_backend_device_usb_gadget_data | | | |
HAL_MODULE_DEVICE_HAPTIC | 34 | /hal/lib/libhal-backend-device-haptic.so | 1 | YES | VERIFIED | hal_backend_device_haptic_data | HAL_ABI_VERSION_TIZEN_7_0 | haptic | RPI |
HAL_MODULE_DEVICE_MEMORY | 35 | /hal/lib/libhal-backend-device-memory.so | 1 | YES | VERIFIED | hal_backend_device_memory_data | HAL_ABI_VERSION_TIZEN_7_0 | memory | RPI |
HAL_MODULE_DEVICE_INPUT | 36 | /hal/lib/libhal-backend-device-input.so | 0 | NO | | hal_backend_device_input_data | | | |
HAL_MODULE_DEVICE_POWER | 37 | /hal/lib/libhal-backend-device-power.so | 0 | NO | | hal_backend_device_power_data | | | |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL | 37 | | | 14 | | | | |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Change-Id: Id8246ff25d6cabf785b3fd1c6f24b1a1749daf0f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 28 Mar 2023 16:57:19 +0000 (01:57 +0900)]
halapi: Add new hal_common_get_backend_module_name function
Add new hal_common_get_backend_module_name function in order to provide
the HAL module name
[Detailed function prototype]
- int hal_common_get_backend_module_name(enum hal_module module, char *name, int size);
Change-Id: I521846db3917571ea7cfa00dd701dd9e8c7c97a2
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Sun, 26 Mar 2023 22:47:26 +0000 (07:47 +0900)]
halapi: Add missing exception handling of hal_common_get_backend_library_name
Change-Id: I9832ecce9923cfdd45196293c3af16bff1358ae5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Apr 2023 02:23:01 +0000 (11:23 +0900)]
halapi: Fix mismatch by closing backend
Change-Id: I1bd0d6548551a35cb9c993dfc6f3094d87c8bcca
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 13 Mar 2023 21:31:58 +0000 (06:31 +0900)]
halapi: common: Remove unused variables on _get_module_info_with_library_name
Change-Id: I5bb8472601d010a7e7b0e8d8e7b56f191c1d543b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 15 Mar 2023 09:33:04 +0000 (18:33 +0900)]
systemd-hal-firmware-generator: Fix wrong firmware loading path
Change-Id: Id83b9b295f878b08eaad41501e779703afa04260
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Jaehoon Chung [Thu, 22 Dec 2022 03:22:54 +0000 (12:22 +0900)]
hal-api: common: fix the error handling path
Before calling hal_api_conf_exit(), it needs to call close_backend().
Otherwise, hal_api_conf_exit will call free(info) before info->backend/handle.
Change-Id: If9b3b66d3bb7c9e5d92ebd565815c13bde4babdb
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
TaeminYeom [Thu, 1 Dec 2022 09:28:28 +0000 (18:28 +0900)]
halapi: common: add device power interface
To add device wakeup source function in device hal, it is needed.
Change-Id: I23d23f758134bea3bc02c488154a737f3e85c1d1
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
Yunhee Seo [Tue, 13 Dec 2022 05:41:42 +0000 (14:41 +0900)]
halapi: common: add DEVICE_INPUT HAL module
Add DEVICE_INPUT HAL module to control the input device.
Change-Id: Iddb6457850cfe9ce36cb9f20db6dedc7e894a9a4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Jaehoon Chung [Tue, 15 Nov 2022 00:43:03 +0000 (09:43 +0900)]
halapi: common: Add HAL_ABI_VERSION_TIZEN_7_5
Add HAL_ABL_VERSION_TIZEN_7_5 after released Tizen-7.0.
Because current Tizen Version is 7.5, It needs to add current Tizen
version about HAL_ABI_VERSION.
If it's not compatible between TIZEN_6.5 and TIZEN_7.5, it needs to
modify by modules owner.
Change-Id: Ifabd5981e7add0a9b07e08cb8fb14c603febb16f
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Chanwoo Choi [Tue, 21 Jun 2022 15:58:01 +0000 (00:58 +0900)]
tests: unittest: Add new test for hal_common_get_backend_with_library_name
Basically, the hal backend library name of each module is already decied
such as 'libhal-backend-[module name].so'. But, some module requires
the hal backend library loading way with their own library name
like 'libhal-backend-[module name]-lidar.so'.
When loading the their own library name, hal_common_get_backend_with_library_name
and hal_common_put_backend_with_library_name are used.
So that add new for hal_common_get/put_backend_with_library_name
and add 'backend_module_name' attribute to class HalInfo
because 'backend_module_name' is required to check the hal backend name
as I mentioned above.
Change-Id: Idbd5ae4f23714a4efdb857d2a1ed0885a927e887
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 16 Jun 2022 03:48:35 +0000 (12:48 +0900)]
tests: unittest: Add new test for hal_common_get_backend and put_backend function
hal_common_get_backend and hal_common_put_backend functions are very
important because they are in charge of loading/unloading the hal
backend library for all hal backends and also verify the validation checking
of the loaded hal backend library. When executing hal_common_get_backend and
hal_common_put_backend, there are very complex validation sequence.
It means that have to verify the internal logic of both
hal_common_get_backend and hal_common_put_backend at the implementation
step in order to catch the error.
So that add new test for hal_common_get_backend and
hal_common_put_backend functions.
Change-Id: I8d42e9327248c283d8f01fc8b5f5926e0d371ba5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 16 Jun 2022 05:36:55 +0000 (14:36 +0900)]
tests: unittest: Add hook function for handle hal backend library
The hal-api-common uses the dlopen/dlsym/dlclose to load/unload
the shared library of hal backend and find symbol from hal backend library.
For testing hal-api-common functions when building time, re-implement
dlopen/dlsym/dlclose for hooking.By implementing the hooking functions,
be able to verify the internal logic of hal-api-common functions.
Following fucntions are re-implemented for hooking:
- void *dlopen(const char *filename, int flags)
- int dlclose(void *handle)
- void *dlsym(void *handle, const char *symbol)
- int access(const char *pathname, int mode)
And hal-backend-[module] (e.g., tbm/tdm/audio/camera/devcie/power etc)
have to contain the their own hal_backend structure to implement
the h/w device-dependent hal backend. Instead of adding the each hal_backend
structure for all hal modules, use the common 'hal_backend_module_data'
regardless of hal module name.
Change-Id: Icbcba49a654f9ed1a287233c9cc0e3efcca508df
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 16 Jun 2022 03:12:51 +0000 (12:12 +0900)]
tests: unittest: Rename unitttest name to hal-api-common-unittest
hal-api-common is the official module name. In order to improve
the readability of unittest name, rename to hal-api-common-unittest
as following:
- common-unittest -> hal-api-common-unittest
- CommonHaltest -> HalApiCommonTest
Change-Id: I9a3e1667b76b9fab361fddca3cb052389526f581
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 13 Jun 2022 09:29:25 +0000 (18:29 +0900)]
tests: unittest: Use tab for indentaion instead of space
In order to improve the readability and keep the consistent indentation style,
use tab instead of space.
Change-Id: Ie8fb6167484dc6fa7e0daa5b395c8a83f9d0b7e0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 16 Jun 2022 01:11:15 +0000 (10:11 +0900)]
tests: unittests: Rename to test-hal-api-common.cc for using correct name
test_hal.cc contains the test code of hal-api-common funcitons.
In order to pass the correct meaning of file, rename from test_hal.cc
to test-hal-api-common.cc.
Also, rename from test_main.cc to test-main.cc by using '-' instead of
'_'.
Change-Id: Ibf8dd8aebb24ea231b87e4fb7ebad98c01afcd91
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Wed, 15 Jun 2022 04:25:37 +0000 (13:25 +0900)]
hal-api: common: Do not treat "No such file or directory" as error log
There might be an environment that naturally has no hal backend. For
the environment, changed log level to info so that not to be confused
as an error.
Change-Id: Ia458d7ec6c5bc89cbe58a35df0f7d6343bceae66
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>