Support for Frosted OS

This commit is contained in:
Daniele Lacamera 2016-08-18 14:54:21 +02:00
parent 5347e32d63
commit 3d3f8c9dd3
2 changed files with 30 additions and 0 deletions

View File

@ -652,7 +652,33 @@ int UnLockMutex(wolfSSL_Mutex *m)
return ;
}
}
#elif defined (WOLFSSL_FROSTED)
int InitMutex(wolfSSL_Mutex* m)
{
*m = mutex_init();
if (*m)
return 0;
else
return -1;
}
int FreeMutex(wolfSSL_Mutex* m)
{
mutex_destroy(*m);
return(0) ;
}
int LockMutex(wolfSSL_Mutex* m)
{
mutex_lock(*m);
return 0;
}
int UnLockMutex(wolfSSL_Mutex* m)
{
mutex_unlock(*m);
return 0;
}
#elif defined(WOLFSSL_MDK_ARM)|| defined(WOLFSSL_CMSIS_RTOS)
#if defined(WOLFSSL_CMSIS_RTOS)

View File

@ -73,6 +73,8 @@
#elif defined(WOLFSSL_TIRTOS)
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#elif defined(WOLFSSL_FROSTED)
#include <semaphore.h>
#else
#ifndef SINGLE_THREADED
#define WOLFSSL_PTHREADS
@ -133,6 +135,8 @@
typedef osMutexId wolfSSL_Mutex;
#elif defined(WOLFSSL_TIRTOS)
typedef ti_sysbios_knl_Semaphore_Handle wolfSSL_Mutex;
#elif defined(WOLFSSL_FROSTED)
typedef mutex_t * wolfSSL_Mutex;
#else
#error Need a mutex type in multithreaded mode
#endif /* USE_WINDOWS_API */