Add build option `WOLFTPM_NO_ACTIVE_THREAD_LS` to remove thread local on `gActiveTPM`.

pull/410/head
David Garske 2025-05-02 12:53:48 -07:00
parent e7aad1ac22
commit f2e6be4e16
1 changed files with 7 additions and 0 deletions

View File

@ -37,7 +37,14 @@
/* --- Local Variables -- */
/******************************************************************************/
#ifdef WOLFTPM_NO_ACTIVE_THREAD_LS
/* if using gHwLock and want to use a shared active TPM2_CTX between threads */
static TPM2_CTX* gActiveTPM;
#else
static THREAD_LS_T TPM2_CTX* gActiveTPM;
#endif
#ifndef WOLFTPM2_NO_WOLFCRYPT
static volatile int gWolfCryptRefCount = 0;
#endif