1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
4 ; Portions copyright (c) 2011, Apple Inc. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
9 ; InternalSwitchStack.nasm
13 ; Implementation of a stack switch on IA-32.
15 ;------------------------------------------------------------------------------
19 ;------------------------------------------------------------------------------
22 ; InternalSwitchStack (
23 ; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
24 ; IN VOID *Context1, OPTIONAL
25 ; IN VOID *Context2, OPTIONAL
28 ;------------------------------------------------------------------------------
29 global ASM_PFX(InternalSwitchStack)
30 ASM_PFX(InternalSwitchStack):
34 mov esp, [ebp + 20] ; switch stack
40 push 0 ; keeps gdb from unwinding stack
41 jmp dword [ebp + 8] ; call and never return