Skip to content

Commit

Permalink
core: ltc: tomcrypt_custom.h: OP-TEE thread support
Browse files Browse the repository at this point in the history
This is a cherry-pick of commit 0d1e115 ("core: ltc: enable
thread-safety") and commit a189a57 ("ltc: mutex support, in case of
no mutex").

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
jforissier authored and jenswi-linaro committed Apr 24, 2024
1 parent 7f247ad commit cba20f6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/lib/libtomcrypt/src/headers/tomcrypt_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,18 @@
#endif

/* THREAD management */
#ifdef LTC_PTHREAD
#if defined(_CFG_CORE_LTC_OPTEE_THREAD)

#include <kernel/mutex.h>

#define LTC_MUTEX_GLOBAL(x) struct mutex x = MUTEX_INITIALIZER;
#define LTC_MUTEX_PROTO(x) extern struct mutex x;
#define LTC_MUTEX_TYPE(x) struct mutex x;
#define LTC_MUTEX_INIT(x) mutex_init(x);
#define LTC_MUTEX_LOCK(x) mutex_lock(x);
#define LTC_MUTEX_UNLOCK(x) mutex_unlock(x);

#elif defined(LTC_PTHREAD)

#include <pthread.h>

Expand Down

0 comments on commit cba20f6

Please sign in to comment.