summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2011-01-27 00:20:48 +0100
committerMichael Brown2011-01-27 00:28:45 +0100
commit7f2d0f12addc76543c383dfaa8e9fc46533aa427 (patch)
tree7ba9ccefd069474cfc5f4b92938bcd7450300835 /src
parent[prefix] Use 16-bit protected mode for access to high memory (diff)
downloadipxe-7f2d0f12addc76543c383dfaa8e9fc46533aa427.tar.gz
ipxe-7f2d0f12addc76543c383dfaa8e9fc46533aa427.tar.xz
ipxe-7f2d0f12addc76543c383dfaa8e9fc46533aa427.zip
[libflat] Remove now-obsolete flatten_real_mode call
Flat real mode will have been set up as a side-effect of the protected-mode call invoked during install_block() for .text16.early; there is no need to do so explicitly. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/prefix/libprefix.S5
-rw-r--r--src/arch/i386/transitions/libflat.S122
2 files changed, 5 insertions, 122 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S
index c8fbe95be..f95a7a1ff 100644
--- a/src/arch/i386/prefix/libprefix.S
+++ b/src/arch/i386/prefix/libprefix.S
@@ -649,7 +649,10 @@ install_prealloc:
popl %esi
#ifndef KEEP_IT_REAL
- /* Access high memory */
+ /* Access high memory by enabling the A20 gate. (We will
+ * already have 4GB segment limits as a result of calling
+ * install_block.)
+ */
pushw %cs
pushw $1f
pushw %ax
diff --git a/src/arch/i386/transitions/libflat.S b/src/arch/i386/transitions/libflat.S
index 98f6f4df6..594d62010 100644
--- a/src/arch/i386/transitions/libflat.S
+++ b/src/arch/i386/transitions/libflat.S
@@ -21,124 +21,6 @@ FILE_LICENCE ( GPL2_OR_LATER )
.arch i386
-#define CR0_PE 1
-
-/****************************************************************************
- * flatten_real_mode
- *
- * Set up 4GB segment limits
- *
- * Parameters:
- * none
- * Returns:
- * none
- * Corrupts:
- * none
- ****************************************************************************
- */
- /* GDT for protected-mode calls */
- .section ".text16.early.data", "aw", @progbits
- .align 16
-flatten_gdt:
-flatten_gdt_limit: .word flatten_gdt_length - 1
-flatten_gdt_base: .long 0
- .word 0 /* padding */
-flatten_cs: /* 16-bit protected-mode flat code segment */
- .equ FLAT_CS, flatten_cs - flatten_gdt
- .word 0xffff, 0
- .byte 0, 0x9b, 0x8f, 0
-flatten_ss: /* 16-bit protected-mode flat stack segment */
- .equ FLAT_SS, flatten_ss - flatten_gdt
- .word 0xffff, 0
- .byte 0, 0x93, 0x8f, 0
-flatten_gdt_end:
- .equ flatten_gdt_length, . - flatten_gdt
- .size flatten_gdt, . - flatten_gdt
-
- .section ".text16.early.data", "aw", @progbits
- .align 16
-flatten_saved_gdt:
- .long 0, 0
- .size flatten_saved_gdt, . - flatten_saved_gdt
-
- .section ".text16.early", "awx", @progbits
- .code16
-flatten_real_mode:
- /* Preserve registers and flags */
- pushfl
- pushl %eax
- pushw %si
- pushw %gs
- pushw %fs
- pushw %es
- pushw %ds
- pushw %ss
-
- /* Set %ds for access to .text16.early.data variables */
- pushw %cs
- popw %ds
-
- /* Preserve original GDT */
- sgdt flatten_saved_gdt
-
- /* Set up GDT bases */
- xorl %eax, %eax
- movw %cs, %ax
- shll $4, %eax
- addl $flatten_gdt, %eax
- movl %eax, flatten_gdt_base
- movw %cs, %ax
- movw $flatten_cs, %si
- call set_seg_base
- movw %ss, %ax
- movw $flatten_ss, %si
- call set_seg_base
-
- /* Switch temporarily to protected mode and set segment registers */
- pushw %cs
- pushw $2f
- cli
- data32 lgdt flatten_gdt
- movl %cr0, %eax
- orb $CR0_PE, %al
- movl %eax, %cr0
- ljmp $FLAT_CS, $1f
-1: movw $FLAT_SS, %ax
- movw %ax, %ss
- movw %ax, %ds
- movw %ax, %es
- movw %ax, %fs
- movw %ax, %gs
- movl %cr0, %eax
- andb $0!CR0_PE, %al
- movl %eax, %cr0
- lret
-2: /* lret will ljmp to here */
-
- /* Restore GDT, registers and flags */
- data32 lgdt flatten_saved_gdt
- popw %ss
- popw %ds
- popw %es
- popw %fs
- popw %gs
- popw %si
- popl %eax
- popfl
- ret
- .size flatten_real_mode, . - flatten_real_mode
-
- .section ".text16.early", "awx", @progbits
- .code16
-set_seg_base:
- rolw $4, %ax
- movw %ax, 2(%si)
- andw $0xfff0, 2(%si)
- movb %al, 4(%si)
- andb $0x0f, 4(%si)
- ret
- .size set_seg_base, . - set_seg_base
-
/****************************************************************************
* test_a20_short, test_a20_long
*
@@ -403,7 +285,7 @@ enable_a20_method:
/****************************************************************************
* access_highmem (real mode far call)
*
- * Open up access to high memory in flat real mode with A20 enabled
+ * Open up access to high memory with A20 enabled
*
* Parameters:
* none
@@ -419,7 +301,5 @@ enable_a20_method:
access_highmem:
/* Enable A20 line */
call enable_a20
- /* Set up 4GB limits */
- call flatten_real_mode
lret
.size access_highmem, . - access_highmem