]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/DisablePaging32.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / DisablePaging32.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; DisablePaging32.Asm
9 ;
10 ; Abstract:
11 ;
12 ; AsmDisablePaging32 function
13 ;
14 ; Notes:
15 ;
16 ;------------------------------------------------------------------------------
17
18 SECTION .text
19
20 ;------------------------------------------------------------------------------
21 ; VOID
22 ; EFIAPI
23 ; InternalX86DisablePaging32 (
24 ; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
25 ; IN VOID *Context1, OPTIONAL
26 ; IN VOID *Context2, OPTIONAL
27 ; IN VOID *NewStack
28 ; );
29 ;------------------------------------------------------------------------------
30 global ASM_PFX(InternalX86DisablePaging32)
31 ASM_PFX(InternalX86DisablePaging32):
32 mov ebx, [esp + 4]
33 mov ecx, [esp + 8]
34 mov edx, [esp + 12]
35 pushfd
36 pop edi ; save EFLAGS to edi
37 cli
38 mov eax, cr0
39 btr eax, 31
40 mov esp, [esp + 16]
41 mov cr0, eax
42 push edi
43 popfd ; restore EFLAGS from edi
44 push edx
45 push ecx
46 call ebx
47 jmp $ ; EntryPoint() should not return
48