david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Make "struct buffer"s reusable between sessions.

This commit is contained in:
Michael Brown 2005-05-09 18:03:44 +00:00
parent b94def2088
commit 73429d6da1
2 changed files with 9 additions and 10 deletions

View File

@ -32,15 +32,12 @@
* Initialise a buffer * Initialise a buffer
* *
*/ */
void init_buffer ( struct buffer *buffer, physaddr_t start, size_t len ) { void init_buffer ( struct buffer *buffer ) {
buffer->start = start; char tail = 1;
buffer->end = start + len;
buffer->fill = 0;
if ( len ) { buffer->fill = 0;
char tail = 1; if ( buffer->end != buffer->start )
copy_to_phys ( start, &tail, sizeof ( tail ) ); copy_to_phys ( buffer->start, &tail, sizeof ( tail ) );
}
DBG ( "BUFFER [%x,%x) initialised\n", buffer->start, buffer->end ); DBG ( "BUFFER [%x,%x) initialised\n", buffer->start, buffer->end );
} }

View File

@ -33,10 +33,12 @@ struct buffer_free_block {
physaddr_t end; physaddr_t end;
} __attribute__ (( packed )); } __attribute__ (( packed ));
/* This must be provided by the architecture-dependent load_buffer.c */
extern struct buffer load_buffer;
/* Functions in buffer.c */ /* Functions in buffer.c */
extern void init_buffer ( struct buffer *buffer, physaddr_t start, extern void init_buffer ( struct buffer *buffer );
size_t len );
extern int fill_buffer ( struct buffer *buffer, void *data, extern int fill_buffer ( struct buffer *buffer, void *data,
off_t offset, size_t len ); off_t offset, size_t len );