]>
Commit | Line | Data |
---|---|---|
65960189 LG |
1 | ;------------------------------------------------------------------------------\r |
2 | ;\r | |
3 | ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
4 | ; Portions copyright (c) 2011, Apple Inc. All rights reserved.<BR>\r | |
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.nasm\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 | SECTION .text\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 | global ASM_PFX(InternalSwitchStack)\r | |
36 | ASM_PFX(InternalSwitchStack):\r | |
37 | push ebp\r | |
38 | mov ebp, esp\r | |
39 | \r | |
40 | mov esp, [ebp + 20] ; switch stack\r | |
41 | sub esp, 8\r | |
42 | mov eax, [ebp + 16]\r | |
43 | mov [esp + 4], eax\r | |
44 | mov eax, [ebp + 12]\r | |
45 | mov [esp], eax\r | |
46 | push 0 ; keeps gdb from unwinding stack\r | |
47 | jmp dword [ebp + 8] ; call and never return\r |