/[lwip]/lwip/src/include/lwip/sys.h
ViewVC logotype

Diff of /lwip/src/include/lwip/sys.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by davidhaas, Tue Feb 18 19:27:48 2003 UTC revision 1.11 by davidhaas, Tue Feb 18 21:14:16 2003 UTC
# Line 36  Line 36 
36    
37  #include "lwip/opt.h"  #include "lwip/opt.h"
38    
 #define SYS_ARCH_DECL_PROTECT(lev)  
 #define SYS_ARCH_PROTECT(lev)  
 #define SYS_ARCH_UNPROTECT(lev)  
39    
40  #if NO_SYS  #if NO_SYS
41    
# Line 61  struct sys_timeout {u8_t dummy;}; Line 58  struct sys_timeout {u8_t dummy;};
58    
59  #define sys_thread_new(t,a)  #define sys_thread_new(t,a)
60    
61    /* We don't need protection if there is no OS */
62    #define SYS_ARCH_DECL_PROTECT(lev)
63    #define SYS_ARCH_PROTECT(lev)
64    #define SYS_ARCH_UNPROTECT(lev)
65    
66  #else /* NO_SYS */  #else /* NO_SYS */
67    
68  #include "arch/sys_arch.h"  #include "arch/sys_arch.h"
# Line 115  void sys_mbox_fetch(sys_mbox_t mbox, voi Line 117  void sys_mbox_fetch(sys_mbox_t mbox, voi
117     mechanism than using semaphores. Otherwise semaphores can be used for     mechanism than using semaphores. Otherwise semaphores can be used for
118     implementation */     implementation */
119  #ifndef SYS_ARCH_PROTECT  #ifndef SYS_ARCH_PROTECT
120    /** SYS_LIGHTWEIGHT_PROT
121     * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
122     * for certain critical regions during buffer allocation, deallocation and memory
123     * allocation and deallocation.
124     */
125  #ifdef SYS_LIGHTWEIGHT_PROT  #ifdef SYS_LIGHTWEIGHT_PROT
126    
127  #undef SYS_ARCH_DECL_PROTECT  /** SYS_ARCH_DECL_PROTECT
128     * declare a protection variable. This macro will default to defining a variable of
129     * type sys_prot_t. If a particular port needs a different implementation, then
130     * this macro may be defined in sys_arch.h.
131     */
132  #define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev  #define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
133  #undef SYS_ARCH_PROTECT  /** SYS_ARCH_PROTECT
134     * Perform a "fast" protect. This could be implemented by
135     * disabling interrupts for an embedded system or by using a semaphore or
136     * mutex. The implementation should allow calling SYS_ARCH_PROTECT when
137     * already protected. The old protection level is returned in the variable
138     * "lev". This macro will default to calling the sys_arch_protect() function
139     * which should be implemented in sys_arch.c. If a particular port needs a
140     * different implementation, then this macro may be defined in sys_arch.h
141     */
142  #define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()  #define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
143  #undef SYS_ARCH_UNPROTECT  /** SYS_ARCH_UNPROTECT
144     * Perform a "fast" set of the protection level to "lev". This could be
145     * implemented by setting the interrupt level to "lev" within the MACRO or by
146     * using a semaphore or mutex.  This macro will default to calling the
147     * sys_arch_unprotect() function which should be implemented in
148     * sys_arch.c. If a particular port needs a different implementation, then
149     * this macro may be defined in sys_arch.h
150     */
151  #define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)  #define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)
152  sys_prot_t sys_arch_protect(void);  sys_prot_t sys_arch_protect(void);
153  void sys_arch_unprotect(sys_prot_t pval);  void sys_arch_unprotect(sys_prot_t pval);

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26