OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
timing.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
8  * SPDX-License-Identifier: Apache-2.0
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License"); you may
11  * not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  * This file is part of mbed TLS (https://tls.mbed.org)
23  */
24 #ifndef MBEDTLS_TIMING_H
25 #define MBEDTLS_TIMING_H
26 
27 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include MBEDTLS_CONFIG_FILE
31 #endif
32 
33 #include <stdint.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #if !defined(MBEDTLS_TIMING_ALT)
40 // Regular implementation
41 //
42 
47 {
48  unsigned char opaque[32];
49 };
50 
55 {
57  uint32_t int_ms;
58  uint32_t fin_ms;
60 
61 #else /* MBEDTLS_TIMING_ALT */
62 #include "timing_alt.h"
63 #endif /* MBEDTLS_TIMING_ALT */
64 
65 extern volatile int mbedtls_timing_alarmed;
66 
77 unsigned long mbedtls_timing_hardclock( void );
78 
96 unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset );
97 
108 void mbedtls_set_alarm( int seconds );
109 
124 void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms );
125 
138 int mbedtls_timing_get_delay( void *data );
139 
140 #if defined(MBEDTLS_SELF_TEST)
141 
146 int mbedtls_timing_self_test( int verbose );
147 #endif
148 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif /* timing.h */
uint32_t int_ms
Definition: timing.h:57
unsigned long mbedtls_timing_hardclock(void)
Return the CPU cycle counter value.
unsigned char opaque[32]
Definition: timing.h:48
struct mbedtls_timing_delay_context mbedtls_timing_delay_context
Context for mbedtls_timing_set/get_delay()
Configuration options (set of defines)
struct mbedtls_timing_hr_time timer
Definition: timing.h:56
void mbedtls_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms)
Set a pair of delays to watch (See mbedtls_timing_get_delay().)
uint32_t fin_ms
Definition: timing.h:58
Context for mbedtls_timing_set/get_delay()
Definition: timing.h:54
volatile int mbedtls_timing_alarmed
void mbedtls_set_alarm(int seconds)
Setup an alarm clock.
unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
Return the elapsed time in milliseconds.
timer structure
Definition: timing.h:46
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.)