xref: /DragonStub/lib/ia32/setjmp.S (revision 8071303f52f376de3357b223ce8905598de1f913)
1/*
2 * Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
3 * This program and the accompanying materials are licensed and made
4available
5 * under the terms and conditions of the BSD License which accompanies
6this
7 * distribution.  The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php.
9 *
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
11BASIS,
12 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
13 * IMPLIED.
14 */
15	.text
16	.globl	setjmp
17#ifndef __MINGW32__
18	.type setjmp, @function
19#else
20	.def setjmp; .scl 2; .type 32; .endef
21#endif
22setjmp:
23	pop	%ecx
24	movl	(%esp), %edx
25	movl	%ebx, (%edx)
26	movl	%esi, 4(%edx)
27	movl	%edi, 8(%edx)
28	movl	%ebp, 12(%edx)
29	movl	%esp, 16(%edx)
30	xorl	%eax, %eax
31	jmp	*%ecx
32
33	.globl	longjmp
34#ifndef __MINGW32__
35	.type	longjmp, @function
36#else
37	.def longjmp; .scl 2; .type 32; .endef
38#endif
39longjmp:
40	pop	%eax
41	pop	%edx
42	pop	%eax
43	movl	(%edx), %ebx
44	movl	4(%edx), %esi
45	movl	8(%edx), %edi
46