|
@@ -0,0 +1,39 @@
|
|
1
|
+#ifndef LOAD_BUFFER_H
|
|
2
|
+#define LOAD_BUFFER_H
|
|
3
|
+
|
|
4
|
+#include "buffer.h"
|
|
5
|
+
|
|
6
|
+/*
|
|
7
|
+ * These functions are architecture-dependent, but the interface must
|
|
8
|
+ * be identical between architectures.
|
|
9
|
+ *
|
|
10
|
+ */
|
|
11
|
+
|
|
12
|
+/*
|
|
13
|
+ * Initialise a buffer suitable for loading an image. Pass in a
|
|
14
|
+ * pointer to an uninitialised struct buffer.
|
|
15
|
+ *
|
|
16
|
+ * Note that this function may (for example) allocate all remaining
|
|
17
|
+ * allocatable memory, so it must be called *after* any other code
|
|
18
|
+ * that might want to allocate memory (e.g. device driver
|
|
19
|
+ * initialisation).
|
|
20
|
+ *
|
|
21
|
+ */
|
|
22
|
+extern int init_load_buffer ( struct buffer *buffer );
|
|
23
|
+
|
|
24
|
+/*
|
|
25
|
+ * Cut a load buffer down to size once the image has been loaded.
|
|
26
|
+ * This will shrink the buffer down to the size of the data contained
|
|
27
|
+ * within the buffer, freeing up unused memory if applicable.
|
|
28
|
+ *
|
|
29
|
+ */
|
|
30
|
+extern void trim_load_buffer ( struct buffer *buffer );
|
|
31
|
+
|
|
32
|
+/*
|
|
33
|
+ * Finish using a load buffer, once the image has been moved into its
|
|
34
|
+ * target location in memory.
|
|
35
|
+ *
|
|
36
|
+ */
|
|
37
|
+extern void done_load_buffer ( struct buffer *buffer );
|
|
38
|
+
|
|
39
|
+#endif /* LOAD_BUFFER_H */
|