]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.asm
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / SetJump.asm
CommitLineData
3eb9473e 1; Copyright (c) 2004, Intel Corporation \r
2; All rights reserved. This program and the accompanying materials \r
3; are licensed and made available under the terms and conditions of the BSD License \r
4; which accompanies this distribution. The full text of the license may be found at \r
5; http://opensource.org/licenses/bsd-license.php \r
6; \r
7; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
8; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
9;\r
10; Module Name:\r
11;\r
12; SetJump.Asm\r
13;\r
14; Abstract:\r
15;\r
16; Implementation of SetJump() on IA-32.\r
17;\r
18;------------------------------------------------------------------------------\r
19\r
20 .386\r
21 .model flat,C\r
22 .code\r
23\r
24InternalAssertJumpBuffer PROTO C\r
25\r
26;------------------------------------------------------------------------------\r
27; UINTN\r
28; EFIAPI\r
29; SetJump (\r
30; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r
31; );\r
32;------------------------------------------------------------------------------\r
33SetJump PROC\r
34 push [esp + 4]\r
35 call InternalAssertJumpBuffer ; To validate JumpBuffer\r
36 pop ecx\r
37 pop ecx ; ecx <- return address\r
38 mov edx, [esp]\r
39 mov [edx], ebx\r
40 mov [edx + 4], esi\r
41 mov [edx + 8], edi\r
42 mov [edx + 12], ebp\r
43 mov [edx + 16], esp\r
44 mov [edx + 20], ecx ; eip value to restore in LongJump\r
45 xor eax, eax\r
46 jmp ecx\r
47SetJump ENDP\r
48\r
49 END\r