Skip to content

Commit

Permalink
Provide a dummy implementation of timing.c
Browse files Browse the repository at this point in the history
Signed-off-by: Andrzej Kurek <[email protected]>
  • Loading branch information
Andrzej Kurek committed Mar 4, 2022
1 parent 06a00af commit 09e803c
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions library/timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ struct _hr_time

#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#if defined(MBEDTLS_HAVE_TIME)
#include <time.h>

#include <sys/time.h>
struct _hr_time
{
struct timeval start;
};

#endif
#endif /* _WIN32 && !EFIX64 && !EFI32 */

/**
Expand All @@ -75,6 +75,7 @@ struct _hr_time
* get_timer(0) }` the value time1+time2 is only approximately
* the delay since the first reset.
*/
#if defined(MBEDTLS_HAVE_TIME)
#if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)

unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset )
Expand Down Expand Up @@ -157,6 +158,26 @@ int mbedtls_timing_get_delay( void *data )

return( 0 );
}
#else
int mbedtls_timing_get_delay( void *data )
{
(void) data;
return( 0 );
}

void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms )
{
(void) data;
(void) int_ms;
(void) fin_ms;
}

unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset )
{
(void) val;
(void) reset;
return( 0 );
}
#endif /* MBEDTLS_HAVE_TIME */
#endif /* !MBEDTLS_TIMING_ALT */
#endif /* MBEDTLS_TIMING_C */

0 comments on commit 09e803c

Please sign in to comment.