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;
|
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)
|
#elif defined(WOLFSSL_MDK_ARM)
|
||||||
|
|
||||||
int wc_InitMutex(wolfSSL_Mutex* m)
|
int wc_InitMutex(wolfSSL_Mutex* m)
|
||||||
|
@@ -146,14 +146,14 @@
|
|||||||
/* do nothing */
|
/* do nothing */
|
||||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||||
#include "cmsis_os.h"
|
#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)
|
#elif defined(WOLFSSL_MDK_ARM)
|
||||||
#if defined(WOLFSSL_MDK5)
|
#if !defined(WOLFSSL_MDK5)
|
||||||
#include "cmsis_os.h"
|
|
||||||
#else
|
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
#endif
|
#endif
|
||||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
|
||||||
#include "cmsis_os.h"
|
|
||||||
#elif defined(MBED)
|
#elif defined(MBED)
|
||||||
#elif defined(WOLFSSL_TIRTOS)
|
#elif defined(WOLFSSL_TIRTOS)
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
|
@@ -53,7 +53,8 @@
|
|||||||
#include "rl_net.h"
|
#include "rl_net.h"
|
||||||
#define SOCKET_T int
|
#define SOCKET_T int
|
||||||
typedef int socklen_t ;
|
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 ;
|
unsigned int a[4] ; unsigned long ret ;
|
||||||
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
|
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
|
||||||
@@ -62,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
#if defined(HAVE_KEIL_RTX)
|
#if defined(HAVE_KEIL_RTX)
|
||||||
#define sleep(t) os_dly_wait(t/1000+1);
|
#define sleep(t) os_dly_wait(t/1000+1);
|
||||||
#elif defined (WOLFSSL_CMSIS_RTOS)
|
#elif defined(WOLFSSL_CMSIS_RTOS) || defined(WOLFSSL_CMSIS_RTOSv2)
|
||||||
#define sleep(t) osDelay(t/1000+1);
|
#define sleep(t) osDelay(t/1000+1);
|
||||||
#endif
|
#endif
|
||||||
#elif defined(WOLFSSL_TIRTOS)
|
#elif defined(WOLFSSL_TIRTOS)
|
||||||
|
@@ -69,11 +69,12 @@
|
|||||||
#elif defined(FREESCALE_KSDK_MQX)
|
#elif defined(FREESCALE_KSDK_MQX)
|
||||||
#include <rtcs.h>
|
#include <rtcs.h>
|
||||||
#elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET))
|
#elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET))
|
||||||
#include "cmsis_os.h"
|
|
||||||
#include "rl_net.h"
|
#include "rl_net.h"
|
||||||
#include "errno.h"
|
#include "errno.h"
|
||||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
|
#elif defined(WOLFSSL_CMSIS_RTOSv2)
|
||||||
|
#include "cmsis_os2.h"
|
||||||
#elif defined(WOLFSSL_TIRTOS)
|
#elif defined(WOLFSSL_TIRTOS)
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#elif defined(FREERTOS_TCP)
|
#elif defined(FREERTOS_TCP)
|
||||||
|
Reference in New Issue
Block a user