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