]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.asm
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / X64 / EnablePaging64.asm
CommitLineData
2c7e5c2f
HT
1; Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
2; This program and the accompanying materials \r
3eb9473e 3; are licensed and made available under the terms and conditions of the BSD License \r
4; which accompanies this distribution. The full text of the license may be found at \r
5; http://opensource.org/licenses/bsd-license.php \r
6; \r
7; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
8; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
9;\r
10; Module Name:\r
11;\r
12; EnablePaging64.Asm\r
13;\r
14; Abstract:\r
15;\r
16; AsmEnablePaging64 function\r
17;\r
18; Notes:\r
19;\r
20;------------------------------------------------------------------------------\r
21\r
22 .code\r
23\r
24;------------------------------------------------------------------------------\r
25; VOID\r
26; EFIAPI\r
27; InternalX86EnablePaging64 (\r
28; IN UINT16 Cs,\r
29; IN UINT64 EntryPoint,\r
30; IN UINT64 Context1, OPTIONAL\r
31; IN UINT64 Context2, OPTIONAL\r
32; IN UINT64 NewStack\r
33; );\r
34;------------------------------------------------------------------------------\r
35InternalX86EnablePaging64 PROC\r
36 cli\r
37 pop rax ; skip the return address\r
38 call @Base\r
39@Base:\r
40 add dword ptr [rsp], @F - @Base ; offset for far retf, seg is the 1st arg\r
41 mov rax, cr4 ; mov eax, cr4\r
42 or al, (1 SHL 5)\r
43 mov cr4, rax ; enable PAE\r
44 mov ecx, 0c0000080h\r
45 rdmsr\r
46 or ah, 1 ; set LME\r
47 wrmsr\r
48 mov rax, cr0 ; mov eax, cr0\r
49 bts eax, 31\r
50 mov cr0, rax ; enable paging\r
51 retf\r
52@@: ; long mode starts here\r
53 mov rbx, [esp]\r
54 mov rcx, [esp + 8]\r
55 mov rdx, [esp + 10h]\r
56 mov rsp, [esp + 18h]\r
57 add rsp, -20h\r
58 call rbx\r
59 hlt ; halt processor if EntryPoint() returned\r
60InternalX86EnablePaging64 ENDP\r
61\r
62 END\r