1 #------------------------------------------------------------------------------
3 # Copyright (c) 2006, Intel Corporation
4 # All rights reserved. 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 # AsmEnablePaging64 function
22 #------------------------------------------------------------------------------
28 #------------------------------------------------------------------------------
32 # IN UINT16 CodeSelector,
33 # IN UINT64 EntryPoint,
34 # IN UINT64 Context1, OPTIONAL
35 # IN UINT64 Context2, OPTIONAL
38 #------------------------------------------------------------------------------
39 .global _AsmEnablePaging64
42 movl $$LongStart, (%esp)
45 movl %eax, %cr4 # enable PAE
46 movl $0xc0000080, %ecx
52 movl %eax, %cr0 # enable paging
54 LongStart: # long mode starts here
56 movl (%esp), %ebx # mov rbx, [esp]
58 movl 8(%esp), %ecx # mov rcx, [esp + 8]
60 movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
62 movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
64 addl $0x-20, %esp # add rsp, -20h