]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X86DisablePaging64.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseLib / X86DisablePaging64.c
1 /** @file
2 IA-32/x64 AsmDisablePaging64()
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "BaseLibInternals.h"
10
11 /**
12 Disables the 64-bit paging mode on the CPU.
13
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.
21
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().
25
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
33 paging is disabled.
34 @param Context2 The 64-bit virtual address of the context to pass into
35 the EntryPoint function as the second parameter after
36 paging is disabled.
37 @param NewStack The 64-bit virtual address of the new stack to use for
38 the EntryPoint function after paging is disabled.
39
40 **/
41 VOID
42 EFIAPI
43 AsmDisablePaging64 (
44 IN UINT16 Cs,
45 IN UINT32 EntryPoint,
46 IN UINT32 Context1 OPTIONAL,
47 IN UINT32 Context2 OPTIONAL,
48 IN UINT32 NewStack
49 )
50 {
51 ASSERT (EntryPoint != 0);
52 ASSERT (NewStack != 0);
53 InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);
54 }