]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | IA-32/x64 AsmDisablePaging64()\r | |
3 | \r | |
bb817c56 HT |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
e1f414b6 | 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 | |
9 | \r | |
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 | |
12 | \r | |
e1f414b6 | 13 | **/\r |
14 | \r | |
1efcc4ae | 15 | \r |
f734a10a | 16 | \r |
e1f414b6 | 17 | \r |
18 | #include "BaseLibInternals.h"\r | |
19 | \r | |
20 | /**\r | |
21 | Disables the 64-bit paging mode on the CPU.\r | |
22 | \r | |
23 | Disables the 64-bit paging mode on the CPU and returns to 32-bit protected\r | |
24 | mode. This function assumes the current execution mode is 64-paging mode.\r | |
030cd1a2 | 25 | This function is only available on x64. After the 64-bit paging mode is\r |
e1f414b6 | 26 | disabled, control is transferred to the function specified by EntryPoint\r |
27 | using the new stack specified by NewStack and passing in the parameters\r | |
28 | specified by Context1 and Context2. Context1 and Context2 are optional and\r | |
29 | may be 0. The function EntryPoint must never return.\r | |
30 | \r | |
31 | If the current execution mode is not 64-bit paged mode, then ASSERT().\r | |
32 | If EntryPoint is 0, then ASSERT().\r | |
33 | If NewStack is 0, then ASSERT().\r | |
34 | \r | |
35 | @param Cs The 16-bit selector to load in the CS before EntryPoint\r | |
36 | is called. The descriptor in the GDT that this selector\r | |
37 | references must be setup for 32-bit protected mode.\r | |
38 | @param EntryPoint The 64-bit virtual address of the function to call with\r | |
39 | the new stack after paging is disabled.\r | |
40 | @param Context1 The 64-bit virtual address of the context to pass into\r | |
41 | the EntryPoint function as the first parameter after\r | |
42 | paging is disabled.\r | |
43 | @param Context2 The 64-bit virtual address of the context to pass into\r | |
44 | the EntryPoint function as the second parameter after\r | |
45 | paging is disabled.\r | |
46 | @param NewStack The 64-bit virtual address of the new stack to use for\r | |
47 | the EntryPoint function after paging is disabled.\r | |
48 | \r | |
49 | **/\r | |
50 | VOID\r | |
51 | EFIAPI\r | |
52 | AsmDisablePaging64 (\r | |
53 | IN UINT16 Cs,\r | |
54 | IN UINT32 EntryPoint,\r | |
55 | IN UINT32 Context1, OPTIONAL\r | |
56 | IN UINT32 Context2, OPTIONAL\r | |
57 | IN UINT32 NewStack\r | |
58 | )\r | |
59 | {\r | |
60 | ASSERT (EntryPoint != 0);\r | |
61 | ASSERT (NewStack != 0);\r | |
62 | InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r | |
63 | }\r |