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