diff options
author | Chandramouli Narayanan <chandramouli.narayanan@intel.com> | 2012-02-02 15:19:17 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-02-02 16:13:12 +0000 |
commit | e5b9b7e91515ecf01fa4d6df06e6408ec48da0d2 (patch) | |
tree | 00571db8f413719a7c5ee4823ead495aedb57483 /core/bios.c | |
parent | 98bf45127946c563b08c847591b583e86c89ecc0 (diff) | |
download | syslinux-e5b9b7e91515ecf01fa4d6df06e6408ec48da0d2.tar.gz syslinux-e5b9b7e91515ecf01fa4d6df06e6408ec48da0d2.tar.xz syslinux-e5b9b7e91515ecf01fa4d6df06e6408ec48da0d2.zip |
efi: Add Auxiliary Data Vector support
Including deleting some ADV code that found its way into core/elflink.
Also, move the __syslinux_adv_ptr and __syslinux_adv_size symbols out
of ldlinux.c32 and into the core. Normally we don't want to move
symbols into the core (as it increases the size), but we do in this
case because the values for these symbols are firmware dependent.
Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core/bios.c')
-rw-r--r-- | core/bios.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/bios.c b/core/bios.c index 8725edad..447268d6 100644 --- a/core/bios.c +++ b/core/bios.c @@ -63,6 +63,36 @@ bool bios_ipappend_strings(char **list, int *count) extern char *bios_get_config_file_name(void); extern void bios_get_serial_console_info(uint16_t *, uint16_t *, uint16_t *); +void *__syslinux_adv_ptr; +size_t __syslinux_adv_size; + +void bios_adv_init(void) +{ + static com32sys_t reg; + + reg.eax.w[0] = 0x0025; + __intcall(0x22, ®, ®); + + reg.eax.w[0] = 0x001c; + __intcall(0x22, ®, ®); + __syslinux_adv_ptr = MK_PTR(reg.es, reg.ebx.w[0]); + __syslinux_adv_size = reg.ecx.w[0]; +} + +int bios_adv_write(void) +{ + static com32sys_t reg; + + reg.eax.w[0] = 0x001d; + __intcall(0x22, ®, ®); + return (reg.eflags.l & EFLAGS_CF) ? -1 : 0; +} + +struct adv_ops bios_adv_ops = { + .init = bios_adv_init, + .write = bios_adv_write, +}; + struct firmware bios_fw = { .init = bios_init, .scan_memory = bios_scan_memory, @@ -74,6 +104,7 @@ struct firmware bios_fw = { .ipappend_strings = bios_ipappend_strings, .get_config_file_name = bios_get_config_file_name, .get_serial_console_info = bios_get_serial_console_info, + .adv_ops = &bios_adv_ops, }; void syslinux_register_bios(void) |