summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2005-05-13 15:29:15 +0200
committerMichael Brown2005-05-13 15:29:15 +0200
commitc695c75b01c6cc99efe4ba54ebc23a9e9cdc6059 (patch)
tree591b7dbd33758b6b97ba82e2500b3e3c901d03aa
parentAdd realloc, since the load buffer code requires it. (diff)
downloadipxe-c695c75b01c6cc99efe4ba54ebc23a9e9cdc6059.tar.gz
ipxe-c695c75b01c6cc99efe4ba54ebc23a9e9cdc6059.tar.xz
ipxe-c695c75b01c6cc99efe4ba54ebc23a9e9cdc6059.zip
First version
-rw-r--r--src/include/load_buffer.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/include/load_buffer.h b/src/include/load_buffer.h
new file mode 100644
index 00000000..5aa37410
--- /dev/null
+++ b/src/include/load_buffer.h
@@ -0,0 +1,39 @@
+#ifndef LOAD_BUFFER_H
+#define LOAD_BUFFER_H
+
+#include "buffer.h"
+
+/*
+ * These functions are architecture-dependent, but the interface must
+ * be identical between architectures.
+ *
+ */
+
+/*
+ * Initialise a buffer suitable for loading an image. Pass in a
+ * pointer to an uninitialised struct buffer.
+ *
+ * Note that this function may (for example) allocate all remaining
+ * allocatable memory, so it must be called *after* any other code
+ * that might want to allocate memory (e.g. device driver
+ * initialisation).
+ *
+ */
+extern int init_load_buffer ( struct buffer *buffer );
+
+/*
+ * Cut a load buffer down to size once the image has been loaded.
+ * This will shrink the buffer down to the size of the data contained
+ * within the buffer, freeing up unused memory if applicable.
+ *
+ */
+extern void trim_load_buffer ( struct buffer *buffer );
+
+/*
+ * Finish using a load buffer, once the image has been moved into its
+ * target location in memory.
+ *
+ */
+extern void done_load_buffer ( struct buffer *buffer );
+
+#endif /* LOAD_BUFFER_H */