summaryrefslogtreecommitdiff
path: root/tool/mbed/mbed-sdk/libraries/net/https/axTLS/ssl/os_port.h
blob: 3937261a75861c668c964d16ceb96a4e02554600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef HEADER_OS_PORT_H
#define HEADER_OS_PORT_H
#ifdef __cplusplus
extern "C" {
#endif

#include "config.h"

//#include <Thread.h>
#define SSL_CTX_MUTEX_TYPE          //Mutex
#define SSL_CTX_MUTEX_INIT(A)       //pthread_mutex_init(&A, NULL)
#define SSL_CTX_MUTEX_DESTROY(A)    //pthread_mutex_destroy(&A)
#define SSL_CTX_LOCK(A)             //pthread_mutex_lock(&A)
#define SSL_CTX_UNLOCK(A)           //pthread_mutex_unlock(&A)

#define malloc(A)       ax_malloc(A, __FILE__, __LINE__)
#ifndef realloc
#define realloc(A,B)    ax_realloc(A,B, __FILE__, __LINE__)
#endif
#define calloc(A,B)     ax_calloc(A,B, __FILE__, __LINE__)
#define free(A)         ax_free(A, __FILE__, __LINE__)

#define STDCALL
#define EXP_FUNC
void init_memory_buf(void);
void disable_memory_buf(void);
void enable_memory_buf(void);
void print_buf_stats(void);
void print_all_buf_stats(void);

EXP_FUNC void * STDCALL ax_malloc(size_t s, const char* f, const int l);
EXP_FUNC void * STDCALL ax_realloc(void *y, size_t s, const char* f, const int l);
EXP_FUNC void * STDCALL ax_calloc(size_t n, size_t s, const char* f, const int l);
EXP_FUNC void   STDCALL ax_free(void *y, const char* f, const int l);

//EXP_FUNC int STDCALL ax_open(const char *pathname, int flags); 

#define SOCKET_READ(A,B,C)      lwip_read(A,B,C)
#define SOCKET_WRITE(A,B,C)     lwip_write(A,B,C)
#define SOCKET_CLOSE(A)         closesocket(A)
#define TTY_FLUSH()
#ifdef __cplusplus
}
#endif
#endif