[syslinux:elflink] cmenu: Delete __intcall()s

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Nov 27 12:30:04 PST 2012


Commit-ID:  13bdb6b05cd0d4bb4eb853a74b71f80dc892491e
Gitweb:     http://www.syslinux.org/commit/13bdb6b05cd0d4bb4eb853a74b71f80dc892491e
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 27 Nov 2012 11:57:59 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 27 Nov 2012 11:57:59 +0000

cmenu: Delete __intcall()s

We can dynamically resolve our symbols and so we don't need to jump
through __intcall(), which is deprecated anyway in favour of dynamic
resolution.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/cmenu/libmenu/syslnx.c | 52 ++++++--------------------------------------
 1 file changed, 7 insertions(+), 45 deletions(-)

diff --git a/com32/cmenu/libmenu/syslnx.c b/com32/cmenu/libmenu/syslnx.c
index c681f58..5060c5d 100644
--- a/com32/cmenu/libmenu/syslnx.c
+++ b/com32/cmenu/libmenu/syslnx.c
@@ -19,16 +19,6 @@
 
 com32sys_t inreg, outreg;	// Global registers for this module
 
-char issyslinux(void)
-{
-    REG_EAX(inreg) = 0x00003000;
-    REG_EBX(inreg) = REG_ECX(inreg) = REG_EDX(inreg) = 0xFFFFFFFF;
-    __intcall(0x21, &inreg, &outreg);
-    return (REG_EAX(outreg) == 0x59530000) &&
-	(REG_EBX(outreg) == 0x4c530000) &&
-	(REG_ECX(outreg) == 0x4e490000) && (REG_EDX(outreg) == 0x58550000);
-}
-
 void runsyslinuxcmd(const char *cmd)
 {
     char *bounce;
@@ -60,43 +50,15 @@ unsigned int getversion(char *deriv, unsigned int *numfun)
     return __syslinux_version.version;
 }
 
-void runsyslinuximage(const char *cmd, long ipappend)
+char issyslinux(void)
 {
-    unsigned int numfun = 0;
-    char *ptr, *cmdline;
-    char *bounce;
+    return !!getversion(NULL, NULL);
+}
 
+void runsyslinuximage(const char *cmd, long ipappend)
+{
     (void)ipappend;		// XXX: Unused?!
 
-    getversion(NULL, &numfun);
-    // Function 16h not supported Fall back to runcommand
-    if (numfun < 0x16)
-	runsyslinuxcmd(cmd);
-    // Try the Run Kernel Image function
-    // Split command line into
-    bounce = lmalloc(strlen(cmd) + 1);
-    if (!bounce)
-	return;
-
-    strcpy(bounce, cmd);
-    ptr = bounce;
-    // serach for first space or end of string
-    while ((*ptr) && (*ptr != ' '))
-	ptr++;
-    if (!*ptr)
-	cmdline = ptr;		// no command line
-    else {
-	*ptr++ = '\0';		// terminate kernal name
-	cmdline = ptr + 1;
-	while (*cmdline != ' ')
-	    cmdline++;		// find first non-space
-    }
-    // Now call the interrupt
-    REG_BX(inreg) = OFFS(cmdline);
-    REG_ES(inreg) = SEG(cmdline);
-    REG_SI(inreg) = OFFS(bounce);
-    REG_DS(inreg) = SEG(bounce);
-    REG_EDX(inreg) = 0;
-
-    __intcall(0x22, &inreg, &outreg);	// If successful does not return
+    getversion(NULL, NULL);
+    runsyslinuxcmd(cmd);
 }


More information about the Syslinux-commits mailing list