lwIP
2.1.0
Lightweight IP stack
|
Macros | |
#define | SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev |
#define | SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() |
#define | SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) |
Used to protect short regions of code against concurrent access.
#define SYS_ARCH_DECL_PROTECT | ( | lev | ) | sys_prot_t 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.
SYS_ARCH_DECL_PROTECT declare a protection variable. This macro will default to defining a variable of type sys_prot_t. If a particular port needs a different implementation, then this macro may be defined in sys_arch.h.
#define SYS_ARCH_PROTECT | ( | lev | ) | lev = sys_arch_protect() |
SYS_ARCH_PROTECT Perform a "fast" protect. This could be implemented by disabling interrupts for an embedded system or by using a semaphore or mutex. The implementation should allow calling SYS_ARCH_PROTECT when already protected. The old protection level is returned in the variable "lev". This macro will default to calling the sys_arch_protect() function which should be implemented in sys_arch.c. If a particular port needs a different implementation, then this macro may be defined in sys_arch.h
#define SYS_ARCH_UNPROTECT | ( | lev | ) | sys_arch_unprotect(lev) |
SYS_ARCH_UNPROTECT Perform a "fast" set of the protection level to "lev". This could be implemented by setting the interrupt level to "lev" within the MACRO or by using a semaphore or mutex. This macro will default to calling the sys_arch_unprotect() function which should be implemented in sys_arch.c. If a particular port needs a different implementation, then this macro may be defined in sys_arch.h