summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhpa <hpa>2005-08-22 15:59:12 +0000
committerhpa <hpa>2005-08-22 15:59:12 +0000
commit93f14a4ac8c43dee550e740c6919451aaabc2436 (patch)
tree30d3d20494e2859fb321bc8f640fb528f0df1ef3
parent21f060a5c6211233b91a48b18a79bda32f1dd5c6 (diff)
downloadsyslinux-93f14a4ac8c43dee550e740c6919451aaabc2436.tar.gz
Register-handling cleanups for searchdir.
-rw-r--r--extlinux.asm2
-rw-r--r--isolinux.asm14
-rw-r--r--ldlinux.asm8
-rw-r--r--pxelinux.asm11
4 files changed, 23 insertions, 12 deletions
diff --git a/extlinux.asm b/extlinux.asm
index d291c2c1..a0bd41f3 100644
--- a/extlinux.asm
+++ b/extlinux.asm
@@ -1065,7 +1065,6 @@ close:
searchdir:
push bx
push cx
- push di
push bp
mov byte [SymlinkCtr],MAX_SYMLINKS
@@ -1111,7 +1110,6 @@ searchdir:
.done:
and eax,eax ; Set/clear ZF
pop bp
- pop di
pop cx
pop bx
ret
diff --git a/isolinux.asm b/isolinux.asm
index 50f41174..d1697d66 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -1173,17 +1173,19 @@ local_boot:
; to the above, searchdir_iso passes a file flag mask in AL. This is useful
; for searching for directories.
;
-alloc_failure:
+searchdir_iso.alloc_failure:
xor ax,ax ; ZF <- 1
- ret
+ jmp searchdir_iso.ret
searchdir:
xor al,al
searchdir_iso:
+ push bx
+ push cx
mov [ISOFlags],al
TRACER 'S'
call allocate_file ; Temporary file structure for directory
- jnz alloc_failure
+ jnz .alloc_failure
push es
push ds
pop es ; ES = DS
@@ -1268,8 +1270,7 @@ searchdir_iso:
.failure: xor eax,eax ; ZF = 1
mov [bx+file_sector],eax
- pop es
- ret
+ jmp .ret
.success:
mov eax,[si+2] ; Location of extent
@@ -1284,7 +1285,10 @@ searchdir_iso:
shr edx,16
and bx,bx ; ZF = 0
mov si,bx
+.ret:
pop es
+ pop cx
+ pop bx
ret
.resume: ; We get here if we were only doing part of a lookup
diff --git a/ldlinux.asm b/ldlinux.asm
index df850ed0..00ba61e6 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -976,9 +976,11 @@ allocate_file:
;
searchdir:
+ push bx
call allocate_file
jnz .alloc_failure
+ push cx
push gs
push es
push ds
@@ -1013,8 +1015,10 @@ searchdir:
.failure:
pop es
pop gs
+ pop cx
.alloc_failure:
- xor ax,ax ; ZF <- 1
+ pop bx
+ xor eax,eax ; ZF <- 1
ret
.found:
mov eax,[gs:si+28] ; File size
@@ -1039,6 +1043,8 @@ searchdir:
pop es
pop gs
+ pop cx
+ pop bx
ret
;
diff --git a/pxelinux.asm b/pxelinux.asm
index 331a84e7..f2b542b2 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -1089,6 +1089,8 @@ memory_scan_for_pxenv_struct:
searchdir:
push es
+ push bx
+ push cx
mov ax,ds
mov es,ax
mov si,di
@@ -1096,7 +1098,7 @@ searchdir:
mov bp,sp
call allocate_socket
- jz .error
+ jz .ret
mov ax,PKT_RETRY ; Retry counter
mov word [PktTimeout],PKT_TIMEOUT ; Initial timeout
@@ -1308,7 +1310,10 @@ searchdir:
pop bp ; Junk
pop bp ; Junk (retry counter)
jz .error_si ; ZF = 1 need to free the socket
+.ret:
pop bp
+ pop cx
+ pop bx
pop es
ret
@@ -1341,9 +1346,7 @@ searchdir:
.error: mov si,bx ; Socket pointer
.error_si: ; Socket pointer already in SI
call free_socket ; ZF <- 1, SI <- 0
- pop bp
- pop es
- ret
+ jmp .ret
;
; allocate_socket: Allocate a local UDP port structure