[syslinux:lwip] pxe: fix the cleanup routine

syslinux-bot for H. Peter Anvin hpa at zytor.com
Mon May 9 20:49:36 PDT 2011


Commit-ID:  23ffd64debdf013145da237fe34b8a12d70c228d
Gitweb:     http://syslinux.zytor.com/commit/23ffd64debdf013145da237fe34b8a12d70c228d
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 9 May 2011 20:44:10 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 9 May 2011 20:44:10 -0700

pxe: fix the cleanup routine

Observe that the routine called pxe_cleanup_isr really had become the
previous routine called reset_pxe().

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/fs/pxe/isr.c |    4 +++-
 core/fs/pxe/pxe.c |   30 +++---------------------------
 core/fs/pxe/pxe.h |    2 +-
 3 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/core/fs/pxe/isr.c b/core/fs/pxe/isr.c
index be8d38f..a476b7d 100644
--- a/core/fs/pxe/isr.c
+++ b/core/fs/pxe/isr.c
@@ -196,7 +196,7 @@ void pxe_start_isr(void)
 				   pxe_poll_thread, NULL);
 }
 
-void pxe_cleanup_isr(void)
+int reset_pxe(void)
 {
     static __lowmem struct s_PXENV_UNDI_CLOSE undi_close;
 
@@ -210,4 +210,6 @@ void pxe_cleanup_isr(void)
 	uninstall_irq_vector(pxe_undi_info.IntNumber, pxe_isr, &pxe_irq_chain);
     if (poll_thread)
 	kill_thread(poll_thread);
+
+    return undi_close.Status;
 }
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 867404e..e553d8c 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -963,9 +963,9 @@ static inline bool is_efi(const struct efi_struct *efi)
     return (efi->magic == EFI_MAGIC) && (efi->len >= 83);
 }
 
+#if 0
 static void install_int18_hack(void)
 {
-#if 0
     static const uint8_t int18_hack[] =
     {
 	0xcd, 0x18,			/* int $0x18 */
@@ -1001,30 +1001,8 @@ static void install_int18_hack(void)
 	    *(uint16_t *)(dst+46) = InitStack.seg;
 	}
     }
-#endif
-}
-
-int reset_pxe(void)
-{
-    static __lowmem struct s_PXENV_UDP_CLOSE udp_close;
-    extern void gpxe_unload(void);
-    int err = 0;
-
-    pxe_idle_cleanup();
-
-    pxe_call(PXENV_UDP_CLOSE, &udp_close);
-
-    if (gpxe_funcs & 0x80) {
-	/* gPXE special unload implemented */
-	call16(gpxe_unload, &zero_regs, NULL);
-
-	/* Locate the actual vendor stack... */
-	err = pxe_init(true);
-    }
-
-    install_int18_hack();
-    return err;
 }
+#endif
 
 /*
  * This function unloads the PXE and UNDI stacks and
@@ -1052,14 +1030,12 @@ void unload_pxe(void)
 	uint16_t Status;	/* All calls have this as the first member */
     } unload_call;
 
-    pxe_cleanup_isr();
+    printf("Called unload_pxe()...\n");
 
     dprintf("FBM before unload = %d\n", BIOS_fbm);
 
     err = reset_pxe();
 
-    dprintf("FBM after reset_pxe = %d, err = %d\n", BIOS_fbm, err);
-
     /* If we want to keep PXE around, we still need to reset it */
     if (KeepPXE || err)
 	return;
diff --git a/core/fs/pxe/pxe.h b/core/fs/pxe/pxe.h
index e07fc35..d347f9e 100644
--- a/core/fs/pxe/pxe.h
+++ b/core/fs/pxe/pxe.h
@@ -190,7 +190,7 @@ extern far_ptr_t pxe_irq_chain;
 /* isr.c */
 void pxe_init_isr(void);
 void pxe_start_isr(void);
-void pxe_cleanup_isr(void);
+int reset_pxe(void);
 
 /* pxe.c */
 struct url_info;



More information about the Syslinux-commits mailing list