]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
safe tinyos annotations
authorregehr <regehr>
Wed, 4 Jun 2008 04:30:41 +0000 (04:30 +0000)
committerregehr <regehr>
Wed, 4 Jun 2008 04:30:41 +0000 (04:30 +0000)
tos/lib/net/6lowpan/IPP.nc
tos/lib/net/Deluge/Crc.nc
tos/lib/net/Deluge/extra/NetProgM.nc
tos/lib/net/DisseminationUpdate.nc
tos/lib/net/UARTDebugSenderP.nc
tos/lib/net/ctp/CompareBit.nc
tos/lib/net/ctp/CtpForwardingEngine.h
tos/lib/net/ctp/CtpForwardingEngineP.nc
tos/lib/net/ctp/CtpRoutingEngineP.nc
tos/lib/net/ctp/CtpRoutingPacket.nc
tos/lib/net/drip/DisseminationCache.nc

index 61a8fc705c30c398658eb7565c8fa44e3c6d4b5b..2864a7cb2881d2e41703da31d893640749f74380 100644 (file)
@@ -1653,7 +1653,7 @@ void layer3_input(uint8_t *buf, uint16_t len)
 }
 
 /* process the optional 6lowpan headers */
-void lowpan_input(uint8_t* buf, uint8_t len )
+void TRUSTEDBLOCK lowpan_input(uint8_t* buf, uint8_t len )
 {
       uint8_t *dispatch;
       struct lowpan_broadcast_hdr *bc_hdr;
@@ -1960,7 +1960,7 @@ void lowpan_input(uint8_t* buf, uint8_t len )
 }
 
 /* Receive an AM from the lower layer */
-event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len)
+event TRUSTEDBLOCK message_t* Receive.receive(message_t* msg, void* payload, uint8_t len)
 {
     am_addr_t am_addr;
     
index 31fedfd8f98c43287c729a0baf110800204abb2b..16c63ca3ae81b581f808105721edef035812ba92 100644 (file)
@@ -25,5 +25,5 @@
 \r
 interface Crc\r
 {\r
-  command uint16_t crc16(void* buf, uint8_t len);\r
+  command uint16_t crc16(void* COUNT(len) buf, uint8_t len);\r
 }\r
index 7567ad1ad809ead008d6e76de7d3f186708f90f5..e77ebeedeb4b09780359cfa6b8eb8cc0dbe91055 100644 (file)
@@ -53,7 +53,7 @@ implementation {
   command error_t Init.init()
   {
     BootArgs bootArgs;
-    call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+    call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
 
     // Update the local node ID
     if (bootArgs.address != 0xFFFF) {
@@ -71,11 +71,11 @@ implementation {
     BootArgs bootArgs;
 
     atomic {
-      call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+      call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
 
       if (bootArgs.address != TOS_NODE_ID) {
        bootArgs.address = TOS_NODE_ID;
-       call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+       call IFlash.write(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
       }
       netprog_reboot();
     }
@@ -99,14 +99,14 @@ implementation {
     }
 
     atomic {
-      call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+      call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
       
       bootArgs.imageAddr = reprogramImgAddr;
       bootArgs.gestureCount = 0xff;
       bootArgs.noReprogram = FALSE;
       bootArgs.address = TOS_NODE_ID;
 
-      call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+      call IFlash.write(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
 
       // reboot
       netprog_reboot();
index 6ea93cad1c27cc0dcdd6ed53c39928c06945577e..4a28038f6539016e4efe217b3a1abfe631996d48 100644 (file)
@@ -49,5 +49,5 @@ interface DisseminationUpdate<t> {
    * by newVal is copied out, so newVal can be reclaimed when
    * <tt>change</tt> returns.
    */
-  command void change(t* newVal);
+  command void change(t* ONE newVal);
 }
index ebce09bb6a3c9a740bfb6564e2d334e3bc011fd1..4c1185131b199fb4363ce9bbb1c535d6490de153 100644 (file)
@@ -100,7 +100,7 @@ implementation {
         }
     }
     /* Used for FE_SENT_MSG, FE_RCV_MSG, FE_FWD_MSG, FE_DST_MSG */
-    command error_t CollectionDebug.logEventMsg(uint8_t type, uint16_t msg_id, am_addr_t origin, am_addr_t node) {
+    command error_t TRUSTEDBLOCK CollectionDebug.logEventMsg(uint8_t type, uint16_t msg_id, am_addr_t origin, am_addr_t node) {
         statLogReceived++;
         if (call MessagePool.empty()) {
             return FAIL;
@@ -129,7 +129,7 @@ implementation {
         }
     }
     /* Used for TREE_NEW_PARENT, TREE_ROUTE_INFO */
-    command error_t CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t metric) {
+    command error_t TRUSTEDBLOCK CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t metric) {
         statLogReceived++;
         if (call MessagePool.empty()) {
             return FAIL;
@@ -185,7 +185,7 @@ implementation {
         }
     }
     /* Used for DBG_2, DBG_3 */
-    command error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
+    command TRUSTEDBLOCK error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
         statLogReceived++;
         if (call MessagePool.empty()) {
             return FAIL;
index baf622061f39aa1cf211edfad8c9aed28e76f18a..3f9528d794685c4e86d5f5484527c0c6726d85ae 100644 (file)
@@ -38,5 +38,5 @@
 interface CompareBit {
 
   /* should the source of this message be inserted into the neighbor table? */
-   event bool shouldInsert(message_t *msg, void* payload, uint8_t len, bool white_bit);
+   event bool shouldInsert(message_t * ONE msg, void* COUNT_NOK(len) payload, uint8_t len, bool white_bit);
 }
index ee5207de59d9b090fc5c1d01a917a273048a2c52..d0946336d65f4480d722e5729523ce8ddc6bcf92 100644 (file)
@@ -110,7 +110,7 @@ typedef nx_struct {
  * of how many times the packet has been transmitted.
  */
 typedef struct {
-  message_t *msg;
+  message_t * ONE_NOK msg;
   uint8_t client;
   uint8_t retries;
 } fe_queue_entry_t;
index f3f2c5782c7a54cf2140d9dec460d63e013bf1f7..16c1803cc4173593671f793623acb9e0360ab830 100644 (file)
@@ -220,7 +220,7 @@ implementation {
      its queue entry is pointed to by clientPtrs. */
 
   fe_queue_entry_t clientEntries[CLIENT_COUNT];
-  fe_queue_entry_t* clientPtrs[CLIENT_COUNT];
+  fe_queue_entry_t* ONE_NOK clientPtrs[CLIENT_COUNT];
 
   /* The loopback message is for when a collection roots calls
      Send.send. Since Send passes a pointer but Receive allows
@@ -229,7 +229,7 @@ implementation {
      See sendTask(). */
      
   message_t loopbackMsg;
-  message_t* loopbackMsgPtr;
+  message_t* ONE_NOK loopbackMsgPtr;
 
   command error_t Init.init() {
     int i;
@@ -642,7 +642,7 @@ implementation {
    * message in the pool, it returns the passed message and does not
    * put it on the send queue.
    */
-  message_t* forward(message_t* m) {
+  message_t* ONE forward(message_t* ONE m) {
     if (call MessagePool.empty()) {
       dbg("Route", "%s cannot forward, message pool empty.\n", __FUNCTION__);
       // send a debug message to the uart
index 120396ea75e89ffbc55ff983c5c0f618b401de2a..342f2f53d52360a21c53579416adb7a65a0bf6d4 100644 (file)
@@ -453,7 +453,7 @@ implementation {
     }
 
 
-    ctp_routing_header_t* getHeader(message_t* m) {
+    ctp_routing_header_t* getHeader(message_t* ONE m) {
       return (ctp_routing_header_t*)call BeaconSend.getPayload(m, call BeaconSend.maxPayloadLength());
     }
     
index 5fa376c4b26a3a7826af9a523617c1d94e49c024..fb5ec31dd205921139e698c6a9efafd5e1cac275 100644 (file)
 interface CtpRoutingPacket {
 
   /* Allow individual options to be read, set, and reset independently */
-  command bool          getOption(message_t* msg, ctp_options_t opt);
-  command void          setOption(message_t* msg, ctp_options_t opt);
-  command void          clearOption(message_t* msg, ctp_options_t opt);
+  command bool          getOption(message_t* ONE msg, ctp_options_t opt);
+  command void          setOption(message_t* ONE msg, ctp_options_t opt);
+  command void          clearOption(message_t* ONE msg, ctp_options_t opt);
   
   /* Clear all options */
-  command void          clearOptions(message_t* msg);
+  command void          clearOptions(message_t* ONE msg);
 
-  command am_addr_t     getParent(message_t* msg);
-  command void          setParent(message_t* msg, am_addr_t addr);
+  command am_addr_t     getParent(message_t* ONE msg);
+  command void          setParent(message_t* ONE msg, am_addr_t addr);
 
-  command uint16_t      getEtx(message_t* msg);
-  command void          setEtx(message_t* msg, uint8_t etx);
+  command uint16_t      getEtx(message_t* ONE msg);
+  command void          setEtx(message_t* ONE msg, uint8_t etx);
 }
index 290c7d1d01ab30b01d48fcde1128e67306a438f8..05c962f38fe47279ce54e3f7dcf1dafc0b0a3e47 100644 (file)
@@ -45,7 +45,7 @@ interface DisseminationCache {
   event error_t start();
   event error_t stop();
   command void* requestData( uint8_t* size );
-  command void storeData( void* data, uint8_t size, uint32_t seqno );
+  command void storeData( void* COUNT(size) data, uint8_t size, uint32_t seqno );
   command uint32_t requestSeqno();
   event void newData();
 }