1 /* 2 * Copyright (c) 2016, Linaro Limited 3 * SPDX-License-Identifier: BSD-2-Clause 4 */ 5 6 #ifndef BENCHMARK_AUX_H 7 #define BENCHMARK_AUX_H 8 9 #include <tee_client_api.h> 10 #include <tee_bench.h> 11 12 /* tee error code checking etc */ 13 void tee_errx(const char *msg, TEEC_Result res); 14 void tee_check_res(TEEC_Result res, const char *errmsg); 15 16 /* misc aux print functions */ 17 const char *bench_str_src(uint64_t source); 18 void print_line(void); 19 20 /* argv alloc/dealloc */ 21 void alloc_argv(int argc, char *argv[], char **new_argv[]); 22 void dealloc_argv(int new_argc, char **new_argv); 23 24 void *mmap_paddr(intptr_t paddr, uint64_t size); 25 size_t get_library_load_offset(pid_t pid, const char *libname); 26 27 /* get amount of cores */ 28 uint32_t get_cores(void); 29 #endif /* BENCHMARK_AUX_H */ 30