]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
1. Port X64, IPF and EBC arch for BaseLib
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / EnablePaging32.c
1 /** @file
2 AsmEnablePaging32 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 InternalX86EnablePaging32 (
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
40 cli
41 mov eax, cr0
42 bts eax, 31
43 mov esp, NewStack
44 mov cr0, eax
45 push edi
46 popfd
47 push edx
48 push ecx
49 call ebx
50 jmp $
51 }
52 }
53
54 #endif