1 #------------------------------------------------------------------------------
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
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.
18 # InternalX86EnablePaging64 function
22 #------------------------------------------------------------------------------
24 #include <EdkIIGlueBase.h>
26 .globl ASM_PFX(InternalX86EnablePaging64)
28 #------------------------------------------------------------------------------
31 # InternalX86EnablePaging64 (
32 # IN UINT16 CodeSelector,
33 # IN UINT64 EntryPoint,
34 # IN UINT64 Context1, OPTIONAL
35 # IN UINT64 Context2, OPTIONAL
38 #------------------------------------------------------------------------------
39 ASM_PFX(InternalX86EnablePaging64):
41 movl $LongStart, (%esp)
44 movl %eax, %cr4 # enable PAE
45 movl $0xc0000080, %ecx
51 movl %eax, %cr0 # enable paging
53 LongStart: # long mode starts here
55 movl (%esp), %ebx # mov rbx, [esp]
57 movl 8(%esp), %ecx # mov rcx, [esp + 8]
59 movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
61 movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
63 addl $0x-20, %esp # add rsp, -20h