Browse Source

[pcbios] Save/restore %es in INT 15,e820

Our INT 15,e820 code was setting %es=%ss (as part of the "look ahead
in the memory map" logic), but failing to restore %es afterwards.
This is a serious bug, but wasn't affecting many platforms because
almost all callers seem to set %es=%ss anyway.
tags/v0.9.5
Michael Brown 16 years ago
parent
commit
50dc9344b7
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/arch/i386/firmware/pcbios/e820mangler.S

+ 2
- 0
src/arch/i386/firmware/pcbios/e820mangler.S View File

436
 
436
 
437
 	/* Peek ahead to see if there are any further nonempty regions */
437
 	/* Peek ahead to see if there are any further nonempty regions */
438
 	pushal
438
 	pushal
439
+	pushw	%es
439
 	subw	$20, %sp
440
 	subw	$20, %sp
440
 	movl	$0xe820, %eax
441
 	movl	$0xe820, %eax
441
 	movl	$SMAP, %edx
442
 	movl	$SMAP, %edx
445
 	movw	%sp, %di
446
 	movw	%sp, %di
446
 	call	get_nonempty_e820
447
 	call	get_nonempty_e820
447
 	addr32 leal 20(%esp), %esp /* avoid changing flags */
448
 	addr32 leal 20(%esp), %esp /* avoid changing flags */
449
+	popw	%es
448
 	popal
450
 	popal
449
 	jnc	99f /* There are further nonempty regions */
451
 	jnc	99f /* There are further nonempty regions */
450
 
452
 

Loading…
Cancel
Save