david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/include/buffer.h

42 lines
1003 B
C
Raw Normal View History

#ifndef BUFFER_H
#define BUFFER_H
#include "stdint.h"
2005-05-19 13:54:41 +02:00
/* @file */
/**
* A buffer
*
* @c start and @c end denote the real boundaries of the buffer, and
* are physical addresses. @c fill denotes the offset to the first
* free block in the buffer. (If the buffer is full, @c fill will
* equal @c end-start.)
*
*/
struct buffer {
2005-05-19 13:54:41 +02:00
physaddr_t start; /**< Start of buffer in memory */
physaddr_t end; /**< End of buffer in memory */
off_t fill; /**< Offset to first gap in buffer */
};
2005-05-19 13:54:41 +02:00
/**
* A free block descriptor.
*
2005-05-19 13:54:41 +02:00
* See \ref buffer_int for a full description of the fields.
*
*/
struct buffer_free_block {
2005-05-19 13:54:41 +02:00
char tail; /**< Tail byte marker */
physaddr_t next_free; /**< Address of next free block */
physaddr_t end; /**< End of this block */
} __attribute__ (( packed ));
/* Functions in buffer.c */
extern void init_buffer ( struct buffer *buffer );
2005-05-17 16:34:46 +02:00
extern int fill_buffer ( struct buffer *buffer, const void *data,
off_t offset, size_t len );
#endif /* BUFFER_H */