TianoCore EDK2 master
Loading...
Searching...
No Matches
DisablePaging32.c
Go to the documentation of this file.
1
9#include "BaseLibInternals.h"
10
42VOID
43EFIAPI
46 IN VOID *Context1 OPTIONAL,
47 IN VOID *Context2 OPTIONAL,
48 IN VOID *NewStack
49 )
50{
51 _asm {
52 push ebp
53 mov ebp, esp
54 mov ebx, EntryPoint
55 mov ecx, Context1
56 mov edx, Context2
57 pushfd
58 pop edi // save EFLAGS to edi
59 cli
60 mov eax, cr0
61 btr eax, 31
62 mov esp, NewStack
63 mov cr0, eax
64 push edi
65 popfd // restore EFLAGS from edi
66 push edx
67 push ecx
68 call ebx
69 jmp $ // EntryPoint() should not return
70 }
71}
VOID(EFIAPI * SWITCH_STACK_ENTRY_POINT)(IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL)
Definition: BaseLib.h:5019
__declspec(naked)
#define IN
Definition: Base.h:279
VOID EFIAPI InternalX86DisablePaging32(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack)
Definition: Non-existing.c:92