TianoCore EDK2 master
Loading...
Searching...
No Matches
InternalSwitchStack.c
Go to the documentation of this file.
1
9#include "BaseLibInternals.h"
10
35VOID
36EFIAPI
39 IN VOID *Context1 OPTIONAL,
40 IN VOID *Context2 OPTIONAL,
41 IN VOID *NewStack,
42 IN VA_LIST Marker
43 )
44{
45 BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
46
47 JumpBuffer.Eip = (UINTN)EntryPoint;
48 JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID *);
49 JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
50 ((VOID **)JumpBuffer.Esp)[1] = Context1;
51 ((VOID **)JumpBuffer.Esp)[2] = Context2;
52
53 LongJump (&JumpBuffer, (UINTN)-1);
54}
UINT64 UINTN
VOID EFIAPI InternalSwitchStack(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack, IN VA_LIST Marker)
VOID(EFIAPI * SWITCH_STACK_ENTRY_POINT)(IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL)
Definition: BaseLib.h:5019
VOID EFIAPI LongJump(IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, IN UINTN Value)
Definition: LongJump.c:29
CHAR8 * VA_LIST
Definition: Base.h:643
#define IN
Definition: Base.h:279