37 #ifndef LWIP_HDR_SYS_H
38 #define LWIP_HDR_SYS_H
54 #define sys_sem_new(s, c) ERR_OK
55 #define sys_sem_signal(s)
56 #define sys_sem_wait(s)
57 #define sys_arch_sem_wait(s,t)
58 #define sys_sem_free(s)
59 #define sys_sem_valid(s) 0
60 #define sys_sem_valid_val(s) 0
61 #define sys_sem_set_invalid(s)
62 #define sys_sem_set_invalid_val(s)
63 #define sys_mutex_new(mu) ERR_OK
64 #define sys_mutex_lock(mu)
65 #define sys_mutex_unlock(mu)
66 #define sys_mutex_free(mu)
67 #define sys_mutex_valid(mu) 0
68 #define sys_mutex_set_invalid(mu)
69 #define sys_mbox_new(m, s) ERR_OK
70 #define sys_mbox_fetch(m,d)
71 #define sys_mbox_tryfetch(m,d)
72 #define sys_mbox_post(m,d)
73 #define sys_mbox_trypost(m,d)
74 #define sys_mbox_free(m)
75 #define sys_mbox_valid(m)
76 #define sys_mbox_valid_val(m)
77 #define sys_mbox_set_invalid(m)
78 #define sys_mbox_set_invalid_val(m)
80 #define sys_thread_new(n,t,a,s,p)
87 #define SYS_ARCH_TIMEOUT 0xffffffffUL
92 #define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT
107 #ifndef LWIP_COMPAT_MUTEX
108 #define LWIP_COMPAT_MUTEX 0
111 #if LWIP_COMPAT_MUTEX
113 #define sys_mutex_t sys_sem_t
114 #define sys_mutex_new(mutex) sys_sem_new(mutex, 1)
115 #define sys_mutex_lock(mutex) sys_sem_wait(mutex)
116 #define sys_mutex_unlock(mutex) sys_sem_signal(mutex)
117 #define sys_mutex_free(mutex) sys_sem_free(mutex)
118 #define sys_mutex_valid(mutex) sys_sem_valid(mutex)
119 #define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex)
156 #ifndef sys_mutex_valid
166 #ifndef sys_mutex_set_invalid
227 #define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0)
228 #ifndef sys_sem_valid
238 #ifndef sys_sem_set_invalid
248 #ifndef sys_sem_valid_val
252 #define sys_sem_valid_val(sem) sys_sem_valid(&(sem))
254 #ifndef sys_sem_set_invalid_val
258 #define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem))
338 #ifndef sys_arch_mbox_tryfetch
360 #define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg)
370 #define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0)
371 #ifndef sys_mbox_valid
381 #ifndef sys_mbox_set_invalid
391 #ifndef sys_mbox_valid_val
395 #define sys_mbox_valid_val(mbox) sys_mbox_valid(&(mbox))
397 #ifndef sys_mbox_set_invalid_val
401 #define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox))
453 #ifndef SYS_ARCH_PROTECT
459 #if SYS_LIGHTWEIGHT_PROT
468 #define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
480 #define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
491 #define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)
497 #define SYS_ARCH_DECL_PROTECT(lev)
498 #define SYS_ARCH_PROTECT(lev)
499 #define SYS_ARCH_UNPROTECT(lev)
511 #define SYS_ARCH_INC(var, val) do { \
512 SYS_ARCH_DECL_PROTECT(old_level); \
513 SYS_ARCH_PROTECT(old_level); \
515 SYS_ARCH_UNPROTECT(old_level); \
520 #define SYS_ARCH_DEC(var, val) do { \
521 SYS_ARCH_DECL_PROTECT(old_level); \
522 SYS_ARCH_PROTECT(old_level); \
524 SYS_ARCH_UNPROTECT(old_level); \
529 #define SYS_ARCH_GET(var, ret) do { \
530 SYS_ARCH_DECL_PROTECT(old_level); \
531 SYS_ARCH_PROTECT(old_level); \
533 SYS_ARCH_UNPROTECT(old_level); \
538 #define SYS_ARCH_SET(var, val) do { \
539 SYS_ARCH_DECL_PROTECT(old_level); \
540 SYS_ARCH_PROTECT(old_level); \
542 SYS_ARCH_UNPROTECT(old_level); \
546 #ifndef SYS_ARCH_LOCKED
547 #define SYS_ARCH_LOCKED(code) do { \
548 SYS_ARCH_DECL_PROTECT(old_level); \
549 SYS_ARCH_PROTECT(old_level); \
551 SYS_ARCH_UNPROTECT(old_level); \
int sys_prot_t
Definition: cc.h:39
uint32_t u32_t
Definition: arch.h:129
uint8_t u8_t
Definition: arch.h:125
s8_t err_t
Definition: err.h:96
void sys_mbox_set_invalid(sys_mbox_t *mbox)
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
int sys_mbox_valid(sys_mbox_t *mbox)
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_new(sys_mbox_t *mbox, int size)
void sys_mbox_free(sys_mbox_t *mbox)
err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg)
u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg)
sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio)
void sys_msleep(u32_t ms)
Definition: sys.c:135
void sys_mutex_free(sys_mutex_t *mutex)
err_t sys_mutex_new(sys_mutex_t *mutex)
void sys_mutex_set_invalid(sys_mutex_t *mutex)
void sys_mutex_lock(sys_mutex_t *mutex)
void sys_mutex_unlock(sys_mutex_t *mutex)
int sys_mutex_valid(sys_mutex_t *mutex)
int sys_sem_valid(sys_sem_t *sem)
void sys_sem_set_invalid(sys_sem_t *sem)
void sys_sem_free(sys_sem_t *sem)
u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
void sys_sem_signal(sys_sem_t *sem)
err_t sys_sem_new(sys_sem_t *sem, u8_t count)
u32_t sys_now(void)
Returns the current time in milliseconds when LWIP_TIMERS == 1 and NO_SYS == 1.
Definition: timeouts.c:464
void(* lwip_thread_fn)(void *arg)
Definition: sys.h:98
osMessageQId sys_mbox_t
Definition: sys_arch.h:54
osSemaphoreId sys_mutex_t
Definition: sys_arch.h:53
osSemaphoreId sys_sem_t
Definition: sys_arch.h:52
osThreadId sys_thread_t
Definition: sys_arch.h:55