aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/ring_buffer.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-04-12 00:44:05 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-04-12 00:44:05 -0400
commit2ffc87ca9b47bd605e5630a33b36f83e5e8486da (patch)
tree0bdc39f5ed970e43a8d8012632ef0658b7514338 /libmaple/ring_buffer.h
parentee1d13d27d6e6be7f9babce655f697fe7f224c77 (diff)
downloadlibrambutan-2ffc87ca9b47bd605e5630a33b36f83e5e8486da.tar.gz
librambutan-2ffc87ca9b47bd605e5630a33b36f83e5e8486da.zip
Changing usages of "volatile" to "__io".
Diffstat (limited to 'libmaple/ring_buffer.h')
-rw-r--r--libmaple/ring_buffer.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmaple/ring_buffer.h b/libmaple/ring_buffer.h
index ad6ad96..04f6499 100644
--- a/libmaple/ring_buffer.h
+++ b/libmaple/ring_buffer.h
@@ -35,6 +35,8 @@
#ifndef _RING_BUFFER_H_
#define _RING_BUFFER_H_
+#include "libmaple_types.h"
+
#ifdef __cplusplus
extern "C"{
#endif
@@ -49,7 +51,7 @@ extern "C"{
*
* One byte is left free to distinguish empty from full. */
typedef struct ring_buffer {
- volatile uint8 *buf; /**< Buffer items are stored into */
+ __io uint8 *buf; /**< Buffer items are stored into */
uint16 head; /**< Index of the next item to remove */
uint16 tail; /**< Index where the next item will get inserted */
uint16 size; /**< Buffer capacity minus one */
@@ -79,7 +81,7 @@ static inline void rb_init(ring_buffer *rb, uint16 size, uint8 *buf) {
* @param rb Buffer whose elements to count.
*/
static inline uint16 rb_full_count(ring_buffer *rb) {
- volatile ring_buffer *arb = rb;
+ __io ring_buffer *arb = rb;
int32 size = arb->tail - arb->head;
if (arb->tail < arb->head) {
size += arb->size + 1;