]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/X64/Non-existing.c
1. added functions header for BaseUefiDecompressLi
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / Non-existing.c
CommitLineData
878ddf1f 1/** @file\r
24e25d11 2 Non-existing BaseLib functions on x64\r
878ddf1f 3\r
24e25d11 4 Copyright (c) 2006, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
878ddf1f 9\r
24e25d11 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
878ddf1f 12\r
24e25d11 13 Module Name: Non-existing.c\r
878ddf1f 14\r
15**/\r
16\r
17#include "../BaseLibInternals.h"\r
18\r
1ea5ca46 19/**\r
20 Enables the 32-bit paging mode on the CPU.\r
21\r
22 Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
23 must be properly initialized prior to calling this service. This function\r
24 assumes the current execution mode is 32-bit protected mode. This function is\r
25 only available on IA-32. After the 32-bit paging mode is enabled, control is\r
26 transferred to the function specified by EntryPoint using the new stack\r
27 specified by NewStack and passing in the parameters specified by Context1 and\r
28 Context2. Context1 and Context2 are optional and may be NULL. The function\r
29 EntryPoint must never return.\r
30\r
31 There are a number of constraints that must be followed before calling this\r
32 function:\r
33 1) Interrupts must be disabled.\r
34 2) The caller must be in 32-bit protected mode with flat descriptors. This\r
35 means all descriptors must have a base of 0 and a limit of 4GB.\r
36 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
37 descriptors.\r
38 4) CR3 must point to valid page tables that will be used once the transition\r
39 is complete, and those page tables must guarantee that the pages for this\r
40 function and the stack are identity mapped.\r
41\r
42 @param EntryPoint A pointer to function to call with the new stack after\r
43 paging is enabled.\r
44 @param Context1 A pointer to the context to pass into the EntryPoint\r
45 function as the first parameter after paging is enabled.\r
46 @param Context2 A pointer to the context to pass into the EntryPoint\r
47 function as the second parameter after paging is enabled.\r
48 @param NewStack A pointer to the new stack to use for the EntryPoint\r
49 function after paging is enabled.\r
50\r
51**/\r
878ddf1f 52VOID\r
53EFIAPI\r
54InternalX86EnablePaging32 (\r
55 IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
56 IN VOID *Context1, OPTIONAL\r
57 IN VOID *Context2, OPTIONAL\r
58 IN VOID *NewStack\r
59 )\r
60{\r
1ea5ca46 61 //\r
62 // This function cannot work on X64 platform\r
63 //\r
878ddf1f 64 ASSERT (FALSE);\r
65}\r
66\r
1ea5ca46 67/**\r
68 Disables the 32-bit paging mode on the CPU.\r
69\r
70 Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
71 mode. This function assumes the current execution mode is 32-paged protected\r
72 mode. This function is only available on IA-32. After the 32-bit paging mode\r
73 is disabled, control is transferred to the function specified by EntryPoint\r
74 using the new stack specified by NewStack and passing in the parameters\r
75 specified by Context1 and Context2. Context1 and Context2 are optional and\r
76 may be NULL. The function EntryPoint must never return.\r
77\r
78 There are a number of constraints that must be followed before calling this\r
79 function:\r
80 1) Interrupts must be disabled.\r
81 2) The caller must be in 32-bit paged mode.\r
82 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
83 4) CR3 must point to valid page tables that guarantee that the pages for\r
84 this function and the stack are identity mapped.\r
85\r
86 @param EntryPoint A pointer to function to call with the new stack after\r
87 paging is disabled.\r
88 @param Context1 A pointer to the context to pass into the EntryPoint\r
89 function as the first parameter after paging is disabled.\r
90 @param Context2 A pointer to the context to pass into the EntryPoint\r
91 function as the second parameter after paging is\r
92 disabled.\r
93 @param NewStack A pointer to the new stack to use for the EntryPoint\r
94 function after paging is disabled.\r
95\r
96**/\r
878ddf1f 97VOID\r
98EFIAPI\r
99InternalX86DisablePaging32 (\r
100 IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
101 IN VOID *Context1, OPTIONAL\r
102 IN VOID *Context2, OPTIONAL\r
103 IN VOID *NewStack\r
104 )\r
105{\r
1ea5ca46 106 //\r
107 // This function cannot work on X64 platform\r
108 //\r
878ddf1f 109 ASSERT (FALSE);\r
110}\r
111\r
1ea5ca46 112/**\r
113 Enables the 64-bit paging mode on the CPU.\r
114\r
115 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
116 must be properly initialized prior to calling this service. This function\r
117 assumes the current execution mode is 32-bit protected mode with flat\r
118 descriptors. This function is only available on IA-32. After the 64-bit\r
119 paging mode is enabled, control is transferred to the function specified by\r
120 EntryPoint using the new stack specified by NewStack and passing in the\r
121 parameters specified by Context1 and Context2. Context1 and Context2 are\r
122 optional and may be 0. The function EntryPoint must never return.\r
123\r
124 @param Cs The 16-bit selector to load in the CS before EntryPoint\r
125 is called. The descriptor in the GDT that this selector\r
126 references must be setup for long mode.\r
127 @param EntryPoint The 64-bit virtual address of the function to call with\r
128 the new stack after paging is enabled.\r
129 @param Context1 The 64-bit virtual address of the context to pass into\r
130 the EntryPoint function as the first parameter after\r
131 paging is enabled.\r
132 @param Context2 The 64-bit virtual address of the context to pass into\r
133 the EntryPoint function as the second parameter after\r
134 paging is enabled.\r
135 @param NewStack The 64-bit virtual address of the new stack to use for\r
136 the EntryPoint function after paging is enabled.\r
137\r
138**/\r
878ddf1f 139VOID\r
140EFIAPI\r
141InternalX86EnablePaging64 (\r
142 IN UINT16 Cs,\r
143 IN UINT64 EntryPoint,\r
144 IN UINT64 Context1, OPTIONAL\r
145 IN UINT64 Context2, OPTIONAL\r
146 IN UINT64 NewStack\r
147 )\r
148{\r
1ea5ca46 149 //\r
150 // This function cannot work on X64 platform\r
151 //\r
878ddf1f 152 ASSERT (FALSE);\r
153}\r