]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/ResetVector/Vtf0: Move Page Table/CR3 setting to a new file
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 24 Sep 2013 18:23:09 +0000 (18:23 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 24 Sep 2013 18:23:09 +0000 (18:23 +0000)
Now, Transition32FlatTo64Flat calls SetCr3ForPageTables64
which is located in Ia32/PageTables64.asm.

This change is required so OVMF can replace the code in
Ia32/PageTables64.asm with code that generates page tables in
RAM.

Note: Since this change does not impact the functionality of the
current VTF0 binaries, they are not being updated. The resulting
new binaries were tested to verify there is no regression.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14714 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/ResetVector/Vtf0/Ia32/Flat32ToFlat64.asm
UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm [new file with mode: 0644]
UefiCpuPkg/ResetVector/Vtf0/ResetVectorCode.asm

index 9eba864c2853831224346dc955a1aeaf42bd26ce..62e71da3d5d9c99825e62faa85a571cad334d3b0 100644 (file)
@@ -2,7 +2,7 @@
 ; @file\r
 ; Transition from 32 bit flat protected mode into 64 bit flat protected mode\r
 ;\r
-; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -20,8 +20,7 @@ BITS    32
 ;\r
 Transition32FlatTo64Flat:\r
 \r
-    mov     eax, ((ADDR_OF_START_OF_RESET_CODE & ~0xfff) - 0x1000)\r
-    mov     cr3, eax\r
+    OneTimeCall SetCr3ForPageTables64\r
 \r
     mov     eax, cr4\r
     bts     eax, 5                      ; enable PAE\r
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm b/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
new file mode 100644 (file)
index 0000000..0cfcbae
--- /dev/null
@@ -0,0 +1,30 @@
+;------------------------------------------------------------------------------\r
+; @file\r
+; Sets the CR3 register for 64-bit paging\r
+;\r
+; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+BITS    32\r
+\r
+;\r
+; Modified:  EAX\r
+;\r
+SetCr3ForPageTables64:\r
+\r
+    ;\r
+    ; These pages are built into the ROM image by Tools/FixupForRawSection.py\r
+    ;\r
+    mov     eax, ((ADDR_OF_START_OF_RESET_CODE & ~0xfff) - 0x1000)\r
+    mov     cr3, eax\r
+\r
+    OneTimeCallRet SetCr3ForPageTables64\r
+\r
index 96f686b0e6d0ba27312a0d3f3062554fd8fdc617..052c821f212c5a11f0c5ecb58bbc566b2151ad4a 100644 (file)
@@ -2,7 +2,7 @@
 ; @file\r
 ; This file includes all other code files to assemble the reset vector code\r
 ;\r
-; Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -41,6 +41,7 @@
 \r
 %ifdef ARCH_X64\r
 %include "Ia32/Flat32ToFlat64.asm"\r
+%include "Ia32/PageTables64.asm"\r
 %endif\r
 \r
 %include "Ia16/Real16ToFlat32.asm"\r