System abstraction layer. More...

Detailed Description

System abstraction layer.

Describes compiler and processor to lwIP.

Files

file  cc.h
 Compiler/platform abstraction.
 
file  sys_arch.h
 OS abstraction layer.
 

Data Structures

struct  sys_mbox_t
 Platform specific mailbox type. More...
 

Macros

#define BYTE_ORDER   (LITTLE_ENDIAN)
 platform's endianness
 
#define LWIP_COMPAT_MUTEX   (0)
 System configuration.
 

Typedefs

typedef kernel_pid_t sys_thread_t
 Platform specific thread type.
 

Variables

kernel_pid_t lwip_tcpip_thread
 PID of the lwIP TCP/IP thread.
 

Semaphores definitions

See also
https://www.nongnu.org/lwip/2_1_x/group__sys__sem.html
typedef sema_t sys_sem_t
 Platform specific semaphore type.
 
static bool sys_sem_valid (sys_sem_t *sem)
 
#define sys_sem_valid(sem)   (sys_sem_valid(sem))
 
#define sys_sem_set_invalid(sem)
 

Mutexes definitions

See also
https://www.nongnu.org/lwip/2_1_x/group__sys__mutex.html
typedef mutex_t sys_mutex_t
 Platform specific mutex type.
 
static bool sys_mutex_valid (sys_mutex_t *mutex)
 
#define sys_mutex_valid(mutex)   (sys_mutex_valid(mutex))
 
#define sys_mutex_set_invalid(mutex)
 

Mailboxes OS abstraction layer definitions

See also
https://www.nongnu.org/lwip/2_1_x/group__sys__mbox.html
static bool sys_mbox_valid (sys_mbox_t *mbox)
 
static void sys_mbox_set_invalid (sys_mbox_t *mbox)
 
#define SYS_MBOX_SIZE   (8)
 
#define sys_mbox_valid(mbox)   (sys_mbox_valid(mbox))
 
#define sys_mbox_set_invalid(mbox)   (sys_mbox_set_invalid(mbox))
 

Functions for locking/unlocking core to assure thread safety.

void sys_lock_tcpip_core (void)
 
void sys_unlock_tcpip_core (void)
 
#define LOCK_TCPIP_CORE()   sys_lock_tcpip_core()
 
#define UNLOCK_TCPIP_CORE()   sys_unlock_tcpip_core()
 

(sn)printf formatters for the generic lwIP types

#define X8_F   "02" PRIx8
 
#define U16_F   PRIu16
 
#define S16_F   PRId16
 
#define X16_F   PRIx16
 
#define U32_F   PRIu32
 
#define S32_F   PRId32
 
#define X32_F   PRIx32
 
#define SZT_F   PRIuPTR
 

Compiler hints for packing structures

#define PACK_STRUCT_FIELD(x)   x
 
#define PACK_STRUCT_STRUCT   __attribute__((packed))
 
#define PACK_STRUCT_BEGIN
 
#define PACK_STRUCT_END
 

Platform specific diagnostic output

#define LWIP_PLATFORM_DIAG(x)   printf x
 
#define LWIP_PLATFORM_ASSERT(x)
 

Critical sections protection definitions

See also
https://www.nongnu.org/lwip/2_1_x/group__sys__prot.html
#define SYS_ARCH_PROTECT(x)   mutex_lock(&x)
 
#define SYS_ARCH_UNPROTECT(x)   mutex_unlock(&x)
 
#define SYS_ARCH_DECL_PROTECT(x)   mutex_t x = MUTEX_INIT
 

Macro Definition Documentation

◆ LWIP_PLATFORM_ASSERT

#define LWIP_PLATFORM_ASSERT (   x)
Value:
do { \
printf("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \
fflush(NULL); \
abort(); \
} while (0)

Definition at line 96 of file cc.h.