diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/file.h | 3 | ||||
| -rw-r--r-- | fs/ringbuffer.c | 12 |
2 files changed, 6 insertions, 9 deletions
@@ -5,10 +5,7 @@ typedef struct file_struct { - int fgetc(); - int fputc(); - void *opaque; }file; diff --git a/fs/ringbuffer.c b/fs/ringbuffer.c index ca5870f..449ad88 100644 --- a/fs/ringbuffer.c +++ b/fs/ringbuffer.c @@ -1,13 +1,13 @@ -#define FOOLOS_MODULE_NAME "fifo" +#define FOOLOS_MODULE_NAME "ringbuffer" #include "lib/logger/log.h" -#include "fifo.h" +#include "ringbuffer.h" static int sl=9; -fifo fifo_init(uint32_t size) +ringbuffer ringbuffer_init(uint32_t size) { - fifo f; + ringbuffer f; f.data=kballoc(size); f.size=size*4096; f.front=f.size-1; @@ -15,7 +15,7 @@ fifo fifo_init(uint32_t size) return f; } -bool fifo_put(fifo* f,uint8_t c) +bool ringbuffer_put(ringbuffer* f,uint8_t c) { x86_int_disable(); lock_spin(sl); @@ -40,7 +40,7 @@ bool fifo_put(fifo* f,uint8_t c) return true; } -uint8_t fifo_get(fifo* f) // blocking +uint8_t ringbuffer_get(ringbuffer* f) // blocking { char c; |
