summaryrefslogtreecommitdiff
path: root/com32/include/syslinux
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-07-17 12:15:16 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-07-17 18:29:16 +0100
commit787d7e568fe08d7080d2cd03cd9ee27c327eca67 (patch)
tree7364accf7bce6fc99929d4cee40067de3d2f24b3 /com32/include/syslinux
parentba638fd9bf72b0c786c88909014136cfa641a147 (diff)
downloadsyslinux-787d7e568fe08d7080d2cd03cd9ee27c327eca67.tar.gz
memscan: build a linked list of memory scanners
By registering memory scanners at runtime we can support multiple memory scanner functions, which helps us to isolate them and keep things modular, only registering them for specific platform/derivative combinations. This is preparation for adding a memory scanner that is specific to PXELINUX on bios and understands when the memory region occupied by the PXE stack can be reused. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/include/syslinux')
-rw-r--r--com32/include/syslinux/firmware.h4
-rw-r--r--com32/include/syslinux/memscan.h11
2 files changed, 11 insertions, 4 deletions
diff --git a/com32/include/syslinux/firmware.h b/com32/include/syslinux/firmware.h
index 4a43c86d..6cc06a08 100644
--- a/com32/include/syslinux/firmware.h
+++ b/com32/include/syslinux/firmware.h
@@ -1,7 +1,8 @@
#ifndef _SYSLINUX_FIRMWARE_H
#define _SYSLINUX_FIRMWARE_H
-#include <syslinux/memscan.h>
+#include <inttypes.h>
+#include <stdbool.h>
struct term_state;
@@ -42,7 +43,6 @@ struct mem_ops {
void *(*malloc)(size_t, enum heap, size_t);
void *(*realloc)(void *, size_t);
void (*free)(void *);
- int (*scan_memory)(scan_memory_callback_t, void *);
};
struct initramfs;
diff --git a/com32/include/syslinux/memscan.h b/com32/include/syslinux/memscan.h
index 7aabacba..ab78e28b 100644
--- a/com32/include/syslinux/memscan.h
+++ b/com32/include/syslinux/memscan.h
@@ -29,12 +29,19 @@
#ifndef _SYSLINUX_MEMSCAN_H
#define _SYSLINUX_MEMSCAN_H
-#include <stdbool.h>
+#include <linux/list.h>
#include <syslinux/movebits.h> /* addr_t */
typedef int (*scan_memory_callback_t) (void *, addr_t, addr_t,
enum syslinux_memmap_types type);
+
+struct syslinux_memscan {
+ int (*func)(scan_memory_callback_t callback, void *data);
+ struct list_head next;
+};
+
+void syslinux_memscan_add(struct syslinux_memscan *entry);
+int syslinux_memscan_new(int (*func)(scan_memory_callback_t cb, void *data));
int syslinux_scan_memory(scan_memory_callback_t callback, void *data);
-int bios_scan_memory(scan_memory_callback_t callback, void *data);
#endif /* _SYSLINUX_MEMSCAN_H */