sys_arch.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef __ARCH_SYS_ARCH_H__
  2. #define __ARCH_SYS_ARCH_H__
  3. #include "wm_osal.h"
  4. #include "wm_config.h"
  5. #define LWIP_STK_SIZE 512
  6. #define LWIP_TASK_MAX 1
  7. /* The user can change this priority level.
  8. * It is important that there was no crossing with other levels.
  9. */
  10. #define LWIP_TSK_PRIO TLS_LWIP_TASK_PRIO
  11. #define LWIP_TASK_START_PRIO LWIP_TSK_PRIO
  12. #define LWIP_TASK_END_PRIO LWIP_TSK_PRIO +LWIP_TASK_MAX
  13. /* the max size of each mailbox */
  14. #define MAX_QUEUE_ENTRIES 20
  15. #define SYS_MBOX_NULL (void *)0
  16. #define SYS_SEM_NULL (void *)0
  17. #define sys_arch_mbox_tryfetch(mbox,msg) \
  18. sys_arch_mbox_fetch(mbox,msg,1)
  19. typedef tls_os_sem_t * sys_sem_t;
  20. typedef tls_os_queue_t * sys_mbox_t;
  21. typedef u8_t sys_thread_t;
  22. typedef unsigned long int sys_prot_t;
  23. /* This optional function does a "fast" critical region protection and returns
  24. the previous protection level. This function is only called during very short
  25. critical regions. An embedded system which supports ISR-based drivers might want
  26. to implement this function by disabling interrupts. Task-based systems might want
  27. to implement this by using a mutex or disabling tasking. This function should
  28. support recursive calls from the same task or interrupt. In other words,
  29. sys_arch_protect() could be called while already protected. In that case the
  30. return value indicates that it is already protected. */
  31. extern sys_prot_t sys_arch_protect(void);
  32. /* This optional function does a "fast" set of critical region protection to the
  33. value specified by pval. See the documentation for sys_arch_protect() for more
  34. information. This function is only required if your port is supporting an
  35. operating system. */
  36. extern void sys_arch_unprotect(sys_prot_t pval);
  37. #endif /* __ARCH_SYS_ARCH_H__ */