[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/safe/include annots_stage1.h, 1.8, 1.9

David Gay idgay at users.sourceforge.net
Wed Jun 18 10:16:40 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/safe/include
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27109/tos/lib/safe/include

Modified Files:
	annots_stage1.h 
Log Message:
move annotations to nesC

Index: annots_stage1.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/safe/include/annots_stage1.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** annots_stage1.h	4 Jun 2008 19:22:33 -0000	1.8
--- annots_stage1.h	18 Jun 2008 17:16:37 -0000	1.9
***************
*** 1,7 ****
  #ifndef ANNOTS_STAGE1_INCLUDED
  #define ANNOTS_STAGE1_INCLUDED
- #include <stddef.h>
- 
- #define __DEPUTY_UNUSED__                      __attribute__((unused))
  
  // define away two obsolete annotations
--- 1,6 ----
+ /* Keep TinyOS happy with pre 1.3.0 nesC's */
+ 
  #ifndef ANNOTS_STAGE1_INCLUDED
  #define ANNOTS_STAGE1_INCLUDED
  
  // define away two obsolete annotations
***************
*** 9,40 ****
  #define SINGLE
  
! #if NESC >= 130
! 
! struct @nonnull @deputy_scope() @macro("__DEPUTY_NONNULL") { }; 
! struct @bnd @deputy_scope() @macro("__DEPUTY_BND") { void *lo, *hi; }; 
! struct @bnd_nok @deputy_scope() @macro("__DEPUTY_BND_NOK") { void *lo, *hi; }; 
! struct @count @deputy_scope() @macro("__DEPUTY_COUNT") { int n; }; 
! struct @count_nok @deputy_scope() @macro("__DEPUTY_COUNT_NOK") { int n; }; 
! struct @one @deputy_scope() @macro("__DEPUTY_ONE") { }; 
! struct @one_nok @deputy_scope() @macro("__DEPUTY_ONE_NOK") { };
! struct @dmemset @deputy_scope() @macro("__DEPUTY_DMEMSET") {void *p; int what; size_t sz; };
! struct @dmemcpy @deputy_scope() @macro("__DEPUTY_DMEMCPY") {void *dst; void *src; size_t sz; };
! 
! #define NONNULL                                @nonnull()
! #define BND(x,y)                               @bnd(x,y)
! #define BND_NOK(x,y)                           @bnd_nok(x,y)
! #define COUNT(x)                               @count(x)
! #define COUNT_NOK(x)                           @count_nok(x)
! #define ONE                                    @one()
! #define ONE_NOK                                @one_nok()
! #define DMEMSET(x,y,z)                         @dmemset(x,y,z)
! #define DMEMCPY(x,y,z)                         @dmemcpy(x,y,z)
! #define TRUSTEDBLOCK                           @unsafe()
! 
! #else // NESC < 130
  
! #ifdef SAFE_TINYOS
! #error Safe TinyOS requires nesC >= 1.3.0
! #endif
  
  #define NONNULL                                
--- 8,14 ----
  #define SINGLE
  
! #if NESC < 130 
  
! #define __DEPUTY_UNUSED__                      __attribute__((unused))
  
  #define NONNULL                                
***************
*** 49,66 ****
  #define TRUSTEDBLOCK
  
- #endif // NESC version check
- 
- #ifdef SAFE_TINYOS
- #define TCAST(__type,__expr)                   ((__type)((void * __DEPUTY_TRUSTED __DEPUTY_COPYTYPE)(__expr)))
- #define __DEPUTY_TRUSTED                       __attribute__((trusted))
- #define __DEPUTY_COPYTYPE                      __attribute__((copytype))
- #else
  #define TCAST(__type,__expr)                   ((__type)(__expr))                
- #endif 
  
  #ifdef SAFE_TINYOS
! void * (DMEMSET(1, 2, 3) memset)(void*, int, size_t);
! void * (DMEMCPY(1, 2, 3) memcpy)(void*, const void*, size_t);
  #endif
  
  #endif
--- 23,33 ----
  #define TRUSTEDBLOCK
  
  #define TCAST(__type,__expr)                   ((__type)(__expr))                
  
  #ifdef SAFE_TINYOS
! #warning Safe TinyOS requires nesC >= 1.3.0
  #endif
  
+ #endif // NESC version check
+ 
  #endif



More information about the Tinyos-2-commits mailing list