]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | IA-32/x64 AsmDisablePaging32()\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 | |
e1f414b6 | 9 | #include "BaseLibInternals.h"\r |
10 | \r | |
11 | /**\r | |
12 | Disables the 32-bit paging mode on the CPU.\r | |
13 | \r | |
14 | Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r | |
15 | mode. This function assumes the current execution mode is 32-paged protected\r | |
16 | mode. This function is only available on IA-32. After the 32-bit paging mode\r | |
17 | is disabled, control is transferred to the function specified by EntryPoint\r | |
18 | using the new stack specified by NewStack and passing in the parameters\r | |
19 | specified by Context1 and Context2. Context1 and Context2 are optional and\r | |
20 | may be NULL. The function EntryPoint must never return.\r | |
21 | \r | |
22 | If the current execution mode is not 32-bit paged mode, then ASSERT().\r | |
23 | If EntryPoint is NULL, then ASSERT().\r | |
24 | If NewStack is NULL, then ASSERT().\r | |
25 | \r | |
26 | There are a number of constraints that must be followed before calling this\r | |
27 | function:\r | |
28 | 1) Interrupts must be disabled.\r | |
29 | 2) The caller must be in 32-bit paged mode.\r | |
30 | 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r | |
31 | 4) CR3 must point to valid page tables that guarantee that the pages for\r | |
32 | this function and the stack are identity mapped.\r | |
33 | \r | |
34 | @param EntryPoint A pointer to function to call with the new stack after\r | |
35 | paging is disabled.\r | |
36 | @param Context1 A pointer to the context to pass into the EntryPoint\r | |
37 | function as the first parameter after paging is disabled.\r | |
38 | @param Context2 A pointer to the context to pass into the EntryPoint\r | |
39 | function as the second parameter after paging is\r | |
40 | disabled.\r | |
41 | @param NewStack A pointer to the new stack to use for the EntryPoint\r | |
42 | function after paging is disabled.\r | |
43 | \r | |
44 | **/\r | |
45 | VOID\r | |
46 | EFIAPI\r | |
47 | AsmDisablePaging32 (\r | |
48 | IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
d0e2f823 MK |
49 | IN VOID *Context1 OPTIONAL,\r |
50 | IN VOID *Context2 OPTIONAL,\r | |
e1f414b6 | 51 | IN VOID *NewStack\r |
52 | )\r | |
53 | {\r | |
54 | ASSERT (EntryPoint != NULL);\r | |
55 | ASSERT (NewStack != NULL);\r | |
56 | InternalX86DisablePaging32 (EntryPoint, Context1, Context2, NewStack);\r | |
57 | }\r |