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