]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.S
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / InternalSwitchStack.S
CommitLineData
bab427db 1#------------------------------------------------------------------------------\r
2#\r
9095d37b 3# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
4223e4f4 4# Portions copyright (c) 2011, Apple Inc. All rights reserved.<BR>\r
bab427db 5# This program and the accompanying materials\r
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php.\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12#\r
13# Module Name:\r
14#\r
15# InternalSwitchStack.S\r
16#\r
17# Abstract:\r
18#\r
19# Implementation of a stack switch on IA-32.\r
20#\r
21#------------------------------------------------------------------------------\r
22\r
23ASM_GLOBAL ASM_PFX(InternalSwitchStack)\r
24\r
25#------------------------------------------------------------------------------\r
26# VOID\r
27# EFIAPI\r
28# InternalSwitchStack (\r
29# IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
30# IN VOID *Context1, OPTIONAL\r
31# IN VOID *Context2, OPTIONAL\r
32# IN VOID *NewStack\r
33# );\r
34#------------------------------------------------------------------------------\r
35ASM_PFX(InternalSwitchStack):\r
36 pushl %ebp\r
9095d37b 37 movl %esp, %ebp\r
bab427db 38\r
9095d37b
LG
39 movl 20(%ebp), %esp # switch stack\r
40 subl $8, %esp\r
bab427db 41\r
9095d37b
LG
42 movl 16(%ebp), %eax\r
43 movl %eax, 4(%esp)\r
44 movl 12(%ebp), %eax\r
45 movl %eax, (%esp)\r
46 pushl $0 # keeps gdb from unwinding stack\r
47 jmp *8(%ebp) # call and never return\r
bab427db 48\r