[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/atm128/adc AdcStreamP.nc, 1.6, 1.7

John Regehr regehr at users.sourceforge.net
Mon Jun 2 20:01:01 PDT 2008


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

Modified Files:
	AdcStreamP.nc 
Log Message:
safe tinyos annotations

Index: AdcStreamP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/adc/AdcStreamP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AdcStreamP.nc	9 Apr 2008 08:56:30 -0000	1.6
--- AdcStreamP.nc	3 Jun 2008 03:00:59 -0000	1.7
***************
*** 69,79 ****
    struct list_entry_t {
      uint16_t count;
!     struct list_entry_t *next;
    };
    struct list_entry_t *bufferQueue[NSTREAM];
!   struct list_entry_t **bufferQueueEnd[NSTREAM];
!   uint16_t *lastBuffer, lastCount;
  
!   norace uint16_t *buffer, *pos, count;
    norace uint32_t now, period;
  
--- 69,81 ----
    struct list_entry_t {
      uint16_t count;
!     struct list_entry_t * ONE_NOK next;
    };
    struct list_entry_t *bufferQueue[NSTREAM];
!   struct list_entry_t * ONE_NOK * bufferQueueEnd[NSTREAM];
!   uint16_t * ONE_NOK lastBuffer, lastCount;
  
!   norace uint16_t count;
!   norace uint16_t * COUNT_NOK(count) buffer; 
!   norace uint16_t * FAT_NOK(buffer, buffer+count) pos;
    norace uint32_t now, period;
  
***************
*** 109,113 ****
      atomic
        {
! 	struct list_entry_t *newEntry = (struct list_entry_t *)buf;
  
  	if (!bufferQueueEnd[c]) // Can't post right now.
--- 111,115 ----
      atomic
        {
! 	struct list_entry_t * ONE newEntry = TCAST(struct list_entry_t * ONE, buf);
  
  	if (!bufferQueueEnd[c]) // Can't post right now.
***************
*** 142,147 ****
  
      atomic entry = bufferQueue[c];
!     for (; entry; entry = entry->next)
!       signal ReadStream.bufferDone[c](FAIL, (uint16_t *)entry, entry->count);
  
      atomic
--- 144,151 ----
  
      atomic entry = bufferQueue[c];
!     for (; entry; entry = entry->next){
!       uint16_t tmp_count = entry->count;
!       signal ReadStream.bufferDone[c](FAIL, TCAST(uint16_t * COUNT_NOK(tmp_count),entry), entry->count);
!     }
  
      atomic
***************
*** 201,209 ****
  	else
  	  {
  	    bufferQueue[client] = entry->next;
  	    if (!bufferQueue[client])
  	      bufferQueueEnd[client] = &bufferQueue[client];
- 	    pos = buffer = (uint16_t *)entry;
  	    count = entry->count;
  	    nextAlarm();
  	  }
--- 205,215 ----
  	else
  	  {
+             uint16_t tmp_count;
  	    bufferQueue[client] = entry->next;
  	    if (!bufferQueue[client])
  	      bufferQueueEnd[client] = &bufferQueue[client];
  	    count = entry->count;
+             tmp_count = count;
+ 	    pos = buffer = TCAST(uint16_t * COUNT_NOK(tmp_count), entry);
  	    nextAlarm();
  	  }



More information about the Tinyos-2-commits mailing list