2 IA-32/x64 AsmDisablePaging64()
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "BaseLibInternals.h"
12 Disables the 64-bit paging mode on the CPU.
14 Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
15 mode. This function assumes the current execution mode is 64-paging mode.
16 This function is only available on x64. After the 64-bit paging mode is
17 disabled, control is transferred to the function specified by EntryPoint
18 using the new stack specified by NewStack and passing in the parameters
19 specified by Context1 and Context2. Context1 and Context2 are optional and
20 may be 0. The function EntryPoint must never return.
22 If the current execution mode is not 64-bit paged mode, then ASSERT().
23 If EntryPoint is 0, then ASSERT().
24 If NewStack is 0, then ASSERT().
26 @param Cs The 16-bit selector to load in the CS before EntryPoint
27 is called. The descriptor in the GDT that this selector
28 references must be setup for 32-bit protected mode.
29 @param EntryPoint The 64-bit virtual address of the function to call with
30 the new stack after paging is disabled.
31 @param Context1 The 64-bit virtual address of the context to pass into
32 the EntryPoint function as the first parameter after
34 @param Context2 The 64-bit virtual address of the context to pass into
35 the EntryPoint function as the second parameter after
37 @param NewStack The 64-bit virtual address of the new stack to use for
38 the EntryPoint function after paging is disabled.
46 IN UINT32 Context1 OPTIONAL
,
47 IN UINT32 Context2 OPTIONAL
,
51 ASSERT (EntryPoint
!= 0);
52 ASSERT (NewStack
!= 0);
53 InternalX86DisablePaging64 (Cs
, EntryPoint
, Context1
, Context2
, NewStack
);