]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004 - 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | x86DisablePaging64.c\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | IA-32/x64 specific functions.\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
c7f33ca4 | 23 | #include "BaseLibInternals.h"\r |
3eb9473e | 24 | \r |
25 | /**\r | |
26 | Disables the 64-bit paging mode on the CPU.\r | |
27 | \r | |
28 | Disables the 64-bit paging mode on the CPU and returns to 32-bit protected\r | |
29 | mode. This function assumes the current execution mode is 64-paging mode.\r | |
30 | This function is only available on X64. After the 64-bit paging mode is\r | |
31 | disabled, control is transferred to the function specified by EntryPoint\r | |
32 | using the new stack specified by NewStack and passing in the parameters\r | |
33 | specified by Context1 and Context2. Context1 and Context2 are optional and\r | |
34 | may be 0. The function EntryPoint must never return.\r | |
35 | \r | |
36 | If the current execution mode is not 64-bit paged mode, then ASSERT().\r | |
37 | If EntryPoint is 0, then ASSERT().\r | |
38 | If NewStack is 0, then ASSERT().\r | |
39 | \r | |
40 | @param Cs The 16-bit selector to load in the CS before EntryPoint\r | |
41 | is called. The descriptor in the GDT that this selector\r | |
42 | references must be setup for 32-bit protected mode.\r | |
43 | @param EntryPoint The 64-bit virtual address of the function to call with\r | |
44 | the new stack after paging is disabled.\r | |
45 | @param Context1 The 64-bit virtual address of the context to pass into\r | |
46 | the EntryPoint function as the first parameter after\r | |
47 | paging is disabled.\r | |
48 | @param Context2 The 64-bit virtual address of the context to pass into\r | |
49 | the EntryPoint function as the second parameter after\r | |
50 | paging is disabled.\r | |
51 | @param NewStack The 64-bit virtual address of the new stack to use for\r | |
52 | the EntryPoint function after paging is disabled.\r | |
53 | \r | |
54 | **/\r | |
55 | VOID\r | |
56 | EFIAPI\r | |
57 | AsmDisablePaging64 (\r | |
58 | IN UINT16 Cs,\r | |
59 | IN UINT32 EntryPoint,\r | |
60 | IN UINT32 Context1, OPTIONAL\r | |
61 | IN UINT32 Context2, OPTIONAL\r | |
62 | IN UINT32 NewStack\r | |
63 | )\r | |
64 | {\r | |
65 | ASSERT (EntryPoint != 0);\r | |
66 | ASSERT (NewStack != 0);\r | |
67 | InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r | |
68 | }\r |