]>
Commit | Line | Data |
---|---|---|
bab427db | 1 | #------------------------------------------------------------------------------\r |
2 | #\r | |
3 | # Copyright (c) 2006 - 2008, 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 | |
23 | ASM_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 | |
35 | ASM_PFX(InternalSwitchStack):\r | |
36 | pushl %ebp\r | |
37 | movl %esp, %ebp\r | |
38 | \r | |
39 | movl 20(%ebp), %esp # switch stack\r | |
40 | subl $8, %esp\r | |
41 | \r | |
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 | |
48 | \r |