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 ; AsmEnablePaging64 function
22 ;------------------------------------------------------------------------------
26 ;------------------------------------------------------------------------------
29 ; InternalX86EnablePaging64 (
31 ; IN UINT64 EntryPoint,
32 ; IN UINT64 Context1, OPTIONAL
33 ; IN UINT64 Context2, OPTIONAL
36 ;------------------------------------------------------------------------------
37 global ASM_PFX(InternalX86EnablePaging64)
38 ASM_PFX(InternalX86EnablePaging64):
40 mov DWORD [esp], .0 ; offset for far retf, seg is the 1st arg
43 mov cr4, eax ; enable PAE
50 mov cr0, eax ; enable paging
51 retf ; topmost 2 dwords hold the address
53 DB 0x67, 0x48 ; 32-bit address size, 64-bit operand size
54 mov ebx, [esp] ; mov rbx, [esp]
56 mov ecx, [esp + 8] ; mov rcx, [esp + 8]
58 mov edx, [esp + 0x10] ; mov rdx, [esp + 10h]
60 mov esp, [esp + 0x18] ; mov rsp, [esp + 18h]
62 add esp, -0x20 ; add rsp, -20h
64 hlt ; no one should get here