diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2010-02-24 14:18:49 -0800 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-24 14:18:49 -0800 |
| commit | 8a4b35805fdc6651d288a3e1c2d98aa504cb9c05 (patch) | |
| tree | 37c4bdef99996ab681e03c7a3f407563a9ff35d7 /com32/lib/syslinux/pxe_get_nic.c | |
| parent | 3ae1da98a68d2f719ce17766550f7e9682ba8ae7 (diff) | |
| download | syslinux-4.00-pre25.tar.gz | |
com32: replace hard-coded bounce buffer use in com32/libsyslinux-4.00-pre25
Replace hard-coded bounce buffer uses in com32/lib with lmalloc/lfree.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib/syslinux/pxe_get_nic.c')
| -rw-r--r-- | com32/lib/syslinux/pxe_get_nic.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/com32/lib/syslinux/pxe_get_nic.c b/com32/lib/syslinux/pxe_get_nic.c index 704a0d79..b301a75a 100644 --- a/com32/lib/syslinux/pxe_get_nic.c +++ b/com32/lib/syslinux/pxe_get_nic.c @@ -40,19 +40,25 @@ /* Returns the status code from PXE (0 on success), or -1 on invocation failure */ -int pxe_get_nic_type(t_PXENV_UNDI_GET_NIC_TYPE * gnt) +int pxe_get_nic_type(t_PXENV_UNDI_GET_NIC_TYPE *gnt) { com32sys_t regs; + t_PXENV_UNDI_GET_NIC_TYPE *lgnt; + + lgnt = lzalloc(sizeof *lgnt); + if (!lgnt) + return -1; memset(®s, 0, sizeof regs); regs.eax.w[0] = 0x0009; regs.ebx.w[0] = PXENV_UNDI_GET_NIC_TYPE; - regs.es = SEG(__com32.cs_bounce); - regs.edi.w[0] = OFFS(__com32.cs_bounce); + regs.es = SEG(lgnt); + /* regs.edi.w[0] = OFFS(lgnt); */ __intcall(0x22, ®s, ®s); - memcpy(gnt, __com32.cs_bounce, sizeof(t_PXENV_UNDI_GET_NIC_TYPE)); + memcpy(gnt, lgnt, sizeof(t_PXENV_UNDI_GET_NIC_TYPE)); + lfree(lgnt); if (regs.eflags.l & EFLAGS_CF) return -1; |
