1 ; Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
2 ; This program and the accompanying materials
3 ; are licensed and made available under the terms and conditions of the BSD License
4 ; which accompanies this distribution. The full text of the license may be found at
5 ; http://opensource.org/licenses/bsd-license.php
7 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
8 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 ; AsmDisablePaging64 function
20 ;------------------------------------------------------------------------------
24 ;------------------------------------------------------------------------------
27 ; InternalX86DisablePaging64 (
29 ; IN UINT32 EntryPoint,
30 ; IN UINT32 Context1, OPTIONAL
31 ; IN UINT32 Context2, OPTIONAL
34 ;------------------------------------------------------------------------------
35 InternalX86DisablePaging64 PROC
37 shl rcx, 32 ; rcx[32..47] <- Cs
40 or rcx, rax ; rcx[0..47] <- Cs:@F
42 mov eax, [rsp + 28h] ; eax <- New Stack
44 retf ; switch to compatibility mode
46 mov esp, eax ; set up new stack
49 mov cr0, rax ; disable paging
52 and ah, NOT 1 ; clear LME
55 and al, NOT (1 SHL 5) ; clear PAE
57 push rdi ; push Context2
58 push rsi ; push Context1
59 call rdx ; transfer control to EntryPoint
60 hlt ; no one should get here
61 InternalX86DisablePaging64 ENDP