aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2008-07-19 21:54:34 +0200
committerH. Peter Anvin <hpa@zytor.com>2008-07-19 17:29:31 -0700
commit8502d91fbd68a145dd92981c0599961bcdc44e0b (patch)
treeb69ebfc04ef41a9936c462b224341f2fc0fd6c24
parentb8f5d7dededad33d163b66b9ffe183f1fc335eef (diff)
downloadsyslinux-8502d91fbd68a145dd92981c0599961bcdc44e0b.tar.gz
syslinux-8502d91fbd68a145dd92981c0599961bcdc44e0b.tar.xz
syslinux-8502d91fbd68a145dd92981c0599961bcdc44e0b.zip
ethersel: use library functions
Replace get_config() and execute() with syslinux_config_file() and syslinux_run_command(). - Sebastian
-rw-r--r--com32/modules/ethersel.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/com32/modules/ethersel.c b/com32/modules/ethersel.c
index 64c2ceb3..d200d627 100644
--- a/com32/modules/ethersel.c
+++ b/com32/modules/ethersel.c
@@ -35,6 +35,8 @@
#include <console.h>
#include <sys/pci.h>
#include <com32.h>
+#include <syslinux/boot.h>
+#include <syslinux/config.h>
#ifdef DEBUG
# define dprintf printf
@@ -42,17 +44,6 @@
# define dprintf(...) ((void)0)
#endif
-static const char *
-get_config(void)
-{
- static com32sys_t r;
-
- r.eax.w[0] = 0x000E;
- __intcall(0x22, &r, &r);
-
- return MK_PTR(r.es, r.ebx.w[0]);
-}
-
static char *
skipspace(char *p)
{
@@ -139,7 +130,7 @@ parse_config(const char *filename)
struct match *m;
if ( !filename )
- filename = get_config();
+ filename = syslinux_config_file();
f = fopen(filename, "r");
if ( !f )
@@ -198,19 +189,6 @@ parse_config(const char *filename)
return list;
}
-static void __attribute__((noreturn))
-execute(const char *cmdline)
-{
- static com32sys_t ireg;
-
- strcpy(__com32.cs_bounce, cmdline);
- ireg.eax.w[0] = 0x0003; /* Run command */
- ireg.ebx.w[0] = OFFS(__com32.cs_bounce);
- ireg.es = SEG(__com32.cs_bounce);
- __intcall(0x22, &ireg, NULL);
- exit(255); /* Shouldn't return */
-}
-
int main(int argc, char *argv[])
{
struct match *list, *match;
@@ -225,7 +203,7 @@ int main(int argc, char *argv[])
match = find_pci_device(&pci_device_list,list);
if ( match )
- execute(match->filename);
+ syslinux_run_command(match->filename);
/* On error, return to the command line */
fputs("Error: no recognized network card found!\n", stderr);