]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | IA-32/x64 AsmEnablePaging64()\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 | |
127010dd | 8 | http://opensource.org/licenses/bsd-license.php.\r |
e1f414b6 | 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 | Enables the 64-bit paging mode on the CPU.\r | |
22 | \r | |
23 | Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r | |
24 | must be properly initialized prior to calling this service. This function\r | |
25 | assumes the current execution mode is 32-bit protected mode with flat\r | |
26 | descriptors. This function is only available on IA-32. After the 64-bit\r | |
27 | paging mode is enabled, control is transferred to the function specified by\r | |
28 | EntryPoint using the new stack specified by NewStack and passing in the\r | |
29 | parameters specified by Context1 and Context2. Context1 and Context2 are\r | |
30 | optional and may be 0. The function EntryPoint must never return.\r | |
31 | \r | |
32 | If the current execution mode is not 32-bit protected mode with flat\r | |
33 | descriptors, then ASSERT().\r | |
34 | If EntryPoint is 0, then ASSERT().\r | |
35 | If NewStack is 0, then ASSERT().\r | |
36 | \r | |
37 | @param Cs The 16-bit selector to load in the CS before EntryPoint\r | |
38 | is called. The descriptor in the GDT that this selector\r | |
39 | references must be setup for long mode.\r | |
40 | @param EntryPoint The 64-bit virtual address of the function to call with\r | |
41 | the new stack after paging is enabled.\r | |
42 | @param Context1 The 64-bit virtual address of the context to pass into\r | |
43 | the EntryPoint function as the first parameter after\r | |
44 | paging is enabled.\r | |
45 | @param Context2 The 64-bit virtual address of the context to pass into\r | |
46 | the EntryPoint function as the second parameter after\r | |
47 | paging is enabled.\r | |
48 | @param NewStack The 64-bit virtual address of the new stack to use for\r | |
49 | the EntryPoint function after paging is enabled.\r | |
50 | \r | |
51 | **/\r | |
52 | VOID\r | |
53 | EFIAPI\r | |
54 | AsmEnablePaging64 (\r | |
55 | IN UINT16 Cs,\r | |
56 | IN UINT64 EntryPoint,\r | |
57 | IN UINT64 Context1, OPTIONAL\r | |
58 | IN UINT64 Context2, OPTIONAL\r | |
59 | IN UINT64 NewStack\r | |
60 | )\r | |
61 | {\r | |
62 | ASSERT (EntryPoint != 0);\r | |
63 | ASSERT (NewStack != 0);\r | |
64 | InternalX86EnablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r | |
65 | }\r |