]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/X86DisablePaging64.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseLib / X86DisablePaging64.c
CommitLineData
e1f414b6 1/** @file\r
2 IA-32/x64 AsmDisablePaging64()\r
3\r
bb817c56 4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e1f414b6 6\r
e1f414b6 7**/\r
8\r
e1f414b6 9#include "BaseLibInternals.h"\r
10\r
11/**\r
12 Disables the 64-bit paging mode on the CPU.\r
13\r
14 Disables the 64-bit paging mode on the CPU and returns to 32-bit protected\r
15 mode. This function assumes the current execution mode is 64-paging mode.\r
030cd1a2 16 This function is only available on x64. After the 64-bit paging mode is\r
e1f414b6 17 disabled, control is transferred to the function specified by EntryPoint\r
18 using the new stack specified by NewStack and passing in the parameters\r
19 specified by Context1 and Context2. Context1 and Context2 are optional and\r
20 may be 0. The function EntryPoint must never return.\r
21\r
22 If the current execution mode is not 64-bit paged mode, then ASSERT().\r
23 If EntryPoint is 0, then ASSERT().\r
24 If NewStack is 0, then ASSERT().\r
25\r
26 @param Cs The 16-bit selector to load in the CS before EntryPoint\r
27 is called. The descriptor in the GDT that this selector\r
28 references must be setup for 32-bit protected mode.\r
29 @param EntryPoint The 64-bit virtual address of the function to call with\r
30 the new stack after paging is disabled.\r
31 @param Context1 The 64-bit virtual address of the context to pass into\r
32 the EntryPoint function as the first parameter after\r
33 paging is disabled.\r
34 @param Context2 The 64-bit virtual address of the context to pass into\r
35 the EntryPoint function as the second parameter after\r
36 paging is disabled.\r
37 @param NewStack The 64-bit virtual address of the new stack to use for\r
38 the EntryPoint function after paging is disabled.\r
39\r
40**/\r
41VOID\r
42EFIAPI\r
43AsmDisablePaging64 (\r
2f88bd3a
MK
44 IN UINT16 Cs,\r
45 IN UINT32 EntryPoint,\r
46 IN UINT32 Context1 OPTIONAL,\r
47 IN UINT32 Context2 OPTIONAL,\r
48 IN UINT32 NewStack\r
e1f414b6 49 )\r
50{\r
51 ASSERT (EntryPoint != 0);\r
52 ASSERT (NewStack != 0);\r
53 InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r
54}\r