1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
12 ; AsmEnablePaging64 function
16 ;------------------------------------------------------------------------------
20 ;------------------------------------------------------------------------------
23 ; InternalX86EnablePaging64 (
25 ; IN UINT64 EntryPoint,
26 ; IN UINT64 Context1, OPTIONAL
27 ; IN UINT64 Context2, OPTIONAL
30 ;------------------------------------------------------------------------------
31 global ASM_PFX(InternalX86EnablePaging64)
32 ASM_PFX(InternalX86EnablePaging64):
34 mov DWORD [esp], .0 ; offset for far retf, seg is the 1st arg
37 mov cr4, eax ; enable PAE
44 mov cr0, eax ; enable paging
45 retf ; topmost 2 dwords hold the address
47 DB 0x67, 0x48 ; 32-bit address size, 64-bit operand size
48 mov ebx, [esp] ; mov rbx, [esp]
50 mov ecx, [esp + 8] ; mov rcx, [esp + 8]
52 mov edx, [esp + 0x10] ; mov rdx, [esp + 10h]
54 mov esp, [esp + 0x18] ; mov rsp, [esp + 18h]
56 add esp, -0x20 ; add rsp, -20h
58 hlt ; no one should get here