From 8502d91fbd68a145dd92981c0599961bcdc44e0b Mon Sep 17 00:00:00 2001 From: Sebastian Herbszt Date: Sat, 19 Jul 2008 21:54:34 +0200 Subject: ethersel: use library functions Replace get_config() and execute() with syslinux_config_file() and syslinux_run_command(). - Sebastian --- com32/modules/ethersel.c | 30 ++++-------------------------- 1 file 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 #include #include +#include +#include #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); -- cgit v1.2.1