Add support hal-api-common library to check HAL ABI and support of haltest 65/250165/14
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 18 Dec 2020 04:20:37 +0000 (13:20 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 23 Dec 2020 06:23:06 +0000 (15:23 +0900)
commita29ad41a620a1a07c19f9dffd7a602d5c7e6cbe0
treecc2ff33d107a1529e3ea02c93beb764828fa112b
parent9ae607bcca8ab3704e45cef180da31728f80c3ef
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>
CMakeLists.txt [new file with mode: 0644]
LICENSE [new file with mode: 0644]
hal-api-common.pc [new file with mode: 0644]
include/hal-common.h [new file with mode: 0644]
packaging/hal-api-common.manifest [new file with mode: 0644]
packaging/hal-api-common.spec [new file with mode: 0644]
src/common.h [new file with mode: 0644]
src/hal-api-common.c [new file with mode: 0644]