ReactOS 0.4.16-dev-306-g647d351
sys.h File Reference
#include "lwip/opt.h"
#include "lwip/err.h"
#include "arch/sys_arch.h"
Include dependency graph for sys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SYS_ARCH_TIMEOUT   0xffffffffUL
 
#define SYS_MBOX_EMPTY   SYS_ARCH_TIMEOUT
 
#define LWIP_COMPAT_MUTEX   0
 
#define sys_sem_wait(sem)   sys_arch_sem_wait(sem, 0)
 
#define sys_sem_valid_val(sem)   sys_sem_valid(&(sem))
 
#define sys_sem_set_invalid_val(sem)   sys_sem_set_invalid(&(sem))
 
#define sys_mbox_tryfetch(mbox, msg)   sys_arch_mbox_tryfetch(mbox, msg)
 
#define sys_mbox_fetch(mbox, msg)   sys_arch_mbox_fetch(mbox, msg, 0)
 
#define sys_mbox_valid_val(mbox)   sys_mbox_valid(&(mbox))
 
#define sys_mbox_set_invalid_val(mbox)   sys_mbox_set_invalid(&(mbox))
 
#define LWIP_MARK_TCPIP_THREAD()
 
#define SYS_ARCH_DECL_PROTECT(lev)
 
#define SYS_ARCH_PROTECT(lev)
 
#define SYS_ARCH_UNPROTECT(lev)
 
#define SYS_ARCH_INC(var, val)
 
#define SYS_ARCH_DEC(var, val)
 
#define SYS_ARCH_GET(var, ret)
 
#define SYS_ARCH_SET(var, val)
 
#define SYS_ARCH_LOCKED(code)
 

Typedefs

typedef void(* lwip_thread_fn) (void *arg)
 

Functions

err_t sys_mutex_new (sys_mutex_t *mutex)
 
void sys_mutex_lock (sys_mutex_t *mutex)
 
void sys_mutex_unlock (sys_mutex_t *mutex)
 
void sys_mutex_free (sys_mutex_t *mutex)
 
int sys_mutex_valid (sys_mutex_t *mutex)
 
void sys_mutex_set_invalid (sys_mutex_t *mutex)
 
err_t sys_sem_new (sys_sem_t *sem, u8_t count)
 
void sys_sem_signal (sys_sem_t *sem)
 
u32_t sys_arch_sem_wait (sys_sem_t *sem, u32_t timeout)
 
void sys_sem_free (sys_sem_t *sem)
 
int sys_sem_valid (sys_sem_t *sem)
 
void sys_sem_set_invalid (sys_sem_t *sem)
 
void sys_msleep (u32_t ms)
 
err_t sys_mbox_new (sys_mbox_t *mbox, int size)
 
void sys_mbox_post (sys_mbox_t *mbox, void *msg)
 
err_t sys_mbox_trypost (sys_mbox_t *mbox, void *msg)
 
err_t sys_mbox_trypost_fromisr (sys_mbox_t *mbox, void *msg)
 
u32_t sys_arch_mbox_fetch (sys_mbox_t *mbox, void **msg, u32_t timeout)
 
u32_t sys_arch_mbox_tryfetch (sys_mbox_t *mbox, void **msg)
 
void sys_mbox_free (sys_mbox_t *mbox)
 
int sys_mbox_valid (sys_mbox_t *mbox)
 
void sys_mbox_set_invalid (sys_mbox_t *mbox)
 
sys_thread_t sys_thread_new (const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio)
 
void sys_init (void)
 
u32_t sys_jiffies (void)
 
u32_t sys_now (void)
 

Detailed Description

OS abstraction layer

Definition in file sys.h.

Macro Definition Documentation

◆ LWIP_COMPAT_MUTEX

#define LWIP_COMPAT_MUTEX   0

Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores should be used instead

Definition at line 108 of file sys.h.

◆ SYS_ARCH_DEC

#define SYS_ARCH_DEC (   var,
  val 
)
Value:
do { \
SYS_ARCH_DECL_PROTECT(old_level); \
SYS_ARCH_PROTECT(old_level); \
var -= val; \
SYS_ARCH_UNPROTECT(old_level); \
} while(0)
GLuint GLfloat * val
Definition: glext.h:7180
const char * var
Definition: shader.c:5666

Definition at line 535 of file sys.h.

◆ SYS_ARCH_DECL_PROTECT

#define SYS_ARCH_DECL_PROTECT (   lev)

SYS_LIGHTWEIGHT_PROT define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation.

Definition at line 512 of file sys.h.

◆ SYS_ARCH_GET

#define SYS_ARCH_GET (   var,
  ret 
)
Value:
do { \
SYS_ARCH_DECL_PROTECT(old_level); \
SYS_ARCH_PROTECT(old_level); \
ret = var; \
SYS_ARCH_UNPROTECT(old_level); \
} while(0)
int ret

Definition at line 544 of file sys.h.

◆ SYS_ARCH_INC

#define SYS_ARCH_INC (   var,
  val 
)
Value:
do { \
SYS_ARCH_DECL_PROTECT(old_level); \
SYS_ARCH_PROTECT(old_level); \
var += val; \
SYS_ARCH_UNPROTECT(old_level); \
} while(0)

Definition at line 526 of file sys.h.

◆ SYS_ARCH_LOCKED

#define SYS_ARCH_LOCKED (   code)
Value:
do { \
SYS_ARCH_DECL_PROTECT(old_level); \
SYS_ARCH_PROTECT(old_level); \
code; \
SYS_ARCH_UNPROTECT(old_level); \
} while(0)
Definition: inflate.c:139

Definition at line 562 of file sys.h.

◆ SYS_ARCH_PROTECT

#define SYS_ARCH_PROTECT (   lev)

Definition at line 513 of file sys.h.

◆ SYS_ARCH_SET

#define SYS_ARCH_SET (   var,
  val 
)
Value:
do { \
SYS_ARCH_DECL_PROTECT(old_level); \
SYS_ARCH_PROTECT(old_level); \
var = val; \
SYS_ARCH_UNPROTECT(old_level); \
} while(0)

Definition at line 553 of file sys.h.

◆ SYS_ARCH_TIMEOUT

#define SYS_ARCH_TIMEOUT   0xffffffffUL

Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait

Definition at line 87 of file sys.h.

◆ SYS_ARCH_UNPROTECT

#define SYS_ARCH_UNPROTECT (   lev)

Definition at line 514 of file sys.h.

◆ SYS_MBOX_EMPTY

#define SYS_MBOX_EMPTY   SYS_ARCH_TIMEOUT

sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. For now we use the same magic value, but we allow this to change in future.

Definition at line 92 of file sys.h.

◆ sys_mbox_fetch

#define sys_mbox_fetch (   mbox,
  msg 
)    sys_arch_mbox_fetch(mbox, msg, 0)

Definition at line 370 of file sys.h.

◆ sys_mbox_set_invalid_val

#define sys_mbox_set_invalid_val (   mbox)    sys_mbox_set_invalid(&(mbox))

Same as sys_mbox_set_invalid() but taking a value, not a pointer

Definition at line 401 of file sys.h.

◆ sys_mbox_tryfetch

#define sys_mbox_tryfetch (   mbox,
  msg 
)    sys_arch_mbox_tryfetch(mbox, msg)

For now, we map straight to sys_arch implementation.

Definition at line 360 of file sys.h.

◆ sys_mbox_valid_val

#define sys_mbox_valid_val (   mbox)    sys_mbox_valid(&(mbox))

Same as sys_mbox_valid() but taking a value, not a pointer

Definition at line 395 of file sys.h.

◆ sys_sem_set_invalid_val

#define sys_sem_set_invalid_val (   sem)    sys_sem_set_invalid(&(sem))

Same as sys_sem_set_invalid() but taking a value, not a pointer

Definition at line 258 of file sys.h.

◆ sys_sem_valid_val

#define sys_sem_valid_val (   sem)    sys_sem_valid(&(sem))

Same as sys_sem_valid() but taking a value, not a pointer

Definition at line 252 of file sys.h.

◆ sys_sem_wait

#define sys_sem_wait (   sem)    sys_arch_sem_wait(sem, 0)

Wait for a semaphore - forever/no timeout

Definition at line 227 of file sys.h.

Typedef Documentation

◆ lwip_thread_fn

typedef void(* lwip_thread_fn) (void *arg)

Function prototype for thread functions

Definition at line 98 of file sys.h.

Function Documentation

◆ sys_jiffies()

u32_t sys_jiffies ( void  )

Ticks/jiffies since power up.

Definition at line 48 of file sys_arch.c.

49{
50 return lwip_sys_now;
51}
u32_t lwip_sys_now
Definition: sys_arch.c:45