Move part of timing module out of the library

Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
This commit is contained in:
TRodziewicz 2021-06-10 15:16:50 +02:00
parent 8cad2e22fc
commit d854083773
11 changed files with 251 additions and 480 deletions

View file

@ -63,21 +63,11 @@ typedef struct mbedtls_timing_delay_context
extern volatile int mbedtls_timing_alarmed;
/**
* \brief Return the CPU cycle counter value
*
* \warning This is only a best effort! Do not rely on this!
* In particular, it is known to be unreliable on virtual
* machines.
*
* \note This value starts at an unspecified origin and
* may wrap around.
*/
unsigned long mbedtls_timing_hardclock( void );
/**
* \brief Return the elapsed time in milliseconds
*
* \warning May change without notice
*
* \param val points to a timer structure
* \param reset If 0, query the elapsed time. Otherwise (re)start the timer.
*
@ -94,18 +84,6 @@ unsigned long mbedtls_timing_hardclock( void );
*/
unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset );
/**
* \brief Setup an alarm clock
*
* \param seconds delay before the "mbedtls_timing_alarmed" flag is set
* (must be >=0)
*
* \warning Only one alarm at a time is supported. In a threaded
* context, this means one for the whole process, not one per
* thread.
*/
void mbedtls_set_alarm( int seconds );
/**
* \brief Set a pair of delays to watch
* (See \c mbedtls_timing_get_delay().)
@ -136,15 +114,6 @@ void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms );
*/
int mbedtls_timing_get_delay( void *data );
#if defined(MBEDTLS_SELF_TEST)
/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if a test failed
*/
int mbedtls_timing_self_test( int verbose );
#endif
#ifdef __cplusplus
}
#endif