1*d220ca5bScgd/* $NetBSD: __sigsetjmp14.S,v 1.2 2000/06/14 06:49:01 cgd Exp $ */ 22af42e07Sthorpej 32af42e07Sthorpej/* 42af42e07Sthorpej * Copyright (c) 1994, 1995 Carnegie-Mellon University. 52af42e07Sthorpej * All rights reserved. 62af42e07Sthorpej * 72af42e07Sthorpej * Author: Chris G. Demetriou 82af42e07Sthorpej * 92af42e07Sthorpej * Permission to use, copy, modify and distribute this software and 102af42e07Sthorpej * its documentation is hereby granted, provided that both the copyright 112af42e07Sthorpej * notice and this permission notice appear in all copies of the 122af42e07Sthorpej * software, derivative works or modified versions, and any portions 132af42e07Sthorpej * thereof, and that both notices appear in supporting documentation. 142af42e07Sthorpej * 152af42e07Sthorpej * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 162af42e07Sthorpej * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 172af42e07Sthorpej * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 182af42e07Sthorpej * 192af42e07Sthorpej * Carnegie Mellon requests users of this software to return to 202af42e07Sthorpej * 212af42e07Sthorpej * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 222af42e07Sthorpej * School of Computer Science 232af42e07Sthorpej * Carnegie Mellon University 242af42e07Sthorpej * Pittsburgh PA 15213-3890 252af42e07Sthorpej * 262af42e07Sthorpej * any improvements or extensions that they make and grant Carnegie the 272af42e07Sthorpej * rights to redistribute these changes. 282af42e07Sthorpej */ 292af42e07Sthorpej 302af42e07Sthorpej#include <machine/asm.h> 312af42e07Sthorpej 322af42e07Sthorpej/* 332af42e07Sthorpej * C library -- sigsetjmp, siglongjmp 342af42e07Sthorpej * 352af42e07Sthorpej * siglongjmp(a,v) 362af42e07Sthorpej * will generate a "return(v)" from 372af42e07Sthorpej * the last call to 382af42e07Sthorpej * sigsetjmp(a, mask) 392af42e07Sthorpej * by restoring registers from the stack. 402af42e07Sthorpej * If `mask' is non-zero, the previous signal 412af42e07Sthorpej * state will be restored. 422af42e07Sthorpej */ 432af42e07Sthorpej 442af42e07Sthorpej .set noreorder 452af42e07Sthorpej 462af42e07SthorpejLEAF(__sigsetjmp14, 2) 472af42e07Sthorpej LDGP(pv) 482af42e07Sthorpej stq a1, (83 * 8)(a0) /* save the mask */ 492af42e07Sthorpej bne a1, Lsavesig /* if !zero, save signals */ 502af42e07Sthorpej jmp zero, _setjmp /* else don't. */ 512af42e07SthorpejLsavesig: 522af42e07Sthorpej jmp zero, __setjmp14 532af42e07SthorpejEND(__sigsetjmp14) 542af42e07Sthorpej 552af42e07SthorpejLEAF(__siglongjmp14, 2) 562af42e07Sthorpej LDGP(pv) 572af42e07Sthorpej ldq t0, (83 * 8)(a0) /* get the mask */ 582af42e07Sthorpej bne t0, Lrestoresig /* if !zero, restore signals */ 592af42e07Sthorpej jmp zero, _longjmp 602af42e07SthorpejLrestoresig: 612af42e07Sthorpej jmp zero, __longjmp14 622af42e07SthorpejEND(__siglongjmp14) 63