Loading...
Searching...
No Matches

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

◆ BYTE_ORDER

#define BYTE_ORDER   (LITTLE_ENDIAN)

platform's endianness

Definition at line 42 of file cc.h.

◆ LOCK_TCPIP_CORE

#define LOCK_TCPIP_CORE ( )    sys_lock_tcpip_core()

Definition at line 127 of file sys_arch.h.

◆ LWIP_COMPAT_MUTEX

#define LWIP_COMPAT_MUTEX   (0)

System configuration.

Definition at line 42 of file sys_arch.h.

◆ 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.

◆ LWIP_PLATFORM_DIAG

#define LWIP_PLATFORM_DIAG (   x)    printf x

Definition at line 92 of file cc.h.

◆ PACK_STRUCT_BEGIN

#define PACK_STRUCT_BEGIN

Definition at line 71 of file cc.h.

◆ PACK_STRUCT_END

#define PACK_STRUCT_END

Definition at line 72 of file cc.h.

◆ PACK_STRUCT_FIELD

#define PACK_STRUCT_FIELD (   x)    x

Definition at line 69 of file cc.h.

◆ PACK_STRUCT_STRUCT

#define PACK_STRUCT_STRUCT   __attribute__((packed))

Definition at line 70 of file cc.h.

◆ S16_F

#define S16_F   PRId16

Definition at line 56 of file cc.h.

◆ S32_F

#define S32_F   PRId32

Definition at line 59 of file cc.h.

◆ SYS_ARCH_DECL_PROTECT

#define SYS_ARCH_DECL_PROTECT (   x)    mutex_t x = MUTEX_INIT

Definition at line 51 of file sys_arch.h.

◆ SYS_ARCH_PROTECT

#define SYS_ARCH_PROTECT (   x)    mutex_lock(&x)

Definition at line 49 of file sys_arch.h.

◆ SYS_ARCH_UNPROTECT

#define SYS_ARCH_UNPROTECT (   x)    mutex_unlock(&x)

Definition at line 50 of file sys_arch.h.

◆ sys_mbox_set_invalid

#define sys_mbox_set_invalid (   mbox)    (sys_mbox_set_invalid(mbox))

Definition at line 115 of file sys_arch.h.

◆ SYS_MBOX_SIZE

#define SYS_MBOX_SIZE   (8)

Definition at line 92 of file sys_arch.h.

◆ sys_mbox_valid

#define sys_mbox_valid (   mbox)    (sys_mbox_valid(mbox))

Definition at line 114 of file sys_arch.h.

◆ sys_mutex_set_invalid

#define sys_mutex_set_invalid (   mutex)

Definition at line 84 of file sys_arch.h.

◆ sys_mutex_valid

#define sys_mutex_valid (   mutex)    (sys_mutex_valid(mutex))

Definition at line 83 of file sys_arch.h.

◆ sys_sem_set_invalid

#define sys_sem_set_invalid (   sem)

Definition at line 68 of file sys_arch.h.

◆ sys_sem_valid

#define sys_sem_valid (   sem)    (sys_sem_valid(sem))

Definition at line 66 of file sys_arch.h.

◆ SZT_F

#define SZT_F   PRIuPTR

Definition at line 62 of file cc.h.

◆ U16_F

#define U16_F   PRIu16

Definition at line 55 of file cc.h.

◆ U32_F

#define U32_F   PRIu32

Definition at line 58 of file cc.h.

◆ UNLOCK_TCPIP_CORE

#define UNLOCK_TCPIP_CORE ( )    sys_unlock_tcpip_core()

Definition at line 129 of file sys_arch.h.

◆ X16_F

#define X16_F   PRIx16

Definition at line 57 of file cc.h.

◆ X32_F

#define X32_F   PRIx32

Definition at line 60 of file cc.h.

◆ X8_F

#define X8_F   "02" PRIx8

Definition at line 54 of file cc.h.

Typedef Documentation

◆ sys_mutex_t

Platform specific mutex type.

Definition at line 76 of file sys_arch.h.

◆ sys_sem_t

typedef sema_t sys_sem_t

Platform specific semaphore type.

Definition at line 59 of file sys_arch.h.

◆ sys_thread_t

Platform specific thread type.

Definition at line 118 of file sys_arch.h.

Function Documentation

◆ sys_mbox_set_invalid()

static void sys_mbox_set_invalid ( sys_mbox_t mbox)
inlinestatic

Definition at line 107 of file sys_arch.h.

◆ sys_mbox_valid()

static bool sys_mbox_valid ( sys_mbox_t mbox)
inlinestatic

Definition at line 102 of file sys_arch.h.

◆ sys_mutex_valid()

static bool sys_mutex_valid ( sys_mutex_t mutex)
inlinestatic

Definition at line 78 of file sys_arch.h.

◆ sys_sem_valid()

static bool sys_sem_valid ( sys_sem_t sem)
inlinestatic

Definition at line 61 of file sys_arch.h.