]> git.proxmox.com Git - mirror_edk2.git/blame - OldMdePkg/Library/BaseLib/X64/Non-existing.c
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / 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