forked from wolfSSL/wolfssl
wc_port.c nad header files for ROTSv2
This commit is contained in:
@ -1260,6 +1260,43 @@ int wolfSSL_CryptHwMutexUnLock(void) {
|
||||
osMutexRelease (*m);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(WOLFSSL_CMSIS_RTOSv2)
|
||||
int wc_InitMutex(wolfSSL_Mutex *m)
|
||||
{
|
||||
static const osMutexAttr_t attr = {
|
||||
"wolfSSL_mutex", osMutexRecursive, NULL, 0};
|
||||
|
||||
if ((*m = osMutexNew(&attr)) != NULL)
|
||||
return 0;
|
||||
else
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
int wc_FreeMutex(wolfSSL_Mutex *m)
|
||||
{
|
||||
if (osMutexDelete(*m) == osOK)
|
||||
return 0;
|
||||
else
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
|
||||
int wc_LockMutex(wolfSSL_Mutex *m)
|
||||
{
|
||||
if (osMutexAcquire(*m, osWaitForever) == osOK)
|
||||
return 0;
|
||||
else
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
int wc_UnLockMutex(wolfSSL_Mutex *m)
|
||||
{
|
||||
if (osMutexRelease(*m) == osOK)
|
||||
return 0;
|
||||
else
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
|
||||
#elif defined(WOLFSSL_MDK_ARM)
|
||||
|
||||
|
@ -146,14 +146,14 @@
|
||||
/* do nothing */
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
#include "cmsis_os.h"
|
||||
#elif defined(WOLFSSL_CMSIS_RTOSv2)
|
||||
#include "cmsis_os2.h"
|
||||
#elif defined(WOLFSSL_CMSIS_RTOSv2)
|
||||
#include "cmsis_os2.h"
|
||||
#elif defined(WOLFSSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#else
|
||||
#if !defined(WOLFSSL_MDK5)
|
||||
#include <rtl.h>
|
||||
#endif
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
#include "cmsis_os.h"
|
||||
#elif defined(MBED)
|
||||
#elif defined(WOLFSSL_TIRTOS)
|
||||
/* do nothing */
|
||||
|
@ -52,18 +52,19 @@
|
||||
#include <string.h>
|
||||
#include "rl_net.h"
|
||||
#define SOCKET_T int
|
||||
typedef int socklen_t ;
|
||||
static unsigned long inet_addr(const char *cp)
|
||||
typedef int socklen_t ;
|
||||
#define inet_addr wolfSSL_inet_addr
|
||||
static unsigned long wolfSSL_inet_addr(const char *cp)
|
||||
{
|
||||
unsigned int a[4] ; unsigned long ret ;
|
||||
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
|
||||
ret = ((a[3]<<24) + (a[2]<<16) + (a[1]<<8) + a[0]) ;
|
||||
return(ret) ;
|
||||
}
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
#define sleep(t) os_dly_wait(t/1000+1) ;
|
||||
#elif defined (WOLFSSL_CMSIS_RTOS)
|
||||
#define sleep(t) osDelay(t/1000+1) ;
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
#define sleep(t) os_dly_wait(t/1000+1);
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS) || defined(WOLFSSL_CMSIS_RTOSv2)
|
||||
#define sleep(t) osDelay(t/1000+1);
|
||||
#endif
|
||||
#elif defined(WOLFSSL_TIRTOS)
|
||||
#include <string.h>
|
||||
|
@ -69,11 +69,12 @@
|
||||
#elif defined(FREESCALE_KSDK_MQX)
|
||||
#include <rtcs.h>
|
||||
#elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET))
|
||||
#include "cmsis_os.h"
|
||||
#include "rl_net.h"
|
||||
#include "errno.h"
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
#include "cmsis_os.h"
|
||||
#elif defined(WOLFSSL_CMSIS_RTOSv2)
|
||||
#include "cmsis_os2.h"
|
||||
#elif defined(WOLFSSL_TIRTOS)
|
||||
#include <sys/socket.h>
|
||||
#elif defined(FREERTOS_TCP)
|
||||
|
Reference in New Issue
Block a user