]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/X64/Non-existing.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / Non-existing.c
CommitLineData
f1baef62 1/** @file\r
2 Non-existing BaseLib functions on x64\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
f1baef62 6\r
f1baef62 7**/\r
8\r
83584954 9#include <Library/BaseLib.h>\r
10#include <Library/DebugLib.h>\r
f1baef62 11\r
12/**\r
13 Enables the 32-bit paging mode on the CPU.\r
14\r
15 Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
16 must be properly initialized prior to calling this service. This function\r
17 assumes the current execution mode is 32-bit protected mode. This function is\r
18 only available on IA-32. After the 32-bit paging mode is enabled, control is\r
19 transferred to the function specified by EntryPoint using the new stack\r
20 specified by NewStack and passing in the parameters specified by Context1 and\r
21 Context2. Context1 and Context2 are optional and may be NULL. The function\r
22 EntryPoint must never return.\r
23\r
24 There are a number of constraints that must be followed before calling this\r
25 function:\r
26 1) Interrupts must be disabled.\r
27 2) The caller must be in 32-bit protected mode with flat descriptors. This\r
28 means all descriptors must have a base of 0 and a limit of 4GB.\r
29 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
30 descriptors.\r
31 4) CR3 must point to valid page tables that will be used once the transition\r
32 is complete, and those page tables must guarantee that the pages for this\r
33 function and the stack are identity mapped.\r
34\r
35 @param EntryPoint A pointer to function to call with the new stack after\r
36 paging is enabled.\r
37 @param Context1 A pointer to the context to pass into the EntryPoint\r
38 function as the first parameter after paging is enabled.\r
39 @param Context2 A pointer to the context to pass into the EntryPoint\r
40 function as the second parameter after paging is enabled.\r
41 @param NewStack A pointer to the new stack to use for the EntryPoint\r
42 function after paging is enabled.\r
43\r
44**/\r
45VOID\r
46EFIAPI\r
47InternalX86EnablePaging32 (\r
48 IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
49 IN VOID *Context1, OPTIONAL\r
50 IN VOID *Context2, OPTIONAL\r
51 IN VOID *NewStack\r
52 )\r
53{\r
54 //\r
83584954 55 // This function cannot work on x64 platform\r
f1baef62 56 //\r
57 ASSERT (FALSE);\r
58}\r
59\r
60/**\r
61 Disables the 32-bit paging mode on the CPU.\r
62\r
63 Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
64 mode. This function assumes the current execution mode is 32-paged protected\r
65 mode. This function is only available on IA-32. After the 32-bit paging mode\r
66 is disabled, control is transferred to the function specified by EntryPoint\r
67 using the new stack specified by NewStack and passing in the parameters\r
68 specified by Context1 and Context2. Context1 and Context2 are optional and\r
69 may be NULL. The function EntryPoint must never return.\r
70\r
71 There are a number of constraints that must be followed before calling this\r
72 function:\r
73 1) Interrupts must be disabled.\r
74 2) The caller must be in 32-bit paged mode.\r
75 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
76 4) CR3 must point to valid page tables that guarantee that the pages for\r
77 this function and the stack are identity mapped.\r
78\r
79 @param EntryPoint A pointer to function to call with the new stack after\r
80 paging is disabled.\r
81 @param Context1 A pointer to the context to pass into the EntryPoint\r
82 function as the first parameter after paging is disabled.\r
83 @param Context2 A pointer to the context to pass into the EntryPoint\r
84 function as the second parameter after paging is\r
85 disabled.\r
86 @param NewStack A pointer to the new stack to use for the EntryPoint\r
87 function after paging is disabled.\r
88\r
89**/\r
90VOID\r
91EFIAPI\r
92InternalX86DisablePaging32 (\r
93 IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
94 IN VOID *Context1, OPTIONAL\r
95 IN VOID *Context2, OPTIONAL\r
96 IN VOID *NewStack\r
97 )\r
98{\r
99 //\r
83584954 100 // This function cannot work on x64 platform\r
f1baef62 101 //\r
102 ASSERT (FALSE);\r
103}\r
744e71a3 104\r
105\r
106/**\r
107 Enables the 64-bit paging mode on the CPU.\r
108\r
109 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
110 must be properly initialized prior to calling this service. This function\r
111 assumes the current execution mode is 32-bit protected mode with flat\r
112 descriptors. This function is only available on IA-32. After the 64-bit\r
113 paging mode is enabled, control is transferred to the function specified by\r
114 EntryPoint using the new stack specified by NewStack and passing in the\r
115 parameters specified by Context1 and Context2. Context1 and Context2 are\r
116 optional and may be 0. The function EntryPoint must never return.\r
117\r
118 @param Cs The 16-bit selector to load in the CS before EntryPoint\r
119 is called. The descriptor in the GDT that this selector\r
120 references must be setup for long mode.\r
121 @param EntryPoint The 64-bit virtual address of the function to call with\r
122 the new stack after paging is enabled.\r
123 @param Context1 The 64-bit virtual address of the context to pass into\r
124 the EntryPoint function as the first parameter after\r
125 paging is enabled.\r
126 @param Context2 The 64-bit virtual address of the context to pass into\r
127 the EntryPoint function as the second parameter after\r
128 paging is enabled.\r
129 @param NewStack The 64-bit virtual address of the new stack to use for\r
130 the EntryPoint function after paging is enabled.\r
131\r
132**/\r
133VOID\r
134EFIAPI\r
135InternalX86EnablePaging64 (\r
136 IN UINT16 Cs,\r
137 IN UINT64 EntryPoint,\r
138 IN UINT64 Context1, OPTIONAL\r
139 IN UINT64 Context2, OPTIONAL\r
140 IN UINT64 NewStack\r
141 )\r
142{\r
143 //\r
144 // This function cannot work on x64 platform.\r
145 //\r
146 ASSERT (FALSE);\r
147}\r