Home | History | Annotate | Line # | Download | only in gen
sigsetjmp.S revision 1.5.10.1
      1  1.5.10.1  matt /*	$NetBSD: sigsetjmp.S,v 1.5.10.1 2007/11/06 23:11:09 matt Exp $	*/
      2       1.1    pk /*
      3       1.1    pk  * Copyright (c) 1995 Paul Kranenburg
      4       1.1    pk  * All rights reserved.
      5       1.1    pk  *
      6       1.1    pk  * Redistribution and use in source and binary forms, with or without
      7       1.1    pk  * modification, are permitted provided that the following conditions
      8       1.1    pk  * are met:
      9       1.1    pk  * 1. Redistributions of source code must retain the above copyright
     10       1.1    pk  *    notice, this list of conditions and the following disclaimer.
     11       1.1    pk  * 2. Redistributions in binary form must reproduce the above copyright
     12       1.1    pk  *    notice, this list of conditions and the following disclaimer in the
     13       1.1    pk  *    documentation and/or other materials provided with the distribution.
     14       1.1    pk  * 3. All advertising materials mentioning features or use of this software
     15       1.1    pk  *    must display the following acknowledgement:
     16       1.1    pk  *      This product includes software developed by Paul Kranenburg.
     17       1.1    pk  * 4. The name of the author may not be used to endorse or promote products
     18       1.1    pk  *    derived from this software without specific prior written permission
     19       1.1    pk  *
     20       1.1    pk  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21       1.1    pk  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22       1.1    pk  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23       1.1    pk  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24       1.1    pk  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25       1.1    pk  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26       1.1    pk  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27       1.1    pk  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28       1.1    pk  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29       1.1    pk  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30       1.1    pk  *
     31       1.1    pk  */
     32       1.1    pk 
     33       1.1    pk #include "SYS.h"
     34       1.1    pk 
     35       1.1    pk #ifdef PIC
     36       1.1    pk 
     37       1.5   uwe ENTRY(__sigsetjmp14)
     38  1.5.10.1  matt 	PIC_PROLOGUE(%g1, %g2)		! %g1 = _GLOBAL_OFFSET_TABLE
     39  1.5.10.1  matt 	tst	%o1
     40  1.5.10.1  matt 	bnz	1f
     41  1.5.10.1  matt 	 st	%o1, [%o0 + 56]		! jmpbuf[JBLEN] = savemask
     42  1.5.10.1  matt 
     43  1.5.10.1  matt 	!! if (savemask == 0) goto _setjmp
     44  1.5.10.1  matt 	set	_C_LABEL(_setjmp), %g2
     45  1.5.10.1  matt 	ld	[%g1 + %g2], %g1
     46       1.2    pk 	jmp %g1
     47  1.5.10.1  matt 	 nop
     48  1.5.10.1  matt 
     49  1.5.10.1  matt 	!! if (savemask != 0) goto setjmp
     50  1.5.10.1  matt 1:	set	_C_LABEL(__setjmp14), %g2
     51  1.5.10.1  matt 	ld	[%g1 + %g2], %g1
     52  1.5.10.1  matt 	jmp %g1
     53  1.5.10.1  matt 	 nop
     54  1.5.10.1  matt 
     55       1.1    pk 
     56       1.5   uwe ENTRY(__siglongjmp14)
     57  1.5.10.1  matt 	PIC_PROLOGUE(%g1, %g2)		! %g1 = _GLOBAL_OFFSET_TABLE
     58  1.5.10.1  matt 	ld	[%o0 + 56], %g2		! restoremask = jmpbuf[JBLEN]
     59  1.5.10.1  matt 	tst	%g2
     60  1.5.10.1  matt 	bnz	1f
     61  1.5.10.1  matt 	 nop
     62  1.5.10.1  matt 
     63  1.5.10.1  matt 	!! if (restoremask == 0) goto _longjmp
     64  1.5.10.1  matt 	set	_C_LABEL(_longjmp), %g2
     65  1.5.10.1  matt 	ld	[%g1 + %g2], %g1
     66       1.1    pk 	jmp %g1
     67  1.5.10.1  matt 	 nop
     68  1.5.10.1  matt 
     69  1.5.10.1  matt 	!! if (restoremask != 0) goto longjmp
     70  1.5.10.1  matt 1:	set	_C_LABEL(__longjmp14), %g2
     71  1.5.10.1  matt 	ld	[%g1 + %g2], %g1
     72  1.5.10.1  matt 	jmp %g1
     73  1.5.10.1  matt 	 nop
     74       1.2    pk 
     75  1.5.10.1  matt #else /* !PIC */
     76       1.1    pk 
     77       1.5   uwe ENTRY(__sigsetjmp14)
     78       1.1    pk 	cmp %o1,0
     79       1.3    tv 	be _C_LABEL(_setjmp)
     80       1.5   uwe 	st %o1,[%o0+56]		! jmpbuf[JBLEN]
     81       1.1    pk 	nop
     82       1.5   uwe 	ba,a _C_LABEL(__setjmp14)
     83       1.1    pk 	unimp 0
     84       1.1    pk 
     85       1.5   uwe ENTRY(__siglongjmp14)
     86       1.5   uwe 	ld [%o0+56],%g1
     87       1.1    pk 	cmp %g1,0
     88       1.3    tv 	be _C_LABEL(_longjmp)
     89       1.1    pk 	nop
     90       1.5   uwe 	ba,a _C_LABEL(__longjmp14)
     91       1.1    pk 	unimp 0
     92       1.2    pk 
     93  1.5.10.1  matt #endif /* !PIC */
     94