forked from wolfSSL/wolfssl
wc_port.c nad header files for ROTSv2
This commit is contained in:
@@ -1261,6 +1261,43 @@ int wolfSSL_CryptHwMutexUnLock(void) {
|
||||
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)
|
||||
|
||||
int wc_InitMutex(wolfSSL_Mutex* m)
|
||||
|
@@ -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 */
|
||||
|
@@ -53,7 +53,8 @@
|
||||
#include "rl_net.h"
|
||||
#define SOCKET_T int
|
||||
typedef int socklen_t ;
|
||||
static unsigned long inet_addr(const char *cp)
|
||||
#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]) ;
|
||||
@@ -61,9 +62,9 @@
|
||||
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) ;
|
||||
#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