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