]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/X86EnablePaging64.c
MdePkg: Change OPTIONAL keyword usage style
[mirror_edk2.git] / MdePkg / Library / BaseLib / X86EnablePaging64.c
CommitLineData
e1f414b6 1/** @file\r
2 IA-32/x64 AsmEnablePaging64()\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 Enables the 64-bit paging mode on the CPU.\r
16\r
17 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
18 must be properly initialized prior to calling this service. This function\r
19 assumes the current execution mode is 32-bit protected mode with flat\r
20 descriptors. This function is only available on IA-32. After the 64-bit\r
21 paging mode is enabled, control is transferred to the function specified by\r
22 EntryPoint using the new stack specified by NewStack and passing in the\r
23 parameters specified by Context1 and Context2. Context1 and Context2 are\r
24 optional and may be 0. The function EntryPoint must never return.\r
25\r
26 If the current execution mode is not 32-bit protected mode with flat\r
27 descriptors, then ASSERT().\r
28 If EntryPoint is 0, then ASSERT().\r
29 If NewStack is 0, then ASSERT().\r
30\r
31 @param Cs The 16-bit selector to load in the CS before EntryPoint\r
32 is called. The descriptor in the GDT that this selector\r
33 references must be setup for long mode.\r
34 @param EntryPoint The 64-bit virtual address of the function to call with\r
35 the new stack after paging is enabled.\r
36 @param Context1 The 64-bit virtual address of the context to pass into\r
37 the EntryPoint function as the first parameter after\r
38 paging is enabled.\r
39 @param Context2 The 64-bit virtual address of the context to pass into\r
40 the EntryPoint function as the second parameter after\r
41 paging is enabled.\r
42 @param NewStack The 64-bit virtual address of the new stack to use for\r
43 the EntryPoint function after paging is enabled.\r
44\r
45**/\r
46VOID\r
47EFIAPI\r
48AsmEnablePaging64 (\r
49 IN UINT16 Cs,\r
50 IN UINT64 EntryPoint,\r
d0e2f823
MK
51 IN UINT64 Context1 OPTIONAL,\r
52 IN UINT64 Context2 OPTIONAL,\r
e1f414b6 53 IN UINT64 NewStack\r
54 )\r
55{\r
56 ASSERT (EntryPoint != 0);\r
57 ASSERT (NewStack != 0);\r
58 InternalX86EnablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r
59}\r