]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / DisablePaging32.c
1 /** @file
2 AsmDisablePaging32 function.
3
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 //
16 // Include common header file for this module.
17 //
18 #include <BaseLibInternals.h>
19
20 #if _MSC_EXTENSIONS
21
22 __declspec (naked)
23 VOID
24 EFIAPI
25 InternalX86DisablePaging32 (
26 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
27 IN VOID *Context1, OPTIONAL
28 IN VOID *Context2, OPTIONAL
29 IN VOID *NewStack
30 )
31 {
32 _asm {
33 push ebp
34 mov ebp, esp
35 mov ebx, EntryPoint
36 mov ecx, Context1
37 mov edx, Context2
38 pushfd
39 pop edi // save EFLAGS to edi
40 cli
41 mov eax, cr0
42 btr eax, 31
43 mov esp, NewStack
44 mov cr0, eax
45 push edi
46 popfd // restore EFLAGS from edi
47 push edx
48 push ecx
49 call ebx
50 jmp $ // EntryPoint() should not return
51 }
52 }
53
54 #endif