]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.S
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / EnablePaging64.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 # This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
8 #
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #
12 # Module Name:
13 #
14 # EnablePaging64.Asm
15 #
16 # Abstract:
17 #
18 # InternalX86EnablePaging64 function
19 #
20 # Notes:
21 #
22 #------------------------------------------------------------------------------
23
24 #include <EdkIIGlueBase.h>
25
26 .globl ASM_PFX(InternalX86EnablePaging64)
27
28 #------------------------------------------------------------------------------
29 # VOID
30 # EFIAPI
31 # InternalX86EnablePaging64 (
32 # IN UINT16 CodeSelector,
33 # IN UINT64 EntryPoint,
34 # IN UINT64 Context1, OPTIONAL
35 # IN UINT64 Context2, OPTIONAL
36 # IN UINT64 NewStack
37 # );
38 #------------------------------------------------------------------------------
39 ASM_PFX(InternalX86EnablePaging64):
40 cli
41 movl $LongStart, (%esp)
42 movl %cr4, %eax
43 orb $0x20, %al
44 movl %eax, %cr4 # enable PAE
45 movl $0xc0000080, %ecx
46 rdmsr
47 orb $1, %ah # set LME
48 wrmsr
49 movl %cr0, %eax
50 btsl $31, %eax
51 movl %eax, %cr0 # enable paging
52 lret
53 LongStart: # long mode starts here
54 .byte 0x67, 0x48
55 movl (%esp), %ebx # mov rbx, [esp]
56 .byte 0x67, 0x48
57 movl 8(%esp), %ecx # mov rcx, [esp + 8]
58 .byte 0x67, 0x48
59 movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
60 .byte 0x67, 0x48
61 movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
62 .byte 0x48
63 addl $0x-20, %esp # add rsp, -20h
64 call *%ebx # call rbx
65 jmp .