mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-23 19:51:46 +00:00
Make "struct buffer"s reusable between sessions.
This commit is contained in:
parent
b94def2088
commit
73429d6da1
@ -32,15 +32,12 @@
|
||||
* Initialise a buffer
|
||||
*
|
||||
*/
|
||||
void init_buffer ( struct buffer *buffer, physaddr_t start, size_t len ) {
|
||||
buffer->start = start;
|
||||
buffer->end = start + len;
|
||||
buffer->fill = 0;
|
||||
void init_buffer ( struct buffer *buffer ) {
|
||||
char tail = 1;
|
||||
|
||||
if ( len ) {
|
||||
char tail = 1;
|
||||
copy_to_phys ( start, &tail, sizeof ( tail ) );
|
||||
}
|
||||
buffer->fill = 0;
|
||||
if ( buffer->end != buffer->start )
|
||||
copy_to_phys ( buffer->start, &tail, sizeof ( tail ) );
|
||||
|
||||
DBG ( "BUFFER [%x,%x) initialised\n", buffer->start, buffer->end );
|
||||
}
|
||||
|
@ -33,10 +33,12 @@ struct buffer_free_block {
|
||||
physaddr_t end;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/* This must be provided by the architecture-dependent load_buffer.c */
|
||||
extern struct buffer load_buffer;
|
||||
|
||||
/* Functions in buffer.c */
|
||||
|
||||
extern void init_buffer ( struct buffer *buffer, physaddr_t start,
|
||||
size_t len );
|
||||
extern void init_buffer ( struct buffer *buffer );
|
||||
extern int fill_buffer ( struct buffer *buffer, void *data,
|
||||
off_t offset, size_t len );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user