1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2014, STMicroelectronics International N.V.
4  */
5 #ifndef TEE_COMMON_H
6 #define TEE_COMMON_H
7 
8 #include <stdlib.h>
9 
10 #ifdef MEASURE_TIME
11 /*
12  * Initializes mesaure time. Initializes RTT0 to highest possible
13  * resolution.
14  */
15 void tee_mtime_init(void);
16 
17 /*
18  * Adds a time stamp together the description. Note that only the pointer
19  * is copied, not the contents to minimize impact.
20  */
21 void tee_mtime_stamp(const char *descr);
22 
23 /*
24  * Prints a report of measured times and reinitializes clears the table of
25  * saved time stamps.
26  */
27 void tee_mtime_report(void);
28 
29 void tee_mtime_perftest(void);
30 #else
31 /* Empty macros to not have any impact on code when not meassuring time */
32 #define tee_mtime_init() do { } while (0)
33 #define tee_mtime_stamp(descr) do { } while (0)
34 #define tee_mtime_report() do { } while (0)
35 #define tee_mtime_perftest()  do { } while (0)
36 #endif
37 
38 #endif /* TEE_COMMON_H */
39