]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/ResetVector/Vtf0/Ia32/Flat32ToFlat64.asm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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
0acd8697 6; SPDX-License-Identifier: BSD-2-Clause-Patent\r
84a773d1 7;\r
8;------------------------------------------------------------------------------\r
9\r
10BITS 32\r
11\r
12;\r
13; Modified: EAX\r
14;\r
15Transition32FlatTo64Flat:\r
16\r
a63f2e24 17 OneTimeCall SetCr3ForPageTables64\r
84a773d1 18\r
19 mov eax, cr4\r
20 bts eax, 5 ; enable PAE\r
7367cc6c 21 mov cr4, eax\r
84a773d1 22\r
23 mov ecx, 0xc0000080\r
24 rdmsr\r
25 bts eax, 8 ; set LME\r
26 wrmsr\r
27\r
28 mov eax, cr0\r
29 bts eax, 31 ; set PG\r
30 mov cr0, eax ; enable paging\r
31\r
32 jmp LINEAR_CODE64_SEL:ADDR_OF(jumpTo64BitAndLandHere)\r
33BITS 64\r
34jumpTo64BitAndLandHere:\r
35\r
36 debugShowPostCode POSTCODE_64BIT_MODE\r
37\r
38 OneTimeCallRet Transition32FlatTo64Flat\r
39\r