[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/safe/include
annots_stage1.h, NONE, 1.1 annots_stage2.h, NONE,
1.1 deputy_annots.h, 1.4, NONE deputy_no_annots.h, 1.4,
NONE nesc_annots.h, 1.4, NONE nesc_no_annots.h, 1.1, NONE
John Regehr
regehr at users.sourceforge.net
Thu Feb 14 14:47:59 PST 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/safe/include
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31588
Added Files:
annots_stage1.h annots_stage2.h
Removed Files:
deputy_annots.h deputy_no_annots.h nesc_annots.h
nesc_no_annots.h
Log Message:
more annotation work
--- NEW FILE: annots_stage1.h ---
#if NESC >= 130
struct @bound @deputy_scope() @macro("__DEPUTY_BOUND") { void *lo, *hi; };
struct @count @deputy_scope() @macro("__DEPUTY_COUNT") { int n; };
struct @single @deputy_scope() @macro("__DEPUTY_SINGLE") { };
struct @nonnull @deputy_scope() @macro("__DEPUTY_NONNULL") { };
#define COUNT(x) @count(x)
#define BOUND(x,y) @bound(x,y)
#define SINGLE @single()
#define NONNULL @nonnull()
#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
#else // NESC < 130
#ifdef SAFE_TINYOS
#error Safe TinyOS requires nesC >= 1.3.0
#endif
#endif
--- NEW FILE: annots_stage2.h ---
#ifdef SAFE_TINYOS
#define __DEPUTY_BOUND(__lo,__hi) __attribute__((bounds((__lo),(__hi))))
#define __DEPUTY_COUNT(__n) __DEPUTY_BOUND(__this, __this + (__n))
#define __DEPUTY_SINGLE(__n) __DEPUTY_COUNT(1)
#define __DEPUTY_NONNULL(__n) __attribute__((nonnull))
#define __DEPUTY_TRUSTEDBLOCK __blockattribute__((trusted))
#else
#define __DEPUTY_BOUND(__lo,__hi)
#define __DEPUTY_COUNT(__n)
#define __DEPUTY_SINGLE(__n)
#define __DEPUTY_NONNULL(__n)
#define __DEPUTY_TRUSTEDBLOCK
#endif
--- deputy_annots.h DELETED ---
--- deputy_no_annots.h DELETED ---
--- nesc_annots.h DELETED ---
--- nesc_no_annots.h DELETED ---
More information about the Tinyos-2-commits
mailing list