platform/hal/api/common.git
2 months agohal-backend-service: Change to use proc_name from the commandline argument 11/320511/10
SangYoun Kwak [Tue, 4 Mar 2025 09:25:00 +0000 (18:25 +0900)]
hal-backend-service: Change to use proc_name from the commandline argument

The proc_name for rpc communication should be unique through the whole
system. Also, proc_name should be shared with proxy process, so it
should be come from out of the process.

To accomplish this, hal-backend-service is changed to get commandline
argument with option --stub-proc-name and use it as a proc_name.

Usage: hal-backend-service --stub-proc-name <proc_name> <modules> [ <modules> ... ]

Change-Id: If39d1e57b7f43e0c83e6143cbe7e3854821bc8aa
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 months ago[HALACR-19] Add new HAL_MODULE_DRM module 03/321103/2 accepted/tizen/unified/20250319.072535 accepted/tizen/unified/x/20250319.090557
Haesu Gwon [Fri, 14 Mar 2025 03:44:21 +0000 (12:44 +0900)]
[HALACR-19] Add new HAL_MODULE_DRM module

[Role of HAL_MODULE_DRM]
DRM(Digital Rights Management) requires hardware support to achieve high security level and it's implemented by vendor or product team.
DRM HAL APIs provide an common interface to access such security hardware and its related software assets.

[Details description of newly added HAL_MODULE_DRM module]
- group = HAL_GROUP_MULTIMEDIA,
- module = HAL_MODULE_DRM,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_DRM",
- backend_module_name = "drm",
- library_name = "/hal/lib/libhal-backend-drm.so",
- library_name_64bit = "/hal/lib64/libhal-backend-drm.so",
- symbol_name = "hal_backend_drm_data",
- manifest = "/etc/hal/hal-api-drm-manifest.xml",
- hal_api = true,

Change-Id: I1dd4fb49dbc0493b6408713f9c50fce97f781723

3 months agohal-backend-service: Fix to safely convert value from int to gpointer 19/321119/3 accepted/tizen/unified/20250318.072946 accepted/tizen/unified/x/20250318.211721
SangYoun Kwak [Fri, 14 Mar 2025 05:05:49 +0000 (14:05 +0900)]
hal-backend-service: Fix to safely convert value from int to gpointer

To capture signal during gmainloop is running, signal handler should be
registered using "g_unix_signal_add" function. It gets handler callback
as GSourceFunc type function and its definition is below:
gboolean (* GSourceFunc) (gpointer user_data);

It gets gpointer as a parameter and there is no way to know which signal
is caught in the callback function, the signal number should be provided
through the user_data.

Signal number is a integer type and user_data is gpointer type, so it
should be passed as a integer pointer but it is inconvenient and
unnecessarily complicated. To simplify it, the signal number can be
converted as gpointer, but this will make compiler produce warnings.

To resolve this, there are a pair of macro functions: GINT_TO_POINTER
and GPOINTER_TO_INT. This macros can remove warnings about
int-to-pointer conversion.(Also this macro is designed for this kind of
works)

Change-Id: I5f9f1df879a5325ac8f1166ba81c2a7bfc4079d0
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agohal-backend-service: Fix the usage of free functions of GString 16/321116/3
SangYoun Kwak [Fri, 14 Mar 2025 02:15:49 +0000 (11:15 +0900)]
hal-backend-service: Fix the usage of free functions of GString

Previously, a glib function g_string_free to free GString object was
used like below:
(task_name is a GString object)
 1. Assign task_name->str into another char * type variable manually.
 2. Free task_name as g_string_free(task_name, FALSE);
    This will free GString object without its buffer.
    Buffer is provided as a return value but this buffer is already
    assigned to another variable, it is ignored.
 3. If error occurs, g_string_free(task_name, FALSE) is called.

This may cause memory leak in the error situation and even in the
non-error situation, ignoring the return value of a function call might
cause problem during maintainance.

Thus, it is fixed to get buffer from the return value of
g_string_free_and_steal, which frees GString object and returns buffer.
(It is equivalent to "g_string_free(task_name, FALSE)")
In the error situation, GString object is freed completely with its
buffer.

Change-Id: Idc1f0667819e67fa51823bfc37da523993a1b120
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agohal-backend-service: Add device-battery hal-backend-service-plugin 73/321073/1 accepted/tizen/unified/20250314.085109 accepted/tizen/unified/x/20250314.100520
Youngjae Cho [Thu, 13 Mar 2025 10:20:42 +0000 (19:20 +0900)]
hal-backend-service: Add device-battery hal-backend-service-plugin

Add device-battery plugin to support HAL_MODULE_DEVICE_BATTERY ipc mode.

Change-Id: I049e35691c2177b3d727dbe308986f17950d50de
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months ago[HALACR-21] Add new HAL_MODULE_SECURITY_AUTH module 08/320208/5
Dongik Lee [Tue, 25 Feb 2025 07:56:23 +0000 (16:56 +0900)]
[HALACR-21] Add new HAL_MODULE_SECURITY_AUTH module

[Role of HAL_MODULE_SECURITY_AUTH]
Auth framework requires password manager to access secure element modules such as TMP, HSM, etc.
accordingly, auth hal interface provides a common interface to access its related software assets

[Detailed description of newly added HAL_MODULE_SECURITY_AUTH module]
- group = HAL_GROUP_SECURITY,
- module = HAL_MODULE_SECURITY_AUTH,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_SECURITY_AUTH",
- backend_module_name = "security-auth",
- library_name = "/hal/lib/libhal-backend-security-auth.so",
- library_name_64bit = "/hal/lib64/libhal-backend-security-auth.so",
- symbol_name = "hal_backend_security_auth_data",
- manifest = "/etc/hal/hal-api-security-manifest.xml",
- hal_api = true,
- backend_service_library_name = "/usr/lib/hal/libhal-backend-service-security-auth.so",
- backend_service_library_name_64bit = "/usr/lib64/hal/libhal-backend-service-security-auth.so",
- backend_service_symbol_name = "hal_backend_service_security_auth_data",

Change-Id: Ia8951cad3aada7f8c2ab3cc943fd8610089711a9

3 months agohal-backend-service: Remove unused sockets and fix socket names 33/320933/2 accepted/tizen/unified/20250312.145430 accepted/tizen/unified/x/20250312.134142
SangYoun Kwak [Tue, 11 Mar 2025 09:06:10 +0000 (18:06 +0900)]
hal-backend-service: Remove unused sockets and fix socket names

Since there are unused sockets, they are removed.
Also, socket name was started with .d::HalBackendStub but it should be
started with .d::HalBackendService so they are fixed.

Change-Id: Ieadc716b0e1ffc440dfa488c7766e5472e718f09
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agohal-backend-service: Change to return 0 when no available module 34/320934/2
SangYoun Kwak [Tue, 11 Mar 2025 09:16:55 +0000 (18:16 +0900)]
hal-backend-service: Change to return 0 when no available module

Previously, if there is no module that can be loaded, service is exited
with return code 1. This will cause the service hal-backend-service be
failed, but it is not desirable for the hal-backend-service scenario.

To fix this, hal-backend-service is modified to return 0 when there is
no available module.

Change-Id: Id239133c09ba7f1e5663d724dae6899dbf8d2bbd
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agocommon: Fix __open/close_backend() to control usage_count exclusively 11/319811/6 accepted/tizen/unified/20250310.131219 accepted/tizen/unified/x/20250311.125538
Youngjae Cho [Tue, 18 Feb 2025 06:59:56 +0000 (15:59 +0900)]
common: Fix __open/close_backend() to control usage_count exclusively

Let the usage_count be encapsulated within the __open_backend() and
__close_backend(). On calling those functions, the usage_count will
be calculated, and operations will be or won't be taken based on the
usage_count. Nothing will be necessary to manage the usage_count
outside of __open_backend() or __close_backend().

Change-Id: If4c3253be8e830f727b8b7741a3b946a1bc6e3fa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months agohalapi: Fix wrong hal-backend-service symbol name of HAL_MODULE_AUDIO 89/320789/2
Yunhee Seo [Fri, 7 Mar 2025 08:06:20 +0000 (17:06 +0900)]
halapi: Fix wrong hal-backend-service symbol name of HAL_MODULE_AUDIO

Change-Id: Iace31cad6fd2dc8d50b826ab4bc48c1753c92052
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
3 months ago[HALACR-20] hal-common: Add new module HAL_MODULE_ML 42/318242/10 accepted/tizen/unified/20250310.024622 accepted/tizen/unified/x/20250310.042822
Yongjoo Ahn [Mon, 13 Jan 2025 04:07:42 +0000 (13:07 +0900)]
[HALACR-20] hal-common: Add new module HAL_MODULE_ML

Adds a hal module `HAL_MODULE_ML` for Tizen ML API.
ML APIs which are using certain SoC/vendor specific framework/device
should use this hal api.
Also adds a hal_group `HAL_GROUP_MACHINE_LEARNING`

Change-Id: Ib69d34ef6eaa314c51324d9be480b95d5a38a384
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
3 months agotools: lshal: Add --reset option to reset cache file 08/320508/4 accepted/tizen/unified/20250306.094544 accepted/tizen/unified/x/20250306.134918
Youngjae Cho [Tue, 4 Mar 2025 08:48:22 +0000 (17:48 +0900)]
tools: lshal: Add --reset option to reset cache file

The lshal option --reset removes single file,
/opt/etc/hal/.hal-backend-compatibility-loaded. By that way, an access
to the /opt/etc/hal/.hal-backend-compatibility will truncate the file.
Any following call for the cache file will update it to the latest data,
and then recreate .hal-backend-compatibility-loaded to seal the updated
data.

Plus, to reset the cache for every rpm installation, the 'lshal --reset'
is added to %post script.

Change-Id: Id0a9a1390af3dcf1708028b4ad731f43f822d449
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months agohal-backend-service: Fix to check return value of rpc_port_register_proc_info 73/320473/2
SangYoun Kwak [Tue, 4 Mar 2025 06:17:09 +0000 (15:17 +0900)]
hal-backend-service: Fix to check return value of rpc_port_register_proc_info

For the reliability, the return value of rpc_port_register_proc_info()
should be checked.

Change-Id: I420b894c50b4c532c79eaa22e74d82bba3c9b003
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agohal-backend-service: Change to use modules only specified by arguments 28/320428/3
SangYoun Kwak [Fri, 28 Feb 2025 09:08:32 +0000 (18:08 +0900)]
hal-backend-service: Change to use modules only specified by arguments

To limit the modules assigned to the task, it is modified to create
tasks only for the modules received through the command line argument.

The command line argument can be provided by the following rules:
 1. Modules combiled with ','(comma) will be assigned to one task.
    ex) hal-backend-service device-display,device-led
        In this case, device-display and device-led will be assigned to
        one task.
 2. Modules separated with ' '(space) will be assigned to different
    threads.
    ex) hal-backend-service device-display device-led
        In this case, two modules will be assigned to two different
        tasks.
 3. It is possible to combine spaces and commas.
    ex) hal-backend-service device-display,device-led codec
        In this case, device-display and device-led will be assignet to
        the same task, while codec is assigned to another task.

If no module is provided or there is no available module,
hal-backend-service will be exited.

Change-Id: I54e15cde4b9418fd7fabe3c98511a985f944ab25
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agohal-backend-service: Replace thread to tizen-core 79/320379/4
SangYoun Kwak [Thu, 27 Feb 2025 12:35:00 +0000 (21:35 +0900)]
hal-backend-service: Replace thread to tizen-core

Previously, thread is used to run modules separately but the
comminucation was occured on gmainloop and there is only one gmainloop,
all comminucations were occured on one thread.

To fix this issue, tizen-core is used to run modules separately since it
supports separated gmainloop.

Change-Id: Ice506b1ad0bccf77b4790a6383f9f2e4ce554f90
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agohalapi: Fix wrong hal-backend-service library path of HAL_MODULE_DEVICE_POWER 43/320343/1
Chanwoo Choi [Thu, 27 Feb 2025 02:50:20 +0000 (11:50 +0900)]
halapi: Fix wrong hal-backend-service library path of HAL_MODULE_DEVICE_POWER

Change-Id: I577dcd2af51f18cc6a2822043c40e370832d6f35
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 months agohal-backend-service: Add socket data for all supported hal-api 22/320322/1
Chanwoo Choi [Wed, 26 Feb 2025 11:22:58 +0000 (20:22 +0900)]
hal-backend-service: Add socket data for all supported hal-api

Add socket data for all supported hal-api by using hal module name.

Change-Id: Iae9736c2b027391bede0ed37b14b4ef771d297de
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 months agohalapi: Disable to load hal-backend-service plugin of hal-api-common 97/320297/2 accepted/tizen/unified/20250227.050116 accepted/tizen/unified/x/20250227.210242
Chanwoo Choi [Wed, 26 Feb 2025 07:56:05 +0000 (16:56 +0900)]
halapi: Disable to load hal-backend-service plugin of hal-api-common

Edit hal-api filed value of hal-api-common as false
to diisable to load hal-backend-service plugin of hal-api-common.

Change-Id: I0c96954682f65680f76992d3ff5c873f411a7ae0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 months agohal-backend-service: Disable when profile is TV 63/320263/5
SangYoun Kwak [Wed, 26 Feb 2025 02:39:33 +0000 (11:39 +0900)]
hal-backend-service: Disable when profile is TV

To disable hal-backend-service when the profile is TV, a flag is added
to the .spec file named 'enable_hal_backend_service'. If this flag is 0,
then hal-backend-service is excluded from build and install process.

Change-Id: I1e94a6745cc2f1f4fa10441cb646b95a5409d676
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
3 months agoAdd hal-backend-service plugin data 04/320104/9
Chanwoo Choi [Wed, 19 Feb 2025 03:57:55 +0000 (12:57 +0900)]
Add hal-backend-service plugin data

Each hal-api has the their own hal-bakend-service plugin data to be
loaded by hal-backend-service.service.

[Detailed description of newly added fileds for hal-backend-service plugin]
- Add new fields to load hal-backend-service plugin and get symbol
 .backend_service_library_name       : 32bit file path of hal-backend-service plugin
 .backend_service_library_name_64bit : 64bit file path of hal-backend-service plugin
 .backend_service_symbol_name        : Symbol name loaded by dlsym

- Example of hal-backend-service-tbm plugin,
 .backend_service_library_name       = "/usr/lib/hal/libhal-backend-service-tdm.so",
 .backend_service_library_name_64bit = "/usr/lib64/hal/libhal-backend-service-tdm.so",
 .backend_service_symbol_name        = "hal_backend_service_tdm_data",

Change-Id: Iac7e385f92b8ec9727f78a9e7d83817acdf0a3fb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 months agoAdd hal-backend-service 03/320103/9
Chanwoo Choi [Wed, 19 Feb 2025 03:25:14 +0000 (12:25 +0900)]
Add hal-backend-service

Support IPC based HAL communication between hal-api and hal-backend.
hal-backend-service is composed with hal-backend-service and
hal-backend-service-[module] plugin to separate the common code from
specific hal-api TIDL stub (service) code.

[Sequence of hal-backend-service execution and
hal-backend-service-[module] plugin loading]
1. Tizen booting
2. hal-backend-service.socket is ready on earl booting stage
3. hal-backend-service.service has dependency with hal-backend-service.socket.
   After executing hal-backend-service.socket,
   hal-backend-service.service is executed before tizen system services.
4. hal-backend-service initializes IPC server(stub)
   and loads hal-backend-service-[module] plugin for all HAL modules.
5. hal-backend-service-[module] loads hal-backend under /hal
6. When hal-backend-service receives IPC from hal-ipc-[module]'s proxy,
   invoke loaded hal-backend function via hal-backend-service-[module]
   plugin.

[Detailed description of hal-backend-service and
hal-backend-service-[module] plugin]
 - hal-backend-service
   : Provide common code to load hal-backend-service-[module] plugin
     and create thread for each hal-backend-service-[module] service
 - hal-backend-servcie-[module] plugin
   : Implement TIDL stub (server) to communicate hal-api-[module]'s
   proxy (client) which is executed by hal-[module].h on platform side

[Relationship between hal-ipc and hal-backend-service]
  ------------------------------------------
  System Service             (Process)
     | (Function call)
  hal-ipc                    (shared library)
     |
     | (IPC)
     |
  hal-backend-service        (Process)
     | (Function Call)
  hal-backend-service plugin (shared library)
     |                            [Platform]
  ==========================================
     | (Function call)                 [HAL]
  hal-backend                (shared library)
  ------------------------------------------
  kernel                            (Kernel)

Change-Id: Ida817700898957bb20abf7b04b2dd459ea7a9cc7
Signed-off-by: Sangyoun Kwak <sy.kwak@samsung.com>
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 months agocommon: Add hal_common_get_transport() 61/319761/4 accepted/tizen/unified/20250226.102358 accepted/tizen/unified/x/20250226.132036
Youngjae Cho [Mon, 17 Feb 2025 10:04:45 +0000 (19:04 +0900)]
common: Add hal_common_get_transport()

The getter gets matching transport to the backend version, for example,
if a module manifest has specified transport like below
  <hal>
     <name>HAL_MODULE_FOO</name>
     <version transport="ipc">1.0</version>
     <version transport="passthrough">2.1</version>
  </hal>
and the version of installed backend module is 2.0, then the API returns
HAL_COMMON_TRANSPORT_PASSTHROUGH.

If the module has specified multiple different transports througout the
platform-version, then the latest platform-version will be returned.
For example, if a module manifest has specified transport like below
  <manifest platform-version="9.0">
     <hal>
        <name>HAL_MODULE_BAR</name>
        <version transport="passthrough">3.0</version>
     </hal>
  </manifest>
  <manifest platform-version="10.0">
     <hal>
        <name>HAL_MODULE_BAR</name>
        <version transport="ipc">3.0</version>
     </hal>
  </manifest>
then, the API returns HAL_COMMON_TRANSPORT_IPC as the transport
of latest platform-version is "ipc".

Change-Id: Iae7d46746f631634bbc461406eda8418139c2dc2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months agocommon: halcc: Change transport to be a property of version 54/319754/4
Youngjae Cho [Mon, 17 Feb 2025 03:57:09 +0000 (12:57 +0900)]
common: halcc: Change transport to be a property of version

It is necessary to distinguish transport by version. So change the xml
tag 'transport' to be property of 'version' instead of child of 'hal'.
 • As-is: //hal/transport
    <hal>
       <version>...</version>
       <transport>...</transport>
    </hal>

 • To-be: //hal/version/@transport
    <hal>
       <version transport="...">...</version>
    </hal>

As the transport is now bound to the version, the existing API
hal_common_get_supported_interface_version() has changed to also
return transports that are associated with each version.

Additionally, lshal has changed to print transport information as well.

Change-Id: I1497d97d306f78d58477e40907ba1b570348ae47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months agocommon: halcc: Remove <interface> xml tag 53/319753/3
Youngjae Cho [Mon, 17 Feb 2025 04:41:57 +0000 (13:41 +0900)]
common: halcc: Remove <interface> xml tag

It was orignally designed for specifying instances that could
come as an instantiated backend with designated name and id. However,
this scheme has been abandoned and now backend cannot specify its name
and id. Therefore, removed <interface> and its related operations.

Change-Id: I1516670feaaa88d7e24fd51b961e638073093911
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months agocommon: halcc: Set info initialized even when it fails to get backend version 52/319752/3
Youngjae Cho [Mon, 17 Feb 2025 08:12:52 +0000 (17:12 +0900)]
common: halcc: Set info initialized even when it fails to get backend version

If it once fails to get backend version, then all the following
calls for the backend version will fail as well, leaving it
uninitialized. Due to this, the hal-api-common repeatedly try to
initialize it for every call for accessing the backend, which is truely
inefficiet. This is because this kind of failure cannot be recovered
during runtime. Therefore, it is enough to set it as initialized even
when it fails and let the following calls not to take same routine
repeatedly but just immediately return if it has once failed.

Change-Id: I81f6abbadaad9f0cb44849d04135f009127e4dc7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 months agospec: Remove unnecessary BuidRequires to dlog-redirection-stdout 45/319645/1 accepted/tizen/unified/20250220.093337 accepted/tizen/unified/x/20250221.100942
Youngjae Cho [Fri, 14 Feb 2025 04:31:45 +0000 (13:31 +0900)]
spec: Remove unnecessary BuidRequires to dlog-redirection-stdout

The dlog-redirection-stdout code has been removed from
hal-compatibility-checker but the BuildRequires for it hasn't. So
remove the unnecessary dependency.

Change-Id: I3365b2556d80955bec35deb34276b992956c9867
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months agocommon: halcc: Fix to correctly update g_compatibility_info 83/319583/1
Youngjae Cho [Thu, 13 Feb 2025 06:43:22 +0000 (15:43 +0900)]
common: halcc: Fix to correctly update g_compatibility_info

Fix the memcpy() destination correctly to the matching index.

Change-Id: Icd2c1e9f99554ca20cc3c7c608bf7250c81d2cab
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months agocommon: Change compatibility error to a real error instead of warning 77/315877/12
Youngjae Cho [Thu, 5 Dec 2024 08:33:50 +0000 (17:33 +0900)]
common: Change compatibility error to a real error instead of warning

The compatibility check needed time to be operational properly
because there were hal modules that hadn't declared their hal manifest.
And this is why the compatibility check failure was treated as a
warning and ignored.

But as of now, we make the error be treated as an effective error
instead of warning. Therefore, the functions below can now fail due to
compatibility check failure.
 - hal_common_get_backend()
 - hal_common_get_backend_with_library_name()
 - hal_common_get_backend_v2()
 - hal_common_get_backend_with_library_name_v2()

Existing unittest needs to be reworked to be operational with proper
manifest file. Therefore, added manifest files.

Change-Id: I4bdb56f3e2f7a9c955884ae88f99dee243330881
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months agocommon: Use default library name if the given one matches the default 72/319572/1
Youngjae Cho [Wed, 12 Feb 2025 07:40:13 +0000 (16:40 +0900)]
common: Use default library name if the given one matches the default

The hal_common_get_backend_with_library() can give a library name
that is totally the same as the default one. If then, use the default
one and do not make hashtable entry for the same given one.

Change-Id: I0ba489ec815167b03f12ad2fb6eab3cf4bf8f0ca
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months agohal-common: Add hal_common_transport enumeration 84/319484/1 accepted/tizen/unified/20250214.120509 accepted/tizen/unified/x/20250218.043740
Yunhee Seo [Tue, 11 Feb 2025 15:28:38 +0000 (00:28 +0900)]
hal-common: Add hal_common_transport enumeration

As support hal-ipc communication,
to define hal-api <-> hal-backend communication way,
new enumeration is added.

- enum hal_common_transport
  -> This indicates hal-api communication way.

Change-Id: I89a4ac7f5929a5e12e89cff1b6ddb62d9561f09b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
4 months agohalcc: Fix open_result_file() to receive access mode 26/319126/2 accepted/tizen/unified/20250212.101007
Youngjae Cho [Tue, 4 Feb 2025 11:03:51 +0000 (20:03 +0900)]
halcc: Fix open_result_file() to receive access mode

The result file is created with permission system_fw:system_fw:0755.
It means the previous access mode, which was unconditionally set to
O_RDWR, results in permission error if uid is other than system_fw
(have no permission to write). But it must be accessible if the caller
doesn't intend to write but just read. Therefore, add a parameter so
the function opens the file with the given parameter as a flag.

Change-Id: I97f3af9ebedb69e75f7e24b057c4a8dfb1a4904d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months agohalcc: Add assertion that open_result_file() always returns valid fd on success 53/319053/1 accepted/tizen_unified_x_asan accepted/tizen/unified/20250205.095531 accepted/tizen/unified/20250205.113511 accepted/tizen/unified/x/20250212.043819 accepted/tizen/unified/x/asan/20250211.003427
Youngjae Cho [Mon, 3 Feb 2025 04:46:11 +0000 (13:46 +0900)]
halcc: Add assertion that open_result_file() always returns valid fd on success

Logically, the file descriptor received from open_result_file() cannot
be invalid(negative) if open_result_file() returned 0.

Change-Id: I1b3180fb6c046bf5e4094b010d98970c513d00ae
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months agodoc: Fix to correctly add anchor of function 52/319052/1
Youngjae Cho [Mon, 3 Feb 2025 04:57:39 +0000 (13:57 +0900)]
doc: Fix to correctly add anchor of function

In case of function, anchor can be generated with function name
followed by parenthesis instead of # prefix.
 • #hal_common_get_backend -> hal_common_get_backend()
 • #hal_common_put_backend -> hal_common_put_backend()

Change-Id: I0e65df750c661c13b4472429a668a9936ace013d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months ago[HALACR-18] Add new HAL_MODULE_SECURITY_CERTS module 08/318908/3 accepted/tizen/unified/20250204.110455
Jan Wojtkowski [Fri, 31 Jan 2025 09:47:47 +0000 (10:47 +0100)]
[HALACR-18] Add new HAL_MODULE_SECURITY_CERTS module

[Role of HAL_MODULE_SECURITY_CERTS]
Security Certs module provides cryptography services (digital certificates)
for authentication and secure communication with another system.

[Detailed description of newly added HAL_MODULE_SECURITY_CERTS module]
- group = HAL_GROUP_SECURITY,
- module = HAL_MODULE_SECURITY_CERTS,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_SECURITY_CERTS",
- backend_module_name = "security-certs",
- library_name = "/hal/lib/libhal-backend-security-certs.so",
- library_name_64bit = "/hal/lib64/libhal-backend-security-certs.so",
- symbol_name = "hal_backend_security_certs_data",
- manifest = "/etc/hal/hal-api-security-manifest.xml",
- hal_api = true,

Change-Id: I113705aee91b4191656e4c2443fd3eebd84b495e

4 months agoInitialize ACR docs and elaborate descriptions 82/318282/8 accepted/tizen/unified/20250122.093027 accepted/tizen/unified/x/20250122.173329
Youngjae Cho [Wed, 15 Jan 2025 02:03:12 +0000 (11:03 +0900)]
Initialize ACR docs and elaborate descriptions

Add documentation for ACR and added description.

Change-Id: I25ebd6e3de41866551c64078de1f67f3ce8e9235
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 months ago[HALACR-16] Add new HAL_MODULE_CODEC module 91/318491/2 accepted/tizen/unified/20250120.072846 accepted/tizen/unified/x/20250120.085017
Chanwoo Choi [Thu, 16 Jan 2025 05:58:08 +0000 (14:58 +0900)]
[HALACR-16] Add new HAL_MODULE_CODEC module

[Role of HAL_MODULE_CODEC]
Previously, the GStreamer element was used for codec HAL.
But, the element has a dependency of GStreamer which is included in Platform image.
and it should be rebuilt if the GStreamer is upgraded by Platform update.
We can avoid this situation by adding Tizen codec HAL interfaces.
The reference GStreamer element which uses Tizen codec HAL interfaces
will be included in Platform image and no need to rebuild codec HAL backend
in HAL image although the Platform is updated.

[Details description of newly added HAL_MODULE_CODEC module]
- group = HAL_GROUP_MULTIMEDIA,
- module = HAL_MODULE_CODEC,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_CODEC",
- backend_module_name = "codec",
- library_name = "/hal/lib/libhal-backend-codec.so",
- library_name_64bit = "/hal/lib64/libhal-backend-codec.so",
- symbol_name = "hal_backend_codec_data",
- manifest = "/etc/hal/hal-api-codec-manifest.xml",
- hal_api = true,

Change-Id: Ic9d3d6ffdefe7902badc8d968818d6b9faa07954
Link: https://jira.sec.samsung.net/browse/HALACR-16
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 months agocommon: Fix argument of `hal_common_get_backend_with_library_name_v2` 73/317973/2
Yongjoo Ahn [Fri, 10 Jan 2025 07:32:43 +0000 (16:32 +0900)]
common: Fix argument of `hal_common_get_backend_with_library_name_v2`

Let the function take a void pointer to `hal_backend_[module]_funcs`
(NOT a double pointer for it).

Change-Id: Ic1e2c6d4b9b11423e147a541486269363835285b
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
4 months agoRevert "Revert "halapi: common: Remove deprecated global variable and abi_version... 67/318267/1 accepted/tizen/unified/20250117.152454 accepted/tizen/unified/x/20250117.125239
Chanwoo Choi [Wed, 15 Jan 2025 02:22:04 +0000 (11:22 +0900)]
Revert "Revert "halapi: common: Remove deprecated global variable and abi_version in hal_backend""

This reverts commit d2766e216b95a0e4fa7e2cab94ad408548ab9fbd.

The variables related to 'abi_version' has not used anymore.
Remove deprecated global variable and abi_version in hal_backend
structure.

Change-Id: I0ccf04a627feb859d50166e7562425a22ac360fd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
4 months agoRevert "halapi: common: Remove deprecated global variable and abi_version in hal_backend" 95/318195/1 accepted/tizen/unified/20250115.124140 accepted/tizen/unified/x/20250115.142720
Chanwoo Choi [Tue, 14 Jan 2025 05:55:26 +0000 (14:55 +0900)]
Revert "halapi: common: Remove deprecated global variable and abi_version in hal_backend"

This reverts commit 293201e2d65c5a44a830bcb2d9953e3057c3e60e.

Change-Id: I4e44a47f1acb3b97b2ba5fc316250a9b1d11eefc
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 months agopackaging: Disable halcc on movable project 41/316841/5
Youngjae Cho [Wed, 18 Dec 2024 08:46:58 +0000 (17:46 +0900)]
packaging: Disable halcc on movable project

Make the movable project an exception to the previous patch that treats
compatibility error as an real error. Therefore the project is not
affected by compatibility error as before.

Change-Id: I12c5b592f3aa5c76614023329090691c57c5cabe
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
5 months agocommon: Fix module_hash hash operations from direct to string 76/315876/6
Youngjae Cho [Thu, 5 Dec 2024 06:57:23 +0000 (15:57 +0900)]
common: Fix module_hash hash operations from direct to string

It matters when it comes to unittest. The unittest code below may
cause an unintended result.

  > char *library_name = g_strdup_printf("libhal-backend-%s-user-specific.so",
  >         info.backend_module_name_);
  > int ret = hal_common_get_backend_with_library_name(info.module_,
            (void **)&backend_module_data,
            library_name);

Over the instantiated testcases, the g_strdup_printf() sometimes returns
same address containing different string. In this case, if the hash and
equal function are g_direct_hash() and g_direct_equal(), then it tests
those different string as equal because both strings are held by the
same address. Therefore, it is not enough to compare the starting
address but needs to compare the entire string.

Change-Id: Ifecbac1db3d03d61137e31b74e356ba0370c345d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
5 months ago[DAPR-74] halapi: Add new HAL_MODULE_DA_ESE module 14/317914/2
Chanwoo Choi [Thu, 9 Jan 2025 12:39:57 +0000 (21:39 +0900)]
[DAPR-74] halapi: Add new HAL_MODULE_DA_ESE module

[Role of HAL_MODULE_DA_ESE module]
- Provide APIs to access certificate and key data stored in the eSE,
and to read/write in the hardware secure storage provided by eSE.
Currently a few system services and apps use these APIs
and there are two different hardware vendors whose eSE is used in our products,
so this abstraction is needed to move the hardware specific code and
vendor libraries into HAL layer.
- ESE (Embedded Secure Element)

[Details description of newly added HAL_MODULE_DA_ESE module]
- group                 : HAL_GROUP_SYSTEM,
- module                : HAL_MODULE_DA_ESE,
- license               : HAL_LICENSE_APACHE_2_0,
- gbm_group             : HAL_GBM_GROUP_DA,
- module_name           : "HAL_MODULE_DA_ESE",
- backend_module_name   : "da-ese",
- library_name          : "/hal/lib/libhal-backend-da-ese.so",
- library_name_64bit    : "/hal/lib64/libhal-backend-da-ese.so",
- symbol_name           : "hal_backend_da_ese_data",
- manifest              : "/etc/hal/hal-api-da-ese-manifest.xml",
- hal_api               : true,

Change-Id: I1d7862c4a03caa768d65b9900ee9e37d9d91903d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 months agohalapi: common: Change .hal-backend-compatibility smack label to '_' from 'System' 28/317728/6
Youngjae Cho [Tue, 7 Jan 2025 02:33:17 +0000 (11:33 +0900)]
halapi: common: Change .hal-backend-compatibility smack label to '_' from 'System'

To allow access from unprivileged process, changed the smack label of
/opt/etc/hal/.hal-backend-compatibility to '_'.
 • Jan 07 10:09:01 localhost audit[9954]: AVC lsm=SMACK fn=smack_inode_permission
    action=denied subject="User" object="System" requested=r pid=9954
    comm="launchpad-loade" name=".hal-backend-compatibility" dev="vda2" ino=128002

To set the file smack label to '_', several options were considered
below, and we selected the 3rd option.
 1) Set the file smack label '_' using setxattr()
    : The setxattr() for changing smack label requires capability
      CAP_MAC_ADMIN. However, the capability is being strictly managed
      and granted exceptionally to those who need to manipulate security
      policy, for example, processes that launching application. Our
      issue is not such case.
 2) Create the directory /opt/etc/hal in advance with smack label '_'
    with transmute flag
    : Instead of granting CAP_MAC_ADMIN to hal-compatibility-checker.service,
      make /opt/etc/hal directory with smack label '_' plus transmute
      flag in advance (by post install script or else). Transmute flag on
      a directory makes a file created on that directory inherit directory's
      smack label instead of a process' smack label that created the file.
      However it additionaly requires smack rule "System _ rwxat" to be
      effective. The trailing 't' must be appended to the current smack
      rule, but security team reviewed and concluded that it might cause
      side effect so it was rejected.
 3) Create the file /opt/etc/hal/.hal-backend-compatibility
    as well as the directory /opt/etc/hal in advance with smack label '_'.
    And introduce additional file that denotes whether it requires update.
    : Create all directory and file in advance with smack label '_'.
      If a file has been created with a specific smack label, the
      smack label of a file is retained while being written by other smack
      labeled process. As the .hal-backend-compatibility file has changed
      to be persistent (we use systemd-tmpfiles to create it so it always
      exists), we need additional information whether it needs to be
      updated. So introduced empty file .hal-backend-compatibility-loaded.
      The file will be created after creating .hal-backend-compatibility.
      If the file exists, hal-compatibility-checker.service won't be processed.

Change-Id: I985675457f40f89a28c9a05cd032e10c6220f8de
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
5 months agohalapi: common: Add missing function prefix 'hal_api_cc_' 28/317828/2
Youngjae Cho [Wed, 8 Jan 2025 08:47:32 +0000 (17:47 +0900)]
halapi: common: Add missing function prefix 'hal_api_cc_'

The functions that are used by unittest was missing prefix.
Added 'hal_api_cc_' to them to be consistent with other functions.

Change-Id: I997fc7360926871e4c5b29fd9fc295534e2146da
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
5 months agohalapi: Fix memleak of hal_module_info->manifest 61/317661/2
Yongjoo Ahn [Mon, 6 Jan 2025 09:41:09 +0000 (18:41 +0900)]
halapi: Fix memleak of hal_module_info->manifest

Let the module_info hashtable's destroy functions release manifest
string allocated by `g_strdup`.

Change-Id: I354644978bc23f912a6434c886a967c3e6cb63ac
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
5 months agohalapi: common: Remove deprecated global variable and abi_version in hal_backend
Chanwoo Choi [Mon, 16 Dec 2024 04:20:41 +0000 (13:20 +0900)]
halapi: common: Remove deprecated global variable and abi_version in hal_backend

The variables related to 'abi_version' has not used anymore.
Remove deprecated global variable and abi_version in hal_backend
structure.

Change-Id: I1a40fb01cd18d8b3fbbb45f712df3a4b8c786734
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 months agohalapi: common: Add debug log for init/exit/dlopen/dlclose 37/316637/2 accepted/tizen/unified/20241217.171005 accepted/tizen/unified/x/20241218.212016 accepted/tizen/unified/x/asan/20250113.002107
Chanwoo Choi [Mon, 16 Dec 2024 07:50:26 +0000 (16:50 +0900)]
halapi: common: Add debug log for init/exit/dlopen/dlclose

Add debug log for each init/exit/dlopen/dlclose step to catch the
latency issue.

[Details description of newly added log]
(snip) __get_backend(361) > HAL_MODULE_TBM: Prepare to open HAL backend: (snip)
-> Execute dlopen() and dlsym()
(snip) __get_backend(369) > HAL_MODULE_TBM: Open and Prepare to get HAL backend: (snip)
-> Execute 'init' function on hal-backend
(snip) __get_backend(384) > HAL_MODULE_TBM: Get HAL backend: (snip)

(snip) __put_backend(435) > HAL_MODULE_TBM: Prepare to exit HAL backend: (snip)
-> Execute 'exit' function on hal-backend
(snip) __put_backend(450) > HAL_MODULE_TBM: Exit and prepare to put HAL backend: (snip)
-> Execute dlclose()
(snip) __put_backend(462) > HAL_MODULE_TBM: Put HAL backend: (snip)

Change-Id: I91bfab7317bbe4f4600f5bba0475f85219261c21
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
5 months agoRemove Zigbee/Uwb hal layer 89/315989/2 accepted/tizen/unified/20241217.010335 accepted/tizen/unified/x/20241218.032654 accepted/tizen/unified/x/asan/20241224.004423
Jihoon Jung [Mon, 9 Dec 2024 04:06:43 +0000 (13:06 +0900)]
Remove Zigbee/Uwb hal layer

- Related to TRE-3221 and TRE-3222

Change-Id: Ice48b8a44ac501d21becdcd33f31597551695e9f
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
6 months agohalcc: parser: Use small letter of 'ipc' transport method 25/315925/1
Chanwoo Choi [Thu, 5 Dec 2024 11:49:14 +0000 (20:49 +0900)]
halcc: parser: Use small letter of 'ipc' transport method

The 'transport' property is able to have either 'passthrough' or 'ipc'.
In order to keep the consistent small letter style, replace 'IPC' with 'ipc'.

Change-Id: I2212337e1af49b04c2e23f92825bed602a4ca473
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months agopackaging: Increase release version-up on Tizen 10.0 15/315415/1 accepted/tizen/unified/20241202.132940
Chanwoo Choi [Fri, 29 Nov 2024 04:17:05 +0000 (13:17 +0900)]
packaging: Increase release version-up on Tizen 10.0

When Tizen major version is up, will increase release version-up of
package. So that increase release version-up on Tizen 10.0.

Change-Id: I57edef9b19c0c22b54e308e494a777acea4452f8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months ago[DAPR-68] halapi: Add new HAL_MODULE_DA_AB_UPDATE module 14/315414/1
Chanwoo Choi [Fri, 29 Nov 2024 03:58:32 +0000 (12:58 +0900)]
[DAPR-68] halapi: Add new HAL_MODULE_DA_AB_UPDATE module

[Role of HAL_MODULE_DA_AB_UPDATE module]
- Support A/B Partition Update

[Details description of newly added HAL_MODULE_DA_AB_UPDATE module]
- group                 : HAL_GROUP_SYSTEM,
- module                : HAL_MODULE_DA_AB_UPDATE,
- license               : HAL_LICENSE_APACHE_2_0,
- gbm_group             : HAL_GBM_GROUP_DA,
- module_name           : "HAL_MODULE_DA_AB_UPDATE",
- backend_module_name   : "da-ab-update",
- library_name          : "/hal/lib/libhal-backend-da-ab-update.so",
- library_name_64bit    : "/hal/lib64/libhal-backend-da-ab-update.so",
- symbol_name           : "hal_backend_da_ab_update_data",
- manifest              : "/etc/hal/hal-api-da-ab-update-manifest.xml",
- hal_api               : true,

Change-Id: I512ac51429625423c882fc16dfc29298155c14f1
Link: https://jira.sec.samsung.net/browse/DAPR-68
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months agohal-common: Add new HAL_MODULE_DA_WOW module 06/320906/4
Chanwoo Choi [Mon, 25 Nov 2024 09:29:18 +0000 (18:29 +0900)]
hal-common: Add new HAL_MODULE_DA_WOW module

HAL_MODULE_DA_WOW is supporting WOW (Wake On Wlan) functionality with Wifi Chip.
For using HAL_MODULE_DA_WOW, wifi chip have to support the keepalive
featuer on CPU suspend status and then Wifi chip should filter the
specific packet according to hal-api-wow user request. When receiving
the specific packet, Wifi chip will make the event to wakup CPU from
suspend and then hal-api-wow get the raised the kind of event.

[Details description of newly added HAL_MODULE_DA_WOW module]
- hal module : HAL_MODULE_DA_WOW
- group                 : HAL_GROUP_SYSTEM,
- module                : HAL_MODULE_DA_WOW,
- license               : HAL_LICENSE_APACHE_2_0,
- gbm_group             : HAL_GBM_GROUP_DA,
- module_name           : "HAL_MODULE_DA_WOW",
- backend_module_name   : "da-wow",
- library_name          : "/hal/lib/libhal-backend-da-wow.so",
- library_name_64bit    : "/hal/lib64/libhal-backend-da-wow.so",
- symbol_name           : "hal_backend_da_wow_data",
- manifest              : "/etc/hal/hal-api-da-wow-manifest.xml",
- hal_api               : true,

Change-Id: Iac845235eef4c2871f560016b900c7328babf7d6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months agocommon: Add new enum hal_gbm_group to indicate owned GBM information 05/320905/2
Chanwoo Choi [Mon, 25 Nov 2024 09:03:45 +0000 (18:03 +0900)]
common: Add new enum hal_gbm_group to indicate owned GBM information

Need to add new HAL-API for each GBM. Each HAL-API need to include
the GBM information. So that add new enum hal_gbm_group to indicate
owned GBM information.

[Detailed of newly added enum hal_gbm_group]
- enum name : enum hal_gbm_group
- Indication of each hal_gbm_group enumeration
 : HAL_GBM_GROUP_PUBLIC indicates Public Tizen.
 : HAL_GBM_GROUP_DA indicates DA (Digital Appliance) Tizen.

Change-Id: I9fa55b3cc99f6f3c33dafb1c7fe25d2e596e2b15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months agopackaging: Version 1.0.0 04/320904/2
Chanwoo Choi [Sat, 16 Nov 2024 23:47:01 +0000 (08:47 +0900)]
packaging: Version 1.0.0

Changes:
- Add new hal_common_get/put_backend_v2()
- Add new HALCC (HAL Compatibility Checker)
- Add data migration script for HALCC

Change-Id: Ia929ed2e12360fce8c7f20d5aead10afe961792c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 months agohalcc: Add %enable_halcc to enable/disable the feature selectively 19/319419/5 accepted/tizen/unified/20241108.105514
Youngjae Cho [Wed, 23 Oct 2024 02:49:44 +0000 (11:49 +0900)]
halcc: Add %enable_halcc to enable/disable the feature selectively

There could be some environment that the hal-comaptibility-checker would
not be necessary. For example, a platform image that always accompanies
hal image when building will never worry about ABI compatibility between
them. In such case, the hal-compatibility-checker is pointless and no more
than a thing that degrades booting performance. For such reason,
%enable_halcc has been introduced on the .spec file and can be used to
exclude total halcc feature.

Change-Id: I26510db0374602303874265c2e99cb97c3c71fdc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
7 months agohalcc: Move execution of halcc from generator to sysinit.target 82/319282/10
Youngjae Cho [Mon, 21 Oct 2024 02:48:21 +0000 (11:48 +0900)]
halcc: Move execution of halcc from generator to sysinit.target

systemd generator is executed in serialized order, not in parallel
like systemd services. So the time consumed by a program run by
systemd generator will throughly added up to the overall booting time.
Therefore, convert hal-compatibility-checker into a systemd service
and make it be pulled in by sysinit.target so it can run in parallel,
improving booting time. On top of this, as the service has change to
run as system_fw/system_fw (uid/gid), the permission of directory
/opt/etc/hal created by the service has changed to 0755 to make it
be able to write a file on that directory.

Change-Id: Ia56b8c2ed845c3321db0d9304a0cb182134f0e75
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
7 months agoAdd dependency to capi-base-common 46/319046/3 accepted/tizen_unified_toolchain accepted/tizen/9.0/unified/20241030.231851 accepted/tizen/unified/20241017.114749 accepted/tizen/unified/toolchain/20241022.122454 accepted/tizen/unified/toolchain/20241022.122925 accepted/tizen/unified/x/20241017.170349 accepted/tizen/unified/x/asan/20241022.113457 tizen_9.0_m2_release
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>
8 months agoRevert "tests: Remove unnecessary header <tizen.h>" 45/319045/1
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>
8 months agotests: Remove unnecessary header <tizen.h> 68/318268/1 accepted/tizen/unified/20240928.111250 accepted/tizen/unified/20240928.221348 accepted/tizen/unified/toolchain/20241004.101715 accepted/tizen/unified/x/20240929.082823 accepted/tizen/unified/x/asan/20241014.000036
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>
10 months agohalcc: Remove checking SYSTEMD_SCOPE environment variable 39/314739/1 accepted/tizen_unified_dev accepted/tizen/unified/20240722.104230 accepted/tizen/unified/dev/20240724.110124 accepted/tizen/unified/toolchain/20240812.132717 accepted/tizen/unified/x/20240723.043605 accepted/tizen/unified/x/asan/20240813.231006
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>
11 months agopackaging: Add data migration script to remove /opt/etc/hal/.hal-backend-compatibility 91/314291/2 accepted/tizen/unified/20240711.163723 accepted/tizen/unified/dev/20240712.055812 accepted/tizen/unified/x/20240715.042500
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>
11 months agohalapi: common: Fix typo to hal_module 34/313734/1 accepted/tizen/unified/20240702.091855 accepted/tizen/unified/dev/20240703.060352 accepted/tizen/unified/x/20240704.023007
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>
11 months agohalapi: common: Add hal_common_get/put_backend_v2 to support ABI compatibility 70/313670/2
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>
11 months agohalcc: Fix default compatibility to HAL_COMMON_BACKEND_COMPATIBLITY_UNKNOWN 61/313461/1 accepted/tizen/unified/20240627.103703 accepted/tizen/unified/dev/20240701.073006 accepted/tizen/unified/x/20240628.014019
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>
11 months agohalcc: Remove unused code 53/313453/1
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>
11 months agotests: Separate functions exclusively used for testing 51/313451/3
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>
11 months agohalcc: Add cache not to open() file multiple times on a same module 50/313450/1
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>
11 months agotool: lshal: Replace 'Backend Verification' with 'Compatibility' 77/313377/2 accepted/tizen/unified/20240625.163203 accepted/tizen/unified/x/20240626.052157
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>
11 months agotool: lshal: Print interface and backend version 52/313352/6
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>
11 months agohalcc: Add hal_common_get_supported_interface_versions() 51/313351/4
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>
11 months agohalcc: Add module name info to error log 76/313376/2
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>
11 months agohalcc: Fix errno not to be overwritten before returning 75/313375/1
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>
11 months agohalcc: Fix file descriptor leak 74/313374/1
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>
11 months agosystemd-hal-compatibility-checker-generator: Remove lost option --redirect-all 29/313229/1
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>
11 months agohalcc: Fix not to ask for HAL_MODULE_UNKNOWN to prevent error log spam 04/313204/1
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>
11 months agotool: hal-compatibility-checker: Fix --skip-if-result-exist to work 03/313203/1
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>
11 months agohalcc: Fix error log to dlog instead of stdout 02/313202/1
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>
11 months agohalcc: Check only explicitly specified manifest file 65/313165/4
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>
11 months agotool: hal-compatibility-checker: Fix file path used by --reset 79/313179/1
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>
11 months agotool: hal-compatibility-checker: Add option --reset to remove result file 58/313158/3 accepted/tizen/unified/20240621.010407 accepted/tizen/unified/toolchain/20240624.121430 accepted/tizen/unified/x/20240624.031935 accepted/tizen/unified/x/asan/20240625.092340
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>
11 months agohalcc: Fix default manifest directory to '/etc/hal' 37/313137/1
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>
11 months agohalcc: Create directory for .hal-backend-compatibility if not exist 35/313135/1
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>
12 months agohalcc: Fix parser to accept <hal-api> instead of <root> 96/311496/1 accepted/tizen/unified/20240611.122614 accepted/tizen/unified/dev/20240620.010445 accepted/tizen/unified/x/20240612.025918
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>
12 months agohalcc: Fix parser to accept <hal-module> instead of <hal> 93/311493/1
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>
12 months agohalcc: Temporarily allow incompatible backend version 92/311492/1
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>
12 months agoRevert "halapi: Add hal-api-manifest.xml" 76/311276/8
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>
12 months agotests: Add test manifest.xml and testcases for halcc 72/311272/10
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>
12 months agohalcc: Remove spamming error log 71/311271/7
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>
12 months agohalcc: Rework halcc compatibility checker 82/311182/9
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>
12 months agohalcc: Fix manifest scheme 81/311181/3
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>
12 months agohalcc: Remove all operations based on forward/backward semantic 80/311180/2
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>
13 months agohalcc: Add halcc_hal_is_compatible_with_version() 79/311179/1
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>
13 months agohalcc: Fix parser to accept multiple version for hal 78/311178/1
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>
13 months agohalcc: Remove hal dependency scheme from manifest 19/311019/3
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>
13 months agohalcc: Fix not to use min-max semantic for minor versioning 18/311018/3
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>
13 months agoRevert removal of enum hal_abi_version definition 03/311003/2
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>
13 months agohalcc: Fix thread-unsafe function, getpwnam(), getgpnam() 11/310511/1
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>
13 months agohalcc: Make parser maintain hal to have the latest version 08/310508/2
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>
13 months agohalcc: Fix manifest scheme to have multiple <manifest> element 07/310507/1
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>
13 months agohalapi: Fix directory where halcc searches for manifest.xml 62/310162/2
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>