[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/serial SerialActiveMessageP.nc, 1.8, 1.9 SerialDispatcherP.nc, 1.6, 1.7

John Regehr regehr at users.sourceforge.net
Tue Jun 3 20:43:55 PDT 2008


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

Modified Files:
	SerialActiveMessageP.nc SerialDispatcherP.nc 
Log Message:
safe tinyos annotations

Index: SerialActiveMessageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/serial/SerialActiveMessageP.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** SerialActiveMessageP.nc	19 Feb 2008 22:00:08 -0000	1.8
--- SerialActiveMessageP.nc	4 Jun 2008 03:43:50 -0000	1.9
***************
*** 47,52 ****
  implementation {
  
!   serial_header_t* getHeader(message_t* msg) {
!     return (serial_header_t*)(msg->data - sizeof(serial_header_t));
    }
  
--- 47,52 ----
  implementation {
  
!   serial_header_t* ONE getHeader(message_t* ONE msg) {
!     return TCAST(serial_header_t* ONE, (uint8_t*)msg + offsetof(message_t, data) - sizeof(serial_header_t));
    }
  
***************
*** 122,126 ****
      }
      else {
!       return msg->data;
      }
    }
--- 122,126 ----
      }
      else {
!       return (void * COUNT_NOK(len))msg->data;
      }
    }

Index: SerialDispatcherP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/serial/SerialDispatcherP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SerialDispatcherP.nc	13 Sep 2007 23:10:19 -0000	1.6
--- SerialDispatcherP.nc	4 Jun 2008 03:43:53 -0000	1.7
***************
*** 76,87 ****
    /* This component provides double buffering. */
    message_t messages[2];     // buffer allocation
!   message_t* messagePtrs[2] = { &messages[0], &messages[1]};
    
    // We store a separate receiveBuffer variable because indexing
    // into a pointer array can be costly, and handling interrupts
    // is time critical.
!   uint8_t* receiveBuffer = (uint8_t*)(&messages[0]);
  
!   uint8_t *sendBuffer = NULL;
    send_state_t sendState = SEND_STATE_IDLE;
    uint8_t sendLen = 0;
--- 76,87 ----
    /* This component provides double buffering. */
    message_t messages[2];     // buffer allocation
!   message_t* ONE messagePtrs[2] = { &messages[0], &messages[1]};
    
    // We store a separate receiveBuffer variable because indexing
    // into a pointer array can be costly, and handling interrupts
    // is time critical.
!   uint8_t* COUNT_NOK(sizeof(message_t)) receiveBuffer = (uint8_t* COUNT_NOK(sizeof(message_t)))(&messages[0]);
  
!   uint8_t *COUNT_NOK(sizeof(message_t)) sendBuffer = NULL;
    send_state_t sendState = SEND_STATE_IDLE;
    uint8_t sendLen = 0;
***************
*** 95,99 ****
    uart_id_t receiveTaskType = 0;
    uint8_t receiveTaskWhich;
!   message_t *receiveTaskBuf = NULL;
    uint8_t receiveTaskSize = 0;
  
--- 95,99 ----
    uart_id_t receiveTaskType = 0;
    uint8_t receiveTaskWhich;
!   message_t * ONE_NOK receiveTaskBuf = NULL;
    uint8_t receiveTaskSize = 0;
  



More information about the Tinyos-2-commits mailing list