Merge bee85df4c672ed13af57491d487654b880f4a140 into f4a1aceb8ca7198b11447d6e1885ce70feb2dcc6

This commit is contained in:
YAMAMOTO Takashi 2026-07-27 21:03:38 +01:00 committed by GitHub
commit 9bae68d696
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)