]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/ResetVector/Vtf0/Ia32/Flat32ToFlat64.asm
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / ResetVector / Vtf0 / Ia32 / Flat32ToFlat64.asm
1 ;------------------------------------------------------------------------------
2 ; @file
3 ; Transition from 32 bit flat protected mode into 64 bit flat protected mode
4 ;
5 ; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
6 ; SPDX-License-Identifier: BSD-2-Clause-Patent
7 ;
8 ;------------------------------------------------------------------------------
9
10 BITS 32
11
12 ;
13 ; Modified: EAX
14 ;
15 Transition32FlatTo64Flat:
16
17 OneTimeCall SetCr3ForPageTables64
18
19 mov eax, cr4
20 bts eax, 5 ; enable PAE
21 mov cr4, eax
22
23 mov ecx, 0xc0000080
24 rdmsr
25 bts eax, 8 ; set LME
26 wrmsr
27
28 mov eax, cr0
29 bts eax, 31 ; set PG
30 mov cr0, eax ; enable paging
31
32 jmp LINEAR_CODE64_SEL:ADDR_OF(jumpTo64BitAndLandHere)
33 BITS 64
34 jumpTo64BitAndLandHere:
35
36 debugShowPostCode POSTCODE_64BIT_MODE
37
38 OneTimeCallRet Transition32FlatTo64Flat
39