Skip to content

arch: optee: fw_assert.h wrapper for fwk_expect() return value

Darryl Green requested to merge github/fork/etienne-lms/optee-fwk-expect into master

Created by: etienne-lms

Implements wrapper header file fwk_assert.h for optee architecture to overcome the issue building with OP-TEE. OP-TEE OS assert() function does not provide a return value resulting a compilation failure as reported in the below build traces:

/tmp/optee-3.19/build/../scp-firmware/framework/src/fwk_arch.c: In function ‘fwk_arch_init’: lib/libutils/isoc/include/assert.h:20:2: error: expected expression before ‘do’ 20 | do {
| ^~ /tmp/optee-3.19/build/../scp-firmware/framework/include/fwk_assert.h:147:35: note: in expansion of macro ‘assert’ 147 | # define fwk_assert(condition) assert(condition) | ^~~~~~ /tmp/optee-3.19/build/../scp-firmware/framework/include/fwk_assert.h:180:34: note: in expansion of macro ‘fwk_assert’ 180 | # define fwk_check(condition) fwk_assert(condition) | ^~~~~~~~~~ /tmp/optee-3.19/build/../scp-firmware/framework/include/fwk_assert.h:212:42: note: in expansion of macro ‘fwk_check’ 212 | # define fwk_expect(condition) (bool)(fwk_check(condition), 1) | ^~~~~~~~~ /tmp/optee-3.19/build/../scp-firmware/framework/src/fwk_arch.c:73:10: note: in expansion of macro ‘fwk_expect’ 73 | if (!fwk_expect(status == FWK_SUCCESS)) { | ^~~~~~~~~~

This change works around the issue by implementing a functional fwk_expect() function using OP-TEE OS standard lib libutils resources.

Signed-off-by: Etienne Carriere etienne.carriere@linaro.org

Merge request reports