]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/ResetVector/Vtf0/Ia32/Flat32ToFlat64.asm
UefiCpuPkg: Clean up source files
[mirror_edk2.git] / UefiCpuPkg / ResetVector / Vtf0 / Ia32 / Flat32ToFlat64.asm
CommitLineData
84a773d1 1;------------------------------------------------------------------------------\r
2; @file\r
3; Transition from 32 bit flat protected mode into 64 bit flat protected mode\r
4;\r
7367cc6c 5; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
84a773d1 6; 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
14;------------------------------------------------------------------------------\r
15\r
16BITS 32\r
17\r
18;\r
19; Modified: EAX\r
20;\r
21Transition32FlatTo64Flat:\r
22\r
a63f2e24 23 OneTimeCall SetCr3ForPageTables64\r
84a773d1 24\r
25 mov eax, cr4\r
26 bts eax, 5 ; enable PAE\r
7367cc6c 27 mov cr4, eax\r
84a773d1 28\r
29 mov ecx, 0xc0000080\r
30 rdmsr\r
31 bts eax, 8 ; set LME\r
32 wrmsr\r
33\r
34 mov eax, cr0\r
35 bts eax, 31 ; set PG\r
36 mov cr0, eax ; enable paging\r
37\r
38 jmp LINEAR_CODE64_SEL:ADDR_OF(jumpTo64BitAndLandHere)\r
39BITS 64\r
40jumpTo64BitAndLandHere:\r
41\r
42 debugShowPostCode POSTCODE_64BIT_MODE\r
43\r
44 OneTimeCallRet Transition32FlatTo64Flat\r
45\r