11.1Smartin/* $NetBSD: sigsetjmp.S,v 1.1 2015/04/17 12:51:05 martin Exp $ */ 21.1Smartin 31.1Smartin/* 41.1Smartin * Copyright (c) 1994, 1995 Carnegie-Mellon University. 51.1Smartin * All rights reserved. 61.1Smartin * 71.1Smartin * Author: Chris G. Demetriou 81.1Smartin * 91.1Smartin * Permission to use, copy, modify and distribute this software and 101.1Smartin * its documentation is hereby granted, provided that both the copyright 111.1Smartin * notice and this permission notice appear in all copies of the 121.1Smartin * software, derivative works or modified versions, and any portions 131.1Smartin * thereof, and that both notices appear in supporting documentation. 141.1Smartin * 151.1Smartin * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 161.1Smartin * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 171.1Smartin * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 181.1Smartin * 191.1Smartin * Carnegie Mellon requests users of this software to return to 201.1Smartin * 211.1Smartin * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 221.1Smartin * School of Computer Science 231.1Smartin * Carnegie Mellon University 241.1Smartin * Pittsburgh PA 15213-3890 251.1Smartin * 261.1Smartin * any improvements or extensions that they make and grant Carnegie the 271.1Smartin * rights to redistribute these changes. 281.1Smartin */ 291.1Smartin 301.1Smartin#include <machine/asm.h> 311.1SmartinRCSID("$NetBSD: sigsetjmp.S,v 1.1 2015/04/17 12:51:05 martin Exp $"); 321.1Smartin 331.1Smartin#include <machine/setjmp.h> 341.1Smartin 351.1Smartin/* 361.1Smartin * C library -- sigsetjmp, siglongjmp 371.1Smartin * 381.1Smartin * siglongjmp(a,v) 391.1Smartin * will generate a "return(v)" from 401.1Smartin * the last call to 411.1Smartin * sigsetjmp(a, mask) 421.1Smartin * by restoring registers from the stack. 431.1Smartin * If `mask' is non-zero, the previous signal 441.1Smartin * state will be restored. 451.1Smartin */ 461.1Smartin 471.1SmartinENTRY(__sigsetjmp14, 2) 481.1Smartin add r14=J_SIGMASK,in0 // place to save mask 491.1Smartin cmp.ne p6,p7=0,in1 // save signal state? 501.1Smartin ;; 511.1Smartin st8 [r14]=in1 // save mask value 521.1Smartin(p6) br.cond.dptk.many __setjmp14 531.1Smartin(p7) br.cond.dpnt.many _setjmp 541.1SmartinEND(__sigsetjmp14) 551.1Smartin 561.1SmartinENTRY(__siglongjmp14, 2) 571.1Smartin add r14=J_SIGMASK,in0 // address of mask value 581.1Smartin ;; 591.1Smartin ld8 r14=[r14] 601.1Smartin ;; 611.1Smartin cmp.ne p6,p7=0,r14 // did we save signals? 621.1Smartin(p6) br.cond.dptk.many __longjmp14 631.1Smartin(p7) br.cond.dpnt.many _longjmp 641.1SmartinEND(__siglongjmp14) 65