From 17f623fff9262336a8b1bc6f62e2035b5708be78 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Nov 2008 20:05:31 +0000 Subject: Some structure elements should be marked volatile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1222 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/nuttx/serial.h | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'nuttx') diff --git a/nuttx/include/nuttx/serial.h b/nuttx/include/nuttx/serial.h index c2a7a875f..9954c16c0 100644 --- a/nuttx/include/nuttx/serial.h +++ b/nuttx/include/nuttx/serial.h @@ -74,11 +74,11 @@ struct uart_buffer_s { - sem_t sem; /* Used to control exclusive access to the buffer */ - sint16 head; /* Index to the head [IN] index in the buffer */ - sint16 tail; /* Index to the tail [OUT] index in the buffer */ - sint16 size; /* The allocated size of the buffer */ - FAR char *buffer; /* Pointer to the allocated buffer memory */ + sem_t sem; /* Used to control exclusive access to the buffer */ + volatile sint16 head; /* Index to the head [IN] index in the buffer */ + volatile sint16 tail; /* Index to the tail [OUT] index in the buffer */ + sint16 size; /* The allocated size of the buffer */ + FAR char *buffer; /* Pointer to the allocated buffer memory */ }; /* This structure defines all of the operations providd by the architecture specific @@ -179,23 +179,17 @@ struct uart_ops_s struct uart_dev_s { - ubyte open_count; /* The number of times - * the device has been opened */ - boolean xmitwaiting; /* TRUE: User is waiting - * for space in xmit.buffer */ - boolean recvwaiting; /* TRUE: User is waiting - * for space in recv.buffer */ - boolean isconsole; /* TRUE: This is the serial console */ - sem_t closesem; /* Locks out new opens while - * close is in progress */ - sem_t xmitsem; /* Used to wakeup user waiting - * for space in xmit.buffer */ - sem_t recvsem; /* Used to wakeup user waiting - * for sapce in recv.buffer */ - struct uart_buffer_s xmit; /* Describes transmit buffer */ - struct uart_buffer_s recv; /* Describes receive buffer */ - FAR const struct uart_ops_s *ops; /* Arch-specific operations */ - FAR void *priv; /* Used by the arch-specific logic */ + ubyte open_count; /* Number of times the device has been opened */ + volatile boolean xmitwaiting; /* TRUE: User waiting for space in xmit.buffer */ + volatile boolean recvwaiting; /* TRUE: User waiting for data in recv.buffer */ + boolean isconsole; /* TRUE: This is the serial console */ + sem_t closesem; /* Locks out new open while close is in progress */ + sem_t xmitsem; /* Wakeup user waiting for space in xmit.buffer */ + sem_t recvsem; /* Wakeup user waiting for data in recv.buffer */ + struct uart_buffer_s xmit; /* Describes transmit buffer */ + struct uart_buffer_s recv; /* Describes receive buffer */ + FAR const struct uart_ops_s *ops; /* Arch-specific operations */ + FAR void *priv; /* Used by the arch-specific logic */ }; typedef struct uart_dev_s uart_dev_t; -- cgit v1.2.3