diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/buffer.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/include/buffer.h b/src/include/buffer.h index 7ed57fa2b..b0de39df3 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -4,6 +4,18 @@ #include "stdint.h" /* + * "start" and "end" denote the real boundaries of the buffer. "fill" + * denotes the offset to the first free block in the buffer. (If the + * buffer is full, "fill" will equal ( end - start ) ). + * + */ +struct buffer { + physaddr_t start; + physaddr_t end; + off_t fill; +}; + +/* * Free blocks in the buffer start with a "tail byte". If non-zero, * this byte indicates that the free block is the tail of the buffer, * i.e. occupies all the remaining space up to the end of the buffer. @@ -15,24 +27,17 @@ * smaller than a struct buffer_free_block. * */ - struct buffer_free_block { char tail; physaddr_t next_free; physaddr_t end; } __attribute__ (( packed )); -struct buffer { - physaddr_t start; - physaddr_t end; - physaddr_t first_free; -}; - /* Functions in buffer.c */ extern void init_buffer ( struct buffer *buffer, physaddr_t start, size_t len ); -extern off_t fill_buffer ( struct buffer *buffer, void *data, - off_t offset, size_t len ); +extern int fill_buffer ( struct buffer *buffer, void *data, + off_t offset, size_t len ); #endif /* BUFFER_H */ |
