#ifndef __ARCH_SYS_ARCH_H__ #define __ARCH_SYS_ARCH_H__ #include "osal.h" /* LwIP Type Mapping to OSAL Types */ typedef osal_sem_t sys_sem_t; typedef osal_mutex_t sys_mutex_t; typedef osal_mq_t sys_mbox_t; typedef osal_thread_t sys_thread_t; /* LwIP Constants */ #define SYS_MBOX_NULL NULL #define SYS_SEM_NULL NULL /* OSAL returns OSAL_ETIMEOUT, LwIP expects SYS_ARCH_TIMEOUT (usually 0xFFFFFFFF) */ #define SYS_ARCH_TIMEOUT 0xffffffffUL /* Protection (Critical Section) */ typedef uint32_t sys_prot_t; static inline sys_prot_t sys_arch_protect(void) { osal_enter_critical(); return 1; } static inline void sys_arch_unprotect(sys_prot_t pval) { (void)pval; osal_exit_critical(); } #endif /* __ARCH_SYS_ARCH_H__ */