platform/hal/api/common.git
3 years agohalapi: common: Change variable name for improving the readability 85/251185/3 accepted/tizen/unified/20210111.125423 submit/tizen/20210111.072925
Chanwoo Choi [Mon, 11 Jan 2021 06:00:55 +0000 (15:00 +0900)]
halapi: common: Change variable name for improving the readability

Change the variable name for improving the readability
because prior defined variable name is vague to pass
the correct meaning of version. So that change the name as following
in order to improve the readability and understanding.

[Chagned variable names]
- g_curr_hal_abi_version -> g_platform_curr_abi_version
- current_version -> platform_abi_version
- compat_version -> backend_min_abi_version

Change-Id: I733b203a6c0fe058dedb6e9e26f832a0629ccc15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: common: Add hal_api_version_str array and an error message 64/251164/3
Jaehoon Chung [Sun, 10 Jan 2021 23:03:47 +0000 (08:03 +0900)]
halapi: common: Add hal_api_version_str array and an error message

Add hal_api_version_str array to display as string after converting each
enum value.
It's easier to understand than using enum value.
If abi version doesn't support about current version and compatible version,
then it needs to notice about not supporting abi_version.

Change-Id: I67f31423a4b9d911b269d8c7560c9907a6bafc8b
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agohalapi: common: Change the parameter name of helper functions for readability 91/251091/2 accepted/tizen/unified/20210108.125849 submit/tizen/20210108.044006
Chanwoo Choi [Fri, 8 Jan 2021 03:46:15 +0000 (12:46 +0900)]
halapi: common: Change the parameter name of helper functions for readability

hal-api-common's helper functions have the 'enum hal_module' as first
parameter. In order to improve the readability, replace parameter name
from 'handle' to 'module'.

Change-Id: I3baa384885d9e5225987f143d4b1951c4b6aedd6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: common: Fix bug by using the module parameter 89/251089/1
Chanwoo Choi [Fri, 8 Jan 2021 03:30:03 +0000 (12:30 +0900)]
halapi: common: Fix bug by using the module parameter

hal-api-common helper functions have been used the fixed hal module id
such as HAL_MODULE_FOO. It is wrong usage. hal-api-common helper
functions have to use the 'module' parameter.

Change-Id: Ifa27e0e4df3c5b89ce96511802ef5a008cf2a279
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: common: Change return type of hal_common_put_backend and backend->exit 34/251034/1 accepted/tizen/unified/20210107.123346 submit/tizen/20210107.062142
Chanwoo Choi [Thu, 7 Jan 2021 05:35:40 +0000 (14:35 +0900)]
halapi: common: Change return type of hal_common_put_backend and backend->exit

Change the return type of hal_common_put_backend() and backend->exit()
from void to int in order to pass the error value.

Change-Id: I155a33e469511319303bd56d3866d3bbfbec786c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: common: Add hal_common_(get|put)_backend() function to handle backend data 61/250461/4 accepted/tizen/unified/20210104.130218 submit/tizen/20210104.043912
Chanwoo Choi [Mon, 28 Dec 2020 04:43:47 +0000 (13:43 +0900)]
halapi: common: Add hal_common_(get|put)_backend() function to handle backend data

Following step is for getting the backend data which contains the
function pointers for each HAL module.
1. get library name of HAL backend
2. dlopen with library name
3. get symbol name of HAL backend
4. dlsym with symbol name
5. Get the backend data via backend->init()

In order to reduce the duplicate code on each HAL API packages,
add hal_common_get_backend() helper function which contains
the above steps to get the backend data.

And add hal_common_put_backend() helper function to free
the hal_backend instance and dlclose the shared library.

Change-Id: Ic603d3e4f0ba1ff2aed9699b1eaf925cbd97c60c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: common: Divide hal-common.h into two header files 62/250462/4
Chanwoo Choi [Mon, 28 Dec 2020 04:50:34 +0000 (13:50 +0900)]
halapi: common: Divide hal-common.h into two header files

Divide hal-common.h into two header files as following:
- hal-common.h is used for HAL API packages (/platform/hal/api/)
- hal-common-interface.h is used for HAL backend packages (/platform/hal/device/)

Change-Id: Ida3192ed4dbb29d9b718b2b90f3a61f8ed380e2e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agohalapi: common: Add library and symbol name for hal-api-device 85/250485/2
Chanwoo Choi [Mon, 28 Dec 2020 07:21:36 +0000 (16:21 +0900)]
halapi: common: Add library and symbol name for hal-api-device

Change-Id: I83f661c30b1e2dcb763c9956804d03db57e3aa46
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoAdd support hal-api-common library to check HAL ABI and support of haltest 65/250165/14
Chanwoo Choi [Fri, 18 Dec 2020 04:20:37 +0000 (13:20 +0900)]
Add support hal-api-common library to check HAL ABI and support of haltest

Need to provide the helper function of HAL ABI version check
in order to support HAL API layer on Tizen 6.5. By supporing
the ABI check method, Tizen can separate the hal.img from core image
and then we can remove the h/w dependency from Tizen core image.

hal-api-common-*.rpm contains the shared library providing the helper
function of the HAL ABI version check and the HAL ABI data of all
modules. If some module changes the their owr HAL ABI interface,
they must update the ABI information to /platform/hal/api/common.
It contains the following files:
- /usr/lib/hal/libhal-api-common.so
- /usr/share/licenses/hal-api-common/LICENSE

hal-api-common-devel-*.rpm contains the header file for including
the helper function of HAL ABI version check.
It contains the following files:
- /usr/include/hal/hal-common.h
- /usr/lib/pkgconfig/hal-api-common.pc

But, this patch is not enough. Usually, the configuraiton data
like HAL ABI version information should get the file like xml, json
style format file and so on. But, it just specify the HAL ABI versin
information of all modules in the src/common.h as workardound style.
It must need to be fixed on later. And this version doesn't include
the any haltest code even if it is necessary. Also on later,
The role of common-haltest make the pre-considition environment
for all haltests and then execute the haltest file to verify
the hal.img and the implementation of HAL backend pacakges.

For example, show the relationship among hal-api-foo, hal-backend-foo
and hal-api-common as following:

-----------------------------------
| 'User of hal-api-foo'           |
|   executes C HAl API.           |
-----------------------------------
    |
    | (Call HAL API)
    |
-----------------------------------
| /usr/include/hal-foo.h          |
|                                 |
|                                 |       ----------------------------------
| hal-api-foo.rpm                 | <---> | (Check HAL ABI Version)        |
| (/usr/lib/libhal-api-foo.so)    |       |                                |
|                                 |       | hal-api-common.rpm             |
|                                 |       | (/usr/lib/libhal-api-common.so)|
| /usr/include/hal-foo-interface.h|       ----------------------------------
----------------------------------|
    |
    | dlopen ("/hal/lib/libhal-backend-foo.so")
    | dlsym ("hal_backend_foo_daa")
    |
-----------------------------------
| hal-backend-foo-rpi4.rpm        |
| (/hal/lib/libhal-backend-foo.so)|
-----------------------------------

Change-Id: Ifb4b10e94c419517882794cc101bfcd598570335
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoInitial empty repository master
Tizen Infrastructure [Fri, 18 Dec 2020 00:45:59 +0000 (00:45 +0000)]
Initial empty repository