Merge bee85df4c672ed13af57491d487654b880f4a140 into 4fdb917aae2fb5876e04f88621630712a906a067

This commit is contained in:
YAMAMOTO Takashi 2026-10-27 10:46:12 -04:00 committed by GitHub
commit b807fcef5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -363,6 +363,20 @@ static unsigned long mbedtls_timing_hardclock(void)
#endif /* !HAVE_HARDCLOCK && MBEDTLS_HAVE_ASM &&
__GNUC__ && __ia64__ */
#if !defined(HAVE_HARDCLOCK) && defined(MBEDTLS_HAVE_ASM) && \
defined(__GNUC__) && defined(__xtensa__)
#define HAVE_HARDCLOCK
static unsigned long mbedtls_timing_hardclock(void)
{
unsigned int ccount;
asm volatile ("rsr %0, ccount" : "=r" (ccount));
return ccount;
}
#endif /* !HAVE_HARDCLOCK && MBEDTLS_HAVE_ASM &&
__GNUC__ && __xtensa__ */
#if !defined(HAVE_HARDCLOCK) && defined(_WIN32) && \
!defined(EFIX64) && !defined(EFI32)