ipc: add fifo
This commit is contained in:
parent
f56f3842b2
commit
4ec7ff5aaa
9 changed files with 133 additions and 19 deletions
|
|
@ -4,17 +4,17 @@
|
|||
|
||||
#include <kernel/common.h>
|
||||
|
||||
struct ringbuf {
|
||||
typedef struct _ringbuf {
|
||||
char *buf;
|
||||
size_t size;
|
||||
size_t head;
|
||||
size_t tail;
|
||||
};
|
||||
} ringbuf_t;
|
||||
|
||||
struct ringbuf *ringbuf_create(size_t size);
|
||||
void ringbuf_destroy(struct ringbuf *rb);
|
||||
ringbuf_t *ringbuf_create(size_t size);
|
||||
void ringbuf_destroy(ringbuf_t *rb);
|
||||
|
||||
size_t ringbuf_write(struct ringbuf *rb, const char *buf, size_t count);
|
||||
size_t ringbuf_read(struct ringbuf *rb, char *buf, size_t count);
|
||||
size_t ringbuf_write(ringbuf_t *rb, const char *buf, size_t count);
|
||||
size_t ringbuf_read(ringbuf_t *rb, char *buf, size_t count);
|
||||
|
||||
#endif /* _RINGBUF_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue