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