Lines Matching +full:- +full:o

1 /* SPDX-License-Identifier: BSD-2-Clause */
41 * Zero is normally a success code in OP-TEE so special functions are
58 * struct ftmn_check - track current checked state
76 * struct ftmn_func_arg - track a called function
92 * struct ftmn - link a tracked call chain
114 * enum ftmn_incr - increase counter values
140 * FTMN_PANIC() - FTMN specific panic function
155 #define __FTMN_FUNC_BYTE(f, o, l) ((o) < (l) ? (uint8_t)(f)[(o)] : 0) argument
158 #define __FTMN_GET_FUNC_U32(f, o, l) \ argument
159 (SHIFT_U32(__FTMN_FUNC_BYTE((f), (o), (l)), 0) | \
160 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 1, (l)), 8) | \
161 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 2, (l)), 16) | \
162 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 3, (l)), 24))
164 #define __FTMN_FUNC_HASH64(f, o, l) \ argument
165 (__FTMN_GET_FUNC_U32((f), (o), (l)) ^ \
166 __FTMN_GET_FUNC_U32((f), (o) + 4, (l)))
168 #define __FTMN_FUNC_HASH32(f, o, l) \ argument
169 (__FTMN_FUNC_HASH64((f), (o), (l)) ^ \
170 __FTMN_FUNC_HASH64((f), (o) + __FTMN_MAX_FUNC_NAME_LEN / 16, (l)))
172 #define __FTMN_GET_FUNC_U64(f, o, l) \ argument
173 (SHIFT_U64(__FTMN_FUNC_BYTE((f), (o), (l)), 0) | \
174 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 1, (l)), 8) | \
175 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 2, (l)), 16) | \
176 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 3, (l)), 24) | \
177 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 4, (l)), 32) | \
178 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 5, (l)), 40) | \
179 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 6, (l)), 48) | \
180 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 7, (l)), 56))
182 #define __FTMN_FUNC_HASH32(f, o, l) \ argument
183 (__FTMN_GET_FUNC_U64((f), (o), (l)) ^ \
184 __FTMN_GET_FUNC_U64((f), (o) + 8, (l)))
187 #define __FTMN_FUNC_HASH16(f, o, l) \ argument
188 (__FTMN_FUNC_HASH32((f), (o), (l)) ^ \
189 __FTMN_FUNC_HASH32((f), (o) + __FTMN_MAX_FUNC_NAME_LEN / 16, (l)))
191 #define __FTMN_FUNC_HASH8(f, o, l) \ argument
192 (__FTMN_FUNC_HASH16((f), (o), (l)) ^ \
193 __FTMN_FUNC_HASH16((f), (o) + __FTMN_MAX_FUNC_NAME_LEN / 8, (l)))
195 #define __FTMN_FUNC_HASH4(f, o, l) \ argument
196 (__FTMN_FUNC_HASH8((f), (o), (l)) ^ \
197 __FTMN_FUNC_HASH8((f), (o) + __FTMN_MAX_FUNC_NAME_LEN / 4, (l)))
264 return &thread_get_tsd()->ftmn_arg; in __ftmn_get_tsd_func_arg_pp()
266 return &thread_get_core_local()->ftmn_arg; in __ftmn_get_tsd_func_arg_pp()
291 ftmn->arg_pp = arg_pp; in __ftmn_push_linked_call()
292 ftmn->my_hash = my_hash; in __ftmn_push_linked_call()
293 ftmn->called_hash = called_hash; in __ftmn_push_linked_call()
294 ftmn->saved_arg = *ftmn->arg_pp; in __ftmn_push_linked_call()
295 *ftmn->arg_pp = &ftmn->arg; in __ftmn_push_linked_call()
296 ftmn->arg.hash = my_hash; in __ftmn_push_linked_call()
302 if (ftmn->arg_pp) in __ftmn_pop_linked_call()
303 *ftmn->arg_pp = ftmn->saved_arg; in __ftmn_pop_linked_call()
310 if (f->arg_pp) { in __ftmn_copy_linked_call_res()
311 assert(f->arg.hash == (f->my_hash ^ f->called_hash)); in __ftmn_copy_linked_call_res()
312 assert(&f->arg == *f->arg_pp); in __ftmn_copy_linked_call_res()
313 assert((f->arg.hash ^ f->arg.res) == res); in __ftmn_copy_linked_call_res()
314 ___ftmn_copy_linked_call_res(&f->check, incr, &f->arg, res); in __ftmn_copy_linked_call_res()
323 arg->hash ^= my_old_hash ^ my_new_hash; in __ftmn_calle_swap_hash()
363 &ftmn->check, incr, steps, res); in __ftmn_callee_done_check()
377 ___ftmn_set_check_res(&ftmn->check, incr, res); in __ftmn_set_check_res()
385 ___ftmn_set_check_res_not_zero(&ftmn->check, incr, res); in __ftmn_set_check_res_not_zero()
391 * FTMN_FUNC_HASH() - "hash" a function name
403 * FTMN_PUSH_LINKED_CALL() - push call into a linked call chain
418 * FTMN_SET_CHECK_RES_FROM_CALL() - copy the result from a linked call
433 * FTMN_POP_LINKED_CALL() - remove a call from a linked call chain
441 * FTMN_CALL_FUNC() - Do a linked call to a function
466 * FTMN_CALLEE_DONE() - Record result of callee
481 * FTMN_CALLEE_DONE_NOT_ZERO() - Record non-zero result of callee
499 * FTMN_CALLEE_DONE_CHECK() - Record result of callee with checked state
518 * FTMN_CALLEE_DONE_MEMCMP() - Record result of memcmp() in a callee
533 * FTMN_CALLEE_UPDATE_NOT_ZERO() - Update the result of a callee with a
534 * non-zero value
552 * FTMN_CALLEE_SWAP_HASH() - Remove old hash and add new hash
572 * FTMN_SET_CHECK_RES() - Records a result in local checked state
585 * FTMN_SET_CHECK_RES_NOT_ZERO() - Records a non-zero result in local checked
609 ___ftmn_set_check_res_memcmp(&ftmn->check, incr, res, in ftmn_set_check_res_memcmp()
616 * FTMN_STEP_COUNT() - Calculate total step count
626 * ftmn_checkpoint() - Add a checkpoint
643 ftmn->check.steps += incr; in ftmn_checkpoint()
649 * ftmn_expect_state() - Check expected state
664 assert((ftmn->check.res ^ FTMN_DEFAULT_HASH) == res); in ftmn_expect_state()
665 assert(ftmn->check.steps == steps); in ftmn_expect_state()
667 ___ftmn_expect_state(&ftmn->check, incr, steps, res); in ftmn_expect_state()
672 * ftmn_return_res() - Check and return result
693 assert((ftmn->check.res ^ FTMN_DEFAULT_HASH) == res); in ftmn_return_res()
694 assert(ftmn->check.steps == steps); in ftmn_return_res()
696 return ___ftmn_return_res(&ftmn->check, steps, res); in ftmn_return_res()