aboutsummaryrefslogtreecommitdiffstats
path: root/core/bios.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-11-15 11:54:16 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-11-15 13:06:45 +0000
commitd87b69dccdf1a42942c277ca6b074a69b95d87c4 (patch)
tree625326f0c8ff1f32da05f962b0966fe8fd808106 /core/bios.c
parent4b0851493dce7cb5a6ada6e525da0bda6f5048dd (diff)
downloadsyslinux-d87b69dccdf1a42942c277ca6b074a69b95d87c4.tar.gz
syslinux-d87b69dccdf1a42942c277ca6b074a69b95d87c4.tar.xz
syslinux-d87b69dccdf1a42942c277ca6b074a69b95d87c4.zip
firmware: Move memory operations into firmware
Instead of littering core/mem with #ifdef SYSLINUX_EFI move memory operations into the 'firmware' structure so that they can be implemented differently for BIOS and EFI. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core/bios.c')
-rw-r--r--core/bios.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/bios.c b/core/bios.c
index 5207a5d0..5b4a8cef 100644
--- a/core/bios.c
+++ b/core/bios.c
@@ -539,9 +539,19 @@ void bios_init(void)
check_escapes();
}
+extern void *bios_malloc(size_t, enum heap, size_t);
+extern void *bios_realloc(void *, size_t);
+extern void bios_free(void *);
+
+struct mem_ops bios_mem_ops = {
+ .malloc = bios_malloc,
+ .realloc = bios_realloc,
+ .free = bios_free,
+ .scan_memory = bios_scan_memory,
+};
+
struct firmware bios_fw = {
.init = bios_init,
- .scan_memory = bios_scan_memory,
.adjust_screen = bios_adjust_screen,
.cleanup = bios_cleanup_hardware,
.disk_init = bios_disk_init,
@@ -551,6 +561,7 @@ struct firmware bios_fw = {
.get_serial_console_info = bios_get_serial_console_info,
.adv_ops = &bios_adv_ops,
.vesa = &bios_vesa_ops,
+ .mem = &bios_mem_ops,
};
void syslinux_register_bios(void)