mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
VxWorks Update
1. Remove pthreads enable from VxWorks build. 2. Add mutex wrappers for native VxWorks mutex semaphores.
This commit is contained in:
@ -753,6 +753,47 @@ int wolfSSL_CryptHwMutexUnLock(void) {
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
#elif defined(WOLFSSL_VXWORKS)
|
||||
|
||||
int wc_InitMutex(wolfSSL_Mutex* m)
|
||||
{
|
||||
if (m) {
|
||||
if ((*m = semMCreate(0)) != SEM_ID_NULL)
|
||||
return 0;
|
||||
}
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
|
||||
int wc_FreeMutex(wolfSSL_Mutex* m)
|
||||
{
|
||||
if (m) {
|
||||
if (semDelete(*m) == OK)
|
||||
return 0;
|
||||
}
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
|
||||
int wc_LockMutex(wolfSSL_Mutex* m)
|
||||
{
|
||||
if (m) {
|
||||
if (semTake(*m, WAIT_FOREVER) == OK)
|
||||
return 0;
|
||||
}
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
|
||||
int wc_UnLockMutex(wolfSSL_Mutex* m)
|
||||
{
|
||||
if (m) {
|
||||
if (semGive(*m) == OK)
|
||||
return 0;
|
||||
}
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
#elif defined(THREADX)
|
||||
|
||||
int wc_InitMutex(wolfSSL_Mutex* m)
|
||||
|
@ -398,7 +398,6 @@
|
||||
#ifdef VXWORKS_SIM
|
||||
#define TFM_NO_ASM
|
||||
#endif
|
||||
#define WOLFSSL_PTHREADS
|
||||
#define WOLFSSL_HAVE_MIN
|
||||
#define WOLFSSL_HAVE_MAX
|
||||
#define USE_FAST_MATH
|
||||
|
@ -74,6 +74,8 @@
|
||||
/* do nothing */
|
||||
#elif defined(FREESCALE_FREE_RTOS)
|
||||
#include "fsl_os_abstraction.h"
|
||||
#elif defined(WOLFSSL_VXWORKS)
|
||||
#include <semLib.h>
|
||||
#elif defined(WOLFSSL_uITRON4)
|
||||
#include "stddef.h"
|
||||
#include "kernel.h"
|
||||
@ -151,6 +153,8 @@
|
||||
typedef MUTEX_STRUCT wolfSSL_Mutex;
|
||||
#elif defined(FREESCALE_FREE_RTOS)
|
||||
typedef mutex_t wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_VXWORKS)
|
||||
typedef SEM_ID wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_uITRON4)
|
||||
typedef struct wolfSSL_Mutex {
|
||||
T_CSEM sem ;
|
||||
|
Reference in New Issue
Block a user