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