]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.asm
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / 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 .686p\r
23 .model flat,C\r
24 .code\r
25\r
26;------------------------------------------------------------------------------\r
27; VOID\r
28; EFIAPI\r
29; InternalX86EnablePaging64 (\r
30; IN UINT16 Cs,\r
31; IN UINT64 EntryPoint,\r
32; IN UINT64 Context1, OPTIONAL\r
33; IN UINT64 Context2, OPTIONAL\r
34; IN UINT64 NewStack\r
35; );\r
36;------------------------------------------------------------------------------\r
37InternalX86EnablePaging64 PROC\r
38 cli\r
39 mov [esp], @F ; offset for far retf, seg is the 1st arg\r
40 mov eax, cr4\r
41 or al, (1 SHL 5)\r
42 mov cr4, eax ; enable PAE\r
43 mov ecx, 0c0000080h\r
44 rdmsr\r
45 or ah, 1 ; set LME\r
46 wrmsr\r
47 mov eax, cr0\r
48 bts eax, 31 ; set PG\r
49 mov cr0, eax ; enable paging\r
50 retf ; topmost 2 dwords hold the address\r
51@@: ; long mode starts here\r
52 DB 67h, 48h ; 32-bit address size, 64-bit operand size\r
53 mov ebx, [esp] ; mov rbx, [esp]\r
54 DB 67h, 48h\r
55 mov ecx, [esp + 8] ; mov rcx, [esp + 8]\r
56 DB 67h, 48h\r
57 mov edx, [esp + 10h] ; mov rdx, [esp + 10h]\r
58 DB 67h, 48h\r
59 mov esp, [esp + 18h] ; mov rsp, [esp + 18h]\r
60 DB 48h\r
61 add esp, -20h ; add rsp, -20h\r
62 call ebx ; call rbx\r
63 hlt ; no one should get here\r
64InternalX86EnablePaging64 ENDP\r
65\r
66 END\r