]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.asm
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / DisablePaging32.asm
1 ; Copyright (c) 2004, Intel Corporation
2 ; All rights reserved. This program and the accompanying materials
3 ; are licensed and made available under the terms and conditions of the BSD License
4 ; which accompanies this distribution. The full text of the license may be found at
5 ; http://opensource.org/licenses/bsd-license.php
6 ;
7 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
8 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
9 ;
10 ; Module Name:
11 ;
12 ; DisablePaging32.Asm
13 ;
14 ; Abstract:
15 ;
16 ; AsmDisablePaging32 function
17 ;
18 ; Notes:
19 ;
20 ;------------------------------------------------------------------------------
21
22 .386
23 .model flat,C
24 .code
25
26 ;------------------------------------------------------------------------------
27 ; VOID
28 ; EFIAPI
29 ; InternalX86DisablePaging32 (
30 ; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
31 ; IN VOID *Context1, OPTIONAL
32 ; IN VOID *Context2, OPTIONAL
33 ; IN VOID *NewStack
34 ; );
35 ;------------------------------------------------------------------------------
36 InternalX86DisablePaging32 PROC
37 mov ebx, [esp + 4]
38 mov ecx, [esp + 8]
39 mov edx, [esp + 12]
40 pushfd
41 pop edi ; save EFLAGS to edi
42 cli
43 mov eax, cr0
44 btr eax, 31
45 mov esp, [esp + 16]
46 mov cr0, eax
47 push edi
48 popfd ; restore EFLAGS from edi
49 push edx
50 push ecx
51 call ebx
52 jmp $ ; EntryPoint() should not return
53 InternalX86DisablePaging32 ENDP
54
55 END