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