2 // Include common header file for this module.
4 #include "CommonHeader.h"
6 #------------------------------------------------------------------------------
8 # Copyright (c) 2006, Intel Corporation
9 # All rights reserved. This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23 # InternalX86EnablePaging64 function
27 #------------------------------------------------------------------------------
29 .globl ASM_PFX(InternalX86EnablePaging64)
31 #------------------------------------------------------------------------------
34 # InternalX86EnablePaging64 (
35 # IN UINT16 CodeSelector,
36 # IN UINT64 EntryPoint,
37 # IN UINT64 Context1, OPTIONAL
38 # IN UINT64 Context2, OPTIONAL
41 #------------------------------------------------------------------------------
42 ASM_PFX(InternalX86EnablePaging64):
44 movl $LongStart, (%esp)
47 movl %eax, %cr4 # enable PAE
48 movl $0xc0000080, %ecx
54 movl %eax, %cr0 # enable paging
56 LongStart: # long mode starts here
58 movl (%esp), %ebx # mov rbx, [esp]
60 movl 8(%esp), %ecx # mov rcx, [esp + 8]
62 movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
64 movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
66 addl $0x-20, %esp # add rsp, -20h