diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2012-05-28 00:31:59 -0300 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2012-05-28 00:46:57 -0300 |
commit | 6bf0c8bef0d3562e7eb4bc8bbc16ccc16f191a31 (patch) | |
tree | 495494b6c4ee15dc6b25d9e5c2a428a261453e9b | |
parent | 4fc3fd1e14f4c1b9208ef262e5b6aef853e9fce4 (diff) | |
download | syslinux-6bf0c8bef0d3562e7eb4bc8bbc16ccc16f191a31.tar.gz syslinux-6bf0c8bef0d3562e7eb4bc8bbc16ccc16f191a31.tar.xz syslinux-6bf0c8bef0d3562e7eb4bc8bbc16ccc16f191a31.zip |
localboot: remove unnecessary real-mode call
syslinux_local_boot() used to call local_boot() from INT 0x22
(AX=0x0014) as it should just call local_boot() function.
The local_boot() function is now exported by core/include/localboot.h to
be used in COM32 library space so that syslinux_local_boot() can use it.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | com32/elflink/ldlinux/execute.c | 6 | ||||
-rw-r--r-- | com32/include/syslinux/boot.h | 2 | ||||
-rw-r--r-- | com32/lib/syslinux/localboot.c | 10 | ||||
-rw-r--r-- | core/include/localboot.h | 33 |
4 files changed, 39 insertions, 12 deletions
diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c index afe999e2..e22c999b 100644 --- a/com32/elflink/ldlinux/execute.c +++ b/com32/elflink/ldlinux/execute.c @@ -21,6 +21,7 @@ #include "menu.h" #include "fs.h" #include "config.h" +#include "localboot.h" /* Must match enum kernel_type */ const char *const kernel_types[] = { @@ -99,10 +100,7 @@ void execute(const char *cmdline, enum kernel_type type) start_ldlinux(argv); } else if (type == KT_LOCALBOOT) { - /* process the image need int 22 support */ - ireg.eax.w[0] = 0x0014; /* Local boot */ - ireg.edx.w[0] = strtoul(kernel, NULL, 0); - __intcall(0x22, &ireg, NULL); + local_boot(strtoul(kernel, NULL, 0)); } else { /* Need add one item for kernel load, as we don't use * the assembly runkernel.inc any more */ diff --git a/com32/include/syslinux/boot.h b/com32/include/syslinux/boot.h index 21bea01a..870cff3f 100644 --- a/com32/include/syslinux/boot.h +++ b/com32/include/syslinux/boot.h @@ -40,7 +40,7 @@ int syslinux_run_command(const char *); __noreturn syslinux_run_default(void); -void syslinux_local_boot(uint16_t flags); +void syslinux_local_boot(int16_t flags); void syslinux_final_cleanup(uint16_t flags); diff --git a/com32/lib/syslinux/localboot.c b/com32/lib/syslinux/localboot.c index 3b480c71..16016a9d 100644 --- a/com32/lib/syslinux/localboot.c +++ b/com32/lib/syslinux/localboot.c @@ -28,15 +28,11 @@ #include <syslinux/boot.h> #include <stddef.h> #include <com32.h> +#include <localboot.h> /* This returns only on failure */ -void syslinux_local_boot(uint16_t flags) +void syslinux_local_boot(int16_t flags) { - static com32sys_t ireg; - - ireg.eax.w[0] = 0x0014; - ireg.edx.w[0] = flags; - - __intcall(0x22, &ireg, NULL); + local_boot(flags); } diff --git a/core/include/localboot.h b/core/include/localboot.h new file mode 100644 index 00000000..4bb79a6a --- /dev/null +++ b/core/include/localboot.h @@ -0,0 +1,33 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2012 Paulo Alcantara <pcacjr@zytor.com> + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall + * be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * ----------------------------------------------------------------------- */ + +#ifndef LOCALBOOT_H_ +#define LOCALBOOT_H_ + +extern void local_boot(int16_t ax); + +#endif /* LOCALBOOT_H_ */ |