[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/at45db At45db.nc, 1.4, 1.5 At45dbP.nc, 1.5, 1.6 BlockStorageP.nc, 1.4, 1.5 HplAt45db.nc, 1.2, 1.3 HplAt45dbByteC.nc, 1.4, 1.5

John Regehr regehr at users.sourceforge.net
Sat May 31 21:24:38 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20529

Modified Files:
	At45db.nc At45dbP.nc BlockStorageP.nc HplAt45db.nc 
	HplAt45dbByteC.nc 
Log Message:
add safe tinyos annotations

Index: At45db.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/At45db.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** At45db.nc	12 Dec 2006 18:23:02 -0000	1.4
--- At45db.nc	1 Jun 2008 04:24:33 -0000	1.5
***************
*** 61,65 ****
     */
    command void write(at45page_t page, at45pageoffset_t offset,
! 		     void *PASS data, at45pageoffset_t n);
    /**
     * Signal completion of a write operation. The buffer passed to write
--- 61,65 ----
     */
    command void write(at45page_t page, at45pageoffset_t offset,
! 		     void *PASS COUNT(n) data, at45pageoffset_t n);
    /**
     * Signal completion of a write operation. The buffer passed to write
***************
*** 154,158 ****
     */
    command void read(at45page_t page, at45pageoffset_t offset,
! 		    void *PASS data, at45pageoffset_t n);
    /**
     * Signal completion of a read operation. The buffer passed to read
--- 154,158 ----
     */
    command void read(at45page_t page, at45pageoffset_t offset,
! 		    void *PASS COUNT(n) data, at45pageoffset_t n);
    /**
     * Signal completion of a read operation. The buffer passed to read

Index: At45dbP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/At45dbP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** At45dbP.nc	24 Dec 2007 06:45:23 -0000	1.5
--- At45dbP.nc	1 Jun 2008 04:24:33 -0000	1.6
***************
*** 81,86 ****
    };
    uint8_t request;
-   uint8_t *reqBuf;
    at45pageoffset_t reqOffset, reqBytes;
    at45page_t reqPage;
  
--- 81,86 ----
    };
    uint8_t request;
    at45pageoffset_t reqOffset, reqBytes;
+   uint8_t * COUNT_NOK(reqBytes) reqBuf;
    at45page_t reqPage;
  
***************
*** 365,369 ****
  
    void newRequest(uint8_t req, at45page_t page, at45pageoffset_t offset,
! 		  void *reqdata, at45pageoffset_t n) {
      request = req;
  
--- 365,369 ----
  
    void newRequest(uint8_t req, at45page_t page, at45pageoffset_t offset,
! 		  void * COUNT_NOK(n) reqdata, at45pageoffset_t n) {
      request = req;
  
***************
*** 399,403 ****
  					uint16_t baseCrc) {
      /* This is a hack (store crc in reqBuf), but it saves 2 bytes of RAM */
!     reqBuf = (uint8_t *)baseCrc;
      newRequest(R_READCRC, page, offset, reqBuf, n);
    }
--- 399,403 ----
  					uint16_t baseCrc) {
      /* This is a hack (store crc in reqBuf), but it saves 2 bytes of RAM */
!     reqBuf = TCAST(uint8_t * COUNT(baseCrc), baseCrc);
      newRequest(R_READCRC, page, offset, reqBuf, n);
    }

Index: BlockStorageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/BlockStorageP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** BlockStorageP.nc	12 Dec 2006 18:23:02 -0000	1.4
--- BlockStorageP.nc	1 Jun 2008 04:24:33 -0000	1.5
***************
*** 94,98 ****
      /* The latest request made for this client, and it's arguments */
      uint8_t request; /* automatically initialised to R_IDLE */
!     uint8_t *buf;
      storage_addr_t addr;
      storage_len_t len;
--- 94,98 ----
      /* The latest request made for this client, and it's arguments */
      uint8_t request; /* automatically initialised to R_IDLE */
!     uint8_t * COUNT_NOK(len) buf;
      storage_addr_t addr;
      storage_len_t len;
***************
*** 180,184 ****
  
    error_t newRequest(uint8_t newState, uint8_t id,
! 		       storage_addr_t addr, uint8_t* buf, storage_len_t len) {
      storage_len_t vsize;
  
--- 180,184 ----
  
    error_t newRequest(uint8_t newState, uint8_t id,
! 		       storage_addr_t addr, uint8_t* COUNT_NOK(len) buf, storage_len_t len) {
      storage_len_t vsize;
  
***************
*** 337,341 ****
  
    command error_t BlockRead.computeCrc[uint8_t id](storage_addr_t addr, storage_len_t len, uint16_t basecrc) {
!     return newRequest(R_CRC, id, addr, (void *)basecrc, len);
    }
  
--- 337,341 ----
  
    command error_t BlockRead.computeCrc[uint8_t id](storage_addr_t addr, storage_len_t len, uint16_t basecrc) {
!     return newRequest(R_CRC, id, addr, TCAST(void * COUNT(len),basecrc), len);
    }
  

Index: HplAt45db.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/HplAt45db.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HplAt45db.nc	12 Jul 2006 17:01:04 -0000	1.2
--- HplAt45db.nc	1 Jun 2008 04:24:33 -0000	1.3
***************
*** 118,122 ****
     */
    command void readBuffer(uint8_t cmd, at45pageoffset_t offset,
! 		    uint8_t *PASS data, uint16_t n);
  
    /**
--- 118,122 ----
     */
    command void readBuffer(uint8_t cmd, at45pageoffset_t offset,
!   		    uint8_t *PASS COUNT_NOK(n) data, uint16_t n);
  
    /**
***************
*** 133,137 ****
     */
    command void read(uint8_t cmd, at45page_t page, at45pageoffset_t offset,
! 		    uint8_t *PASS data, at45pageoffset_t n);
  
    /**
--- 133,137 ----
     */
    command void read(uint8_t cmd, at45page_t page, at45pageoffset_t offset,
!   		    uint8_t *PASS COUNT_NOK(n) data, at45pageoffset_t n);
  
    /**
***************
*** 177,181 ****
     */
    command void write(uint8_t cmd, at45page_t page, at45pageoffset_t offset,
! 		     uint8_t *PASS data, at45pageoffset_t n);
  
    /**
--- 177,181 ----
     */
    command void write(uint8_t cmd, at45page_t page, at45pageoffset_t offset,
!   		     uint8_t *PASS COUNT_NOK(n) data, at45pageoffset_t n);
  
    /**

Index: HplAt45dbByteC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/HplAt45dbByteC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** HplAt45dbByteC.nc	7 Nov 2006 19:30:43 -0000	1.4
--- HplAt45dbByteC.nc	1 Jun 2008 04:24:33 -0000	1.5
***************
*** 49,54 ****
    uint8_t status = P_IDLE;
    uint8_t flashCmd[4];
-   uint8_t *data;
    at45pageoffset_t dataCount;
    uint8_t dontCare;
  
--- 49,54 ----
    uint8_t status = P_IDLE;
    uint8_t flashCmd[4];
    at45pageoffset_t dataCount;
+   uint8_t * COUNT_NOK(dataCount) data;
    uint8_t dontCare;
  
***************
*** 173,177 ****
    void execCommand(uint8_t op, uint8_t reqCmd, uint8_t reqDontCare,
  		   at45page_t reqPage, at45pageoffset_t reqOffset,
! 		   uint8_t *reqData, at45pageoffset_t reqCount) {
      status = op;
  
--- 173,177 ----
    void execCommand(uint8_t op, uint8_t reqCmd, uint8_t reqDontCare,
  		   at45page_t reqPage, at45pageoffset_t reqOffset,
! 		   uint8_t * COUNT_NOK(reqCount) reqData, at45pageoffset_t reqCount) {
      status = op;
  
***************
*** 245,249 ****
  			     at45pageoffset_t count,
  			     uint16_t baseCrc) {
!     execCommand(P_READ_CRC, cmd, 2, page, offset, (uint8_t *)baseCrc, count);
    }
  
--- 245,249 ----
  			     at45pageoffset_t count,
  			     uint16_t baseCrc) {
!     execCommand(P_READ_CRC, cmd, 2, page, offset, TCAST(uint8_t * COUNT(count), baseCrc), count);
    }
  



More information about the Tinyos-2-commits mailing list