]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/ResetVector/Ia32/32FlatTo64Flat.asm
OVMF ResetVector: Modify interface with SEC module
[mirror_edk2.git] / OvmfPkg / ResetVector / Ia32 / 32FlatTo64Flat.asm
CommitLineData
49ba9447 1;------------------------------------------------------------------------------\r
7a55c43b 2; @file\r
3; Transition from 32 bit flat protected mode into 64 bit flat protected mode\r
49ba9447 4;\r
7a55c43b 5; Copyright (c) 2008 - 2009, Intel Corporation\r
49ba9447 6; All rights reserved. This program and the accompanying materials\r
7; are licensed and made available under the terms and conditions of the BSD License\r
8; which accompanies this distribution. The full text of the license may be found at\r
9; http://opensource.org/licenses/bsd-license.php\r
10;\r
11; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13;\r
49ba9447 14;------------------------------------------------------------------------------\r
15\r
16BITS 32\r
17\r
7a55c43b 18;\r
19; Modified: EAX\r
20;\r
49ba9447 21Transition32FlatTo64Flat:\r
22\r
23 mov eax, ((ADDR_OF_START_OF_RESET_CODE & ~0xfff) - 0x1000)\r
24 mov cr3, eax\r
25\r
26 mov eax, cr4\r
27 bts eax, 5 ; enable PAE\r
28 mov cr4, eax \r
29\r
30 mov ecx, 0xc0000080\r
31 rdmsr\r
32 bts eax, 8 ; set LME\r
33 wrmsr\r
34\r
35 mov eax, cr0\r
36 bts eax, 31 ; set PG\r
37 mov cr0, eax ; enable paging\r
38\r
39 jmp LINEAR_CODE64_SEL:ADDR_OF(jumpTo64BitAndLandHere)\r
40BITS 64\r
41jumpTo64BitAndLandHere:\r
42\r
7a55c43b 43 debugShowPostCode POSTCODE_64BIT_MODE\r
49ba9447 44\r
45 OneTimeCallRet Transition32FlatTo64Flat\r
46\r