1 1.2 cgd /* $NetBSD: __sigsetjmp14.S,v 1.2 2000/06/14 06:49:01 cgd Exp $ */ 2 1.1 thorpej 3 1.1 thorpej /* 4 1.1 thorpej * Copyright (c) 1994, 1995 Carnegie-Mellon University. 5 1.1 thorpej * All rights reserved. 6 1.1 thorpej * 7 1.1 thorpej * Author: Chris G. Demetriou 8 1.1 thorpej * 9 1.1 thorpej * Permission to use, copy, modify and distribute this software and 10 1.1 thorpej * its documentation is hereby granted, provided that both the copyright 11 1.1 thorpej * notice and this permission notice appear in all copies of the 12 1.1 thorpej * software, derivative works or modified versions, and any portions 13 1.1 thorpej * thereof, and that both notices appear in supporting documentation. 14 1.1 thorpej * 15 1.1 thorpej * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 16 1.1 thorpej * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 17 1.1 thorpej * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 18 1.1 thorpej * 19 1.1 thorpej * Carnegie Mellon requests users of this software to return to 20 1.1 thorpej * 21 1.1 thorpej * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU 22 1.1 thorpej * School of Computer Science 23 1.1 thorpej * Carnegie Mellon University 24 1.1 thorpej * Pittsburgh PA 15213-3890 25 1.1 thorpej * 26 1.1 thorpej * any improvements or extensions that they make and grant Carnegie the 27 1.1 thorpej * rights to redistribute these changes. 28 1.1 thorpej */ 29 1.1 thorpej 30 1.1 thorpej #include <machine/asm.h> 31 1.1 thorpej 32 1.1 thorpej /* 33 1.1 thorpej * C library -- sigsetjmp, siglongjmp 34 1.1 thorpej * 35 1.1 thorpej * siglongjmp(a,v) 36 1.1 thorpej * will generate a "return(v)" from 37 1.1 thorpej * the last call to 38 1.1 thorpej * sigsetjmp(a, mask) 39 1.1 thorpej * by restoring registers from the stack. 40 1.1 thorpej * If `mask' is non-zero, the previous signal 41 1.1 thorpej * state will be restored. 42 1.1 thorpej */ 43 1.1 thorpej 44 1.1 thorpej .set noreorder 45 1.1 thorpej 46 1.1 thorpej LEAF(__sigsetjmp14, 2) 47 1.1 thorpej LDGP(pv) 48 1.1 thorpej stq a1, (83 * 8)(a0) /* save the mask */ 49 1.1 thorpej bne a1, Lsavesig /* if !zero, save signals */ 50 1.1 thorpej jmp zero, _setjmp /* else don't. */ 51 1.1 thorpej Lsavesig: 52 1.1 thorpej jmp zero, __setjmp14 53 1.1 thorpej END(__sigsetjmp14) 54 1.1 thorpej 55 1.1 thorpej LEAF(__siglongjmp14, 2) 56 1.1 thorpej LDGP(pv) 57 1.1 thorpej ldq t0, (83 * 8)(a0) /* get the mask */ 58 1.1 thorpej bne t0, Lrestoresig /* if !zero, restore signals */ 59 1.1 thorpej jmp zero, _longjmp 60 1.1 thorpej Lrestoresig: 61 1.1 thorpej jmp zero, __longjmp14 62 1.1 thorpej END(__siglongjmp14) 63