56 #ifndef LWIP_HDR_SYS_H 57 #define LWIP_HDR_SYS_H 69 typedef u8_t sys_sem_t;
70 typedef u8_t sys_mutex_t;
73 #define sys_sem_new(s, c) ERR_OK 74 #define sys_sem_signal(s) 75 #define sys_sem_wait(s) 76 #define sys_arch_sem_wait(s,t) 77 #define sys_sem_free(s) 78 #define sys_sem_valid(s) 0 79 #define sys_sem_valid_val(s) 0 80 #define sys_sem_set_invalid(s) 81 #define sys_sem_set_invalid_val(s) 82 #define sys_mutex_new(mu) ERR_OK 83 #define sys_mutex_lock(mu) 84 #define sys_mutex_unlock(mu) 85 #define sys_mutex_free(mu) 86 #define sys_mutex_valid(mu) 0 87 #define sys_mutex_set_invalid(mu) 88 #define sys_mbox_new(m, s) ERR_OK 89 #define sys_mbox_fetch(m,d) 90 #define sys_mbox_tryfetch(m,d) 91 #define sys_mbox_post(m,d) 92 #define sys_mbox_trypost(m,d) 93 #define sys_mbox_free(m) 94 #define sys_mbox_valid(m) 95 #define sys_mbox_valid_val(m) 96 #define sys_mbox_set_invalid(m) 97 #define sys_mbox_set_invalid_val(m) 99 #define sys_thread_new(n,t,a,s,p) 101 #define sys_msleep(t) 106 #define SYS_ARCH_TIMEOUT 0xffffffffUL 111 #define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT 114 #include "arch/sys_arch.h" 126 #ifndef LWIP_COMPAT_MUTEX 127 #define LWIP_COMPAT_MUTEX 0 130 #if LWIP_COMPAT_MUTEX 132 #define sys_mutex_t sys_sem_t 133 #define sys_mutex_new(mutex) sys_sem_new(mutex, 1) 134 #define sys_mutex_lock(mutex) sys_sem_wait(mutex) 135 #define sys_mutex_unlock(mutex) sys_sem_signal(mutex) 136 #define sys_mutex_free(mutex) sys_sem_free(mutex) 137 #define sys_mutex_valid(mutex) sys_sem_valid(mutex) 138 #define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex) 169 #ifndef sys_mutex_valid 176 #ifndef sys_mutex_set_invalid 217 #define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0) 218 #ifndef sys_sem_valid 225 #ifndef sys_sem_set_invalid 232 #ifndef sys_sem_valid_val 236 #define sys_sem_valid_val(sem) sys_sem_valid(&(sem)) 238 #ifndef sys_sem_set_invalid_val 242 #define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem)) 290 #ifndef sys_arch_mbox_tryfetch 304 #define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg) 311 #define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0) 312 #ifndef sys_mbox_valid 319 #ifndef sys_mbox_set_invalid 326 #ifndef sys_mbox_valid_val 330 #define sys_mbox_valid_val(mbox) sys_mbox_valid(&(mbox)) 332 #ifndef sys_mbox_set_invalid_val 336 #define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox)) 376 #ifndef SYS_ARCH_PROTECT 382 #if SYS_LIGHTWEIGHT_PROT 391 #define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev 403 #define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() 414 #define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) 415 sys_prot_t sys_arch_protect(
void);
416 void sys_arch_unprotect(sys_prot_t pval);
420 #define SYS_ARCH_DECL_PROTECT(lev) 421 #define SYS_ARCH_PROTECT(lev) 422 #define SYS_ARCH_UNPROTECT(lev) 434 #define SYS_ARCH_INC(var, val) do { \ 435 SYS_ARCH_DECL_PROTECT(old_level); \ 436 SYS_ARCH_PROTECT(old_level); \ 438 SYS_ARCH_UNPROTECT(old_level); \ 443 #define SYS_ARCH_DEC(var, val) do { \ 444 SYS_ARCH_DECL_PROTECT(old_level); \ 445 SYS_ARCH_PROTECT(old_level); \ 447 SYS_ARCH_UNPROTECT(old_level); \ 452 #define SYS_ARCH_GET(var, ret) do { \ 453 SYS_ARCH_DECL_PROTECT(old_level); \ 454 SYS_ARCH_PROTECT(old_level); \ 456 SYS_ARCH_UNPROTECT(old_level); \ 461 #define SYS_ARCH_SET(var, val) do { \ 462 SYS_ARCH_DECL_PROTECT(old_level); \ 463 SYS_ARCH_PROTECT(old_level); \ 465 SYS_ARCH_UNPROTECT(old_level); \ void sys_sem_free(sys_sem_t *sem)
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
void sys_msleep(u32_t ms)
void sys_mutex_free(sys_mutex_t *mutex)
void sys_mbox_free(sys_mbox_t *mbox)
void sys_mbox_set_invalid(sys_mbox_t *mbox)
int sys_mbox_valid(sys_mbox_t *mbox)
void sys_mutex_unlock(sys_mutex_t *mutex)
sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio)
err_t sys_mbox_new(sys_mbox_t *mbox, int size)
void sys_mbox_post(sys_mbox_t *mbox, void *msg)
void(* lwip_thread_fn)(void *arg)
void sys_sem_signal(sys_sem_t *sem)
err_t sys_sem_new(sys_sem_t *sem, u8_t count)
int sys_mutex_valid(sys_mutex_t *mutex)
void sys_mutex_lock(sys_mutex_t *mutex)
void sys_sem_set_invalid(sys_sem_t *sem)
void sys_mutex_set_invalid(sys_mutex_t *mutex)
err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg)
u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg)
int sys_sem_valid(sys_sem_t *sem)
err_t sys_mutex_new(sys_mutex_t *mutex)