[syslinux:master] PXELINUX: Fix timer bug
syslinux-bot for Gene Cumm
gene.cumm at gmail.com
Sun Nov 14 12:55:23 PST 2010
Commit-ID: d8402d0e3919ff5318c4bbad690be32bf715936e
Gitweb: http://syslinux.zytor.com/commit/d8402d0e3919ff5318c4bbad690be32bf715936e
Author: Gene Cumm <gene.cumm at gmail.com>
AuthorDate: Fri, 5 Nov 2010 13:32:52 -0400
Committer: Gene Cumm <gene.cumm at gmail.com>
CommitDate: Fri, 5 Nov 2010 13:32:52 -0400
PXELINUX: Fix timer bug
Certain calls to the PXE stack could potentially remove us from
memory. Revert the INT 1Ch timer to its previous state.
---
core/pxelinux.asm | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index a46b3da..165472d 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -365,6 +365,15 @@ pxenv:
pushfd
pushad
+ ; We may be removing ourselves from memory
+ cmp bx,0073h
+ jz .disable_timer
+ jmp .store_stack
+
+.disable_timer:
+ call timer_cleanup
+
+.store_stack:
mov [cs:PXEStack],sp
mov [cs:PXEStack+2],ss
lss sp,[cs:InitStack]
@@ -391,6 +400,16 @@ pxenv:
; This clobbers the AX return, but we already saved it into
; the PXEStatus variable.
popad
+
+ ; If the TFTP failed, it could return.
+ cmp bx,0073h
+ jz .enable_timer
+ jmp .pop_flags
+
+.enable_timer:
+ call timer_init
+
+.pop_flags:
popfd ; Restore flags (incl. IF, DF)
ret
More information about the Syslinux-commits
mailing list