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 ;------------------------------------------------------------------------------
26 ;------------------------------------------------------------------------------
29 ; InternalX86EnablePaging64 (
31 ; IN UINT64 EntryPoint,
32 ; IN UINT64 Context1, OPTIONAL
33 ; IN UINT64 Context2, OPTIONAL
36 ;------------------------------------------------------------------------------
37 InternalX86EnablePaging64 PROC
39 pop rax ; skip the return address
42 add dword ptr [rsp], @F - @Base ; offset for far retf, seg is the 1st arg
43 mov rax, cr4 ; mov eax, cr4
45 mov cr4, rax ; enable PAE
50 mov rax, cr0 ; mov eax, cr0
52 mov cr0, rax ; enable paging
54 @@: ; long mode starts here
61 hlt ; halt processor if EntryPoint() returned
62 InternalX86EnablePaging64 ENDP