mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Fixes for building with bare-metal on Xilinx SDK with zynqmp. Added Zynqmp benchmark timer support.
This commit is contained in:
@@ -5979,6 +5979,28 @@ exit_ed_verify:
|
|||||||
(void)reset;
|
(void)reset;
|
||||||
return (double) tx_time_get() / TX_TIMER_TICKS_PER_SECOND;
|
return (double) tx_time_get() / TX_TIMER_TICKS_PER_SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif defined(WOLFSSL_XILINX)
|
||||||
|
#ifndef XPAR_CPU_CORTEXA53_0_TIMESTAMP_CLK_FREQ
|
||||||
|
#define XPAR_CPU_CORTEXA53_0_TIMESTAMP_CLK_FREQ 50000000
|
||||||
|
#endif
|
||||||
|
#ifndef COUNTS_PER_SECOND
|
||||||
|
#define COUNTS_PER_SECOND XPAR_CPU_CORTEXA53_0_TIMESTAMP_CLK_FREQ
|
||||||
|
#endif
|
||||||
|
|
||||||
|
double current_time(int reset)
|
||||||
|
{
|
||||||
|
double timer;
|
||||||
|
uint64_t cntPct = 0;
|
||||||
|
asm volatile("mrs %0, CNTPCT_EL0" : "=r" (cntPct));
|
||||||
|
|
||||||
|
/* Convert to milliseconds */
|
||||||
|
timer = (double)(cntPct / (COUNTS_PER_SECOND / 1000));
|
||||||
|
/* Convert to seconds.millisecond */
|
||||||
|
timer /= 1000;
|
||||||
|
return timer;
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#ifdef HAVE_CHACHA
|
#if defined(HAVE_CHACHA) && !defined(WOLFSSL_ARMASM)
|
||||||
|
|
||||||
#include <wolfssl/wolfcrypt/chacha.h>
|
#include <wolfssl/wolfcrypt/chacha.h>
|
||||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
|
#if (defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)) && !defined(WOLFSSL_ARMASM)
|
||||||
|
|
||||||
#if defined(HAVE_FIPS) && \
|
#if defined(HAVE_FIPS) && \
|
||||||
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
|
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
|
||||||
|
@@ -527,7 +527,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
|
|||||||
#endif
|
#endif
|
||||||
#define NEED_TMP_TIME
|
#define NEED_TMP_TIME
|
||||||
|
|
||||||
#elif defined(WOLFSSL_XILINX) && defined(FREERTOS)
|
#elif defined(WOLFSSL_XILINX)
|
||||||
#define USER_TIME
|
#define USER_TIME
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user