Merge pull request #527 from danielinux/master

Support for Frosted OS
This commit is contained in:
Chris Conlon
2016-08-31 10:07:25 -06:00
committed by GitHub
2 changed files with 30 additions and 0 deletions

View File

@ -652,7 +652,33 @@ int UnLockMutex(wolfSSL_Mutex *m)
return ; 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) #elif defined(WOLFSSL_MDK_ARM)|| defined(WOLFSSL_CMSIS_RTOS)
#if defined(WOLFSSL_CMSIS_RTOS) #if defined(WOLFSSL_CMSIS_RTOS)

View File

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