diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-07-12 13:34:06 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-07-20 10:20:19 +0100 |
commit | f0bbf9dd40f37f8c4870a33784996efd56955a75 (patch) | |
tree | 2a50425df977a28bee4304437daf008a93893624 /com32/modules | |
parent | 8486142cf30499e1d53d7faf3a168c8ed3163ab2 (diff) | |
download | syslinux-f0bbf9dd40f37f8c4870a33784996efd56955a75.tar.gz |
Use pxe_call() instead of COMBOOT API
This involved some other changes, such as passing flags to
unload_pxe() now that we only call it from C code, and hence don't
need to update KeepPXE.
We also needed to move some of the pxe function prototypes to
com32/include/syslinux/pxe_api.h because they are now referenced
outside of the core.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/modules')
-rw-r--r-- | com32/modules/gpxecmd.c | 11 | ||||
-rw-r--r-- | com32/modules/pxechn.c | 16 | ||||
-rw-r--r-- | com32/modules/sanboot.c | 11 |
3 files changed, 4 insertions, 34 deletions
diff --git a/com32/modules/gpxecmd.c b/com32/modules/gpxecmd.c index 9d4f4561..d2d90a2f 100644 --- a/com32/modules/gpxecmd.c +++ b/com32/modules/gpxecmd.c @@ -39,9 +39,6 @@ static void gpxecmd(const char **args) { char *q; struct s_PXENV_FILE_EXEC *fx; - com32sys_t reg; - - memset(®, 0, sizeof reg); fx = lmalloc(sizeof *fx); if (!fx) @@ -60,13 +57,7 @@ static void gpxecmd(const char **args) } *--q = '\0'; - memset(®, 0, sizeof reg); - reg.eax.w[0] = 0x0009; - reg.ebx.w[0] = PXENV_FILE_EXEC; - reg.edi.w[0] = OFFS(fx); - reg.es = SEG(fx); - - __intcall(0x22, ®, ®); + pxe_call(PXENV_FILE_EXEC, fx); /* This should not return... */ } diff --git a/com32/modules/pxechn.c b/com32/modules/pxechn.c index 1902d4ef..39ac72ea 100644 --- a/com32/modules/pxechn.c +++ b/com32/modules/pxechn.c @@ -845,7 +845,6 @@ int pxechn_args(int argc, char *argv[], struct pxelinux_opt *pxe) */ int dhcp_pkt2pxe(pxe_bootp_t *p, size_t len, int ptype) { - com32sys_t reg; t_PXENV_GET_CACHED_INFO *ci; void *cp; int rv = -1; @@ -857,12 +856,7 @@ int dhcp_pkt2pxe(pxe_bootp_t *p, size_t len, int ptype) } ci->Status = PXENV_STATUS_FAILURE; ci->PacketType = ptype; - memset(®, 0, sizeof(reg)); - reg.eax.w[0] = 0x0009; - reg.ebx.w[0] = PXENV_GET_CACHED_INFO; - reg.edi.w[0] = OFFS(ci); - reg.es = SEG(ci); - __intcall(0x22, ®, ®); + pxe_call(PXENV_GET_CACHED_INFO, ci); if (ci->Status != PXENV_STATUS_SUCCESS) { dprintf("PXE Get Cached Info failed: %d\n", ci->Status); @@ -1015,7 +1009,6 @@ int pxe_restart(char *ifn) { int rv = 0; struct pxelinux_opt pxe; - com32sys_t reg; t_PXENV_RESTART_TFTP *pxep; /* PXENV callback Parameter */ pxe.fn = ifn; @@ -1030,7 +1023,6 @@ int pxe_restart(char *ifn) goto ret; } printf(" Attempting to boot '%s'...\n\n", pxe.fn); - memset(®, 0, sizeof reg); if (!(pxep = lzalloc(sizeof(t_PXENV_RESTART_TFTP)))){ dprintf("Unable to lzalloc() for PXE call structure\n"); goto ret; @@ -1044,12 +1036,8 @@ int pxe_restart(char *ifn) pxep->ServerIPAddress, (unsigned int)pxep, pxep->BufferSize, (unsigned int)pxep->Buffer); dprintf("PXENV_RESTART_TFTP status %d\n", pxep->Status); - reg.eax.w[0] = 0x0009; - reg.ebx.w[0] = PXENV_RESTART_TFTP; - reg.edi.w[0] = OFFS(pxep); - reg.es = SEG(pxep); - __intcall(0x22, ®, ®); + pxe_call(PXENV_RESTART_TFTP, pxep); printf("PXENV_RESTART_TFTP returned %d\n", pxep->Status); lfree(pxep); diff --git a/com32/modules/sanboot.c b/com32/modules/sanboot.c index d55fbc08..ff55f68e 100644 --- a/com32/modules/sanboot.c +++ b/com32/modules/sanboot.c @@ -39,9 +39,6 @@ static void sanboot(const char **args) { char *q; struct s_PXENV_FILE_EXEC *fx; - com32sys_t reg; - - memset(®, 0, sizeof reg); fx = lmalloc(sizeof *fx); if (!fx) @@ -61,13 +58,7 @@ static void sanboot(const char **args) args++; } - memset(®, 0, sizeof reg); - reg.eax.w[0] = 0x0009; - reg.ebx.w[0] = PXENV_FILE_EXEC; - reg.edi.w[0] = OFFS(fx); - reg.es = SEG(fx); - - __intcall(0x22, ®, ®); + pxe_call(PXENV_FILE_EXEC, fx); /* This should not return... */ } |