aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-01-26 12:57:11 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-02-02 16:11:32 +0000
commit13aff40f7b7a9644568c6144c3893c77d62492bd (patch)
tree994dd0a0e904859659e5cfebfe6a2e9d301729e8 /core
parentedcfbdfdfcdcc62a46c8d4be50434486b0f6c0f7 (diff)
downloadsyslinux-13aff40f7b7a9644568c6144c3893c77d62492bd.tar.gz
syslinux-13aff40f7b7a9644568c6144c3893c77d62492bd.tar.xz
syslinux-13aff40f7b7a9644568c6144c3893c77d62492bd.zip
firmware: Move firmware code into core/bios.c
The EFI application really shouldn't be including code for the BIOS firmware implementation, so move it to core/bios.c and explicitly ignore core/bios.o when building the EFI application. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core')
-rw-r--r--core/bios.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/core/bios.c b/core/bios.c
new file mode 100644
index 00000000..6aaf8c49
--- /dev/null
+++ b/core/bios.c
@@ -0,0 +1,57 @@
+#include <sys/io.h>
+#include <fs.h>
+#include <bios.h>
+#include <syslinux/memscan.h>
+#include <syslinux/firmware.h>
+
+struct firmware *firmware = NULL;
+
+extern struct ansi_ops bios_ansi_ops;
+
+extern void bios_erase(int, int, int, int, uint8_t);
+extern void bios_write_char(uint8_t, uint8_t);
+extern void bios_showcursor(uint16_t);
+extern void bios_scroll_up(uint8_t, uint8_t, uint8_t);
+extern void bios_set_cursor(int, int, bool);
+extern void bios_beep(void);
+extern void bios_set_mode(uint16_t mode);
+extern void bios_get_mode(int *rows, int *cols);
+extern void bios_get_cursor(int *x, int *y);
+
+struct output_ops bios_output_ops = {
+ .erase = bios_erase,
+ .write_char = bios_write_char,
+ .showcursor = bios_showcursor,
+ .set_cursor = bios_set_cursor,
+ .scroll_up = bios_scroll_up,
+ .beep = bios_beep,
+ .get_mode = bios_get_mode,
+ .set_mode = bios_set_mode,
+ .get_cursor = bios_get_cursor,
+};
+
+extern char bios_getchar(void);
+
+struct input_ops bios_input_ops = {
+ .getchar = bios_getchar,
+};
+
+extern char *bios_get_config_file_name(void);
+extern void bios_get_serial_console_info(uint16_t *, uint16_t *, uint16_t *);
+
+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,
+ .o_ops = &bios_output_ops,
+ .i_ops = &bios_input_ops,
+ .get_config_file_name = bios_get_config_file_name,
+ .get_serial_console_info = bios_get_serial_console_info,
+};
+
+void syslinux_register_bios(void)
+{
+ firmware = &bios_fw;
+}