Lines Matching +full:- +full:c1 +full:- +full:16
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
161 SHIFT_U32(__FTMN_FUNC_BYTE((f), (o) + 2, (l)), 16) | \
170 __FTMN_FUNC_HASH64((f), (o) + __FTMN_MAX_FUNC_NAME_LEN / 16, (l)))
175 SHIFT_U64(__FTMN_FUNC_BYTE((f), (o) + 2, (l)), 16) | \
189 __FTMN_FUNC_HASH32((f), (o) + __FTMN_MAX_FUNC_NAME_LEN / 16, (l)))
206 #define __ftmn_step_count_2(c0, c1) \ argument
207 (__ftmn_step_count_1(c0) + (c1) * FTMN_INCR1)
208 #define __ftmn_step_count_3(c0, c1, c2) \ argument
209 (__ftmn_step_count_2(c0, c1) + (c2) * FTMN_INCR2)
210 #define __ftmn_step_count_4(c0, c1, c2, c3) \ argument
211 (__ftmn_step_count_3(c0, c1, c2) + (c3) * FTMN_INCR3)
212 #define __ftmn_step_count_5(c0, c1, c2, c3, c4) \ argument
213 (__ftmn_step_count_4(c0, c1, c2, c3) + (c4) * FTMN_INCR4)
214 #define __ftmn_step_count_6(c0, c1, c2, c3, c4, c5) \ argument
215 (__ftmn_step_count_5(c0, c1, c2, c3, c4) + (c5) * FTMN_INCR5)
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()