diff options
| author | Michael Brown | 2007-01-11 04:50:47 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-01-11 04:50:47 +0100 |
| commit | e2dcd05b67c606e97f1d570123ba7510cc41bd16 (patch) | |
| tree | f6cecbbeebc6079df8af0fe3fd1adf432b80faa6 /src/arch | |
| parent | Move include/buffer.h to include/gpxe/buffer.h (diff) | |
| download | ipxe-e2dcd05b67c606e97f1d570123ba7510cc41bd16.tar.gz ipxe-e2dcd05b67c606e97f1d570123ba7510cc41bd16.tar.xz ipxe-e2dcd05b67c606e97f1d570123ba7510cc41bd16.zip | |
Update buffer-handling code to enable expandable buffers.
Diffstat (limited to 'src/arch')
| -rw-r--r-- | src/arch/i386/core/load_buffer.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/arch/i386/core/load_buffer.c b/src/arch/i386/core/load_buffer.c deleted file mode 100644 index 3e34d2b53..000000000 --- a/src/arch/i386/core/load_buffer.c +++ /dev/null @@ -1,69 +0,0 @@ -#include "io.h" -#include "load_buffer.h" - -/* - * Initialise a buffer in an unused portion of memory, to be used for - * loading an image - * - */ - -#ifdef KEEP_IT_REAL - -/* - * Under KEEP_IT_REAL, always use 07c0:0000 as the load buffer. - * - */ - -int init_load_buffer ( struct buffer *buffer ) { - buffer->start = 0x7c00; - buffer->end = 0xa0000; - DBG ( "LOAD_BUFFER using [%x,%x)\n", buffer->start, buffer->end ); - init_buffer ( buffer ); - return 1; -} - -void trim_load_buffer ( struct buffer *buffer ) { - /* Nothing to do */ -} - -void done_load_buffer ( struct buffer *buffer ) { - /* Nothing to do */ -} - -#else /* KEEP_IT_REAL */ - -/* - * Without KEEP_IT_REAL, use all remaining heap space as the load buffer. - * - */ -int init_load_buffer ( struct buffer *buffer ) { - void *data; - size_t size; - - data = emalloc_all ( &size ); - if ( ! data ) - return 0; - - buffer->start = virt_to_phys ( data ); - buffer->end = buffer->start + size; - DBG ( "LOAD_BUFFER using [%x,%x)\n", buffer->start, buffer->end ); - init_buffer ( buffer ); - return 1; -} - -void trim_load_buffer ( struct buffer *buffer ) { - void *new_start; - - /* Shrink buffer */ - new_start = erealloc ( phys_to_virt ( buffer->start ), buffer->fill ); - DBG ( "LOAD_BUFFER shrunk from [%x,%x) to [%x,%x)\n", buffer->start, - buffer->end, virt_to_phys ( new_start ), buffer->end ); - buffer->start = virt_to_phys ( new_start ); -} - -void done_load_buffer ( struct buffer *buffer ) { - efree ( phys_to_virt ( buffer->start ) ); - DBG ( "LOAD_BUFFER freed [%x,%x)\n", buffer->start, buffer->end ); -} - -#endif |
