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