source: trunk/libs/newlib/src/libgloss/pa/setjmp.S @ 680

Last change on this file since 680 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.8 KB
Line 
1/*
2 * Copyright (c) 1990,1994 The University of Utah and
3 * the Computer Systems Laboratory (CSL).  All rights reserved.
4 *
5 * Permission to use, copy, modify and distribute this software is hereby
6 * granted provided that (1) source code retains these copyright, permission,
7 * and disclaimer notices, and (2) redistributions including binaries
8 * reproduce the notices in supporting documentation, and (3) all advertising
9 * materials mentioning features or use of this software display the following
10 * acknowledgement: ``This product includes software developed by the
11 * Computer Systems Laboratory at the University of Utah.''
12 *
13 * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
14 * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
15 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 *
17 * CSL requests users of this software to return to csl-dist@cs.utah.edu any
18 * improvements that they make and grant CSL redistribution rights.
19 *
20 *      Utah $Hdr: _setjmp.s 1.9 94/12/16$
21 */
22
23        .space  $TEXT$
24        .subspa $CODE$
25
26/*
27 * The PA jmp_buf is 48 words arranged as follows:
28 *
29 *       0- 9:  sigcontext
30 *      10-26:  callee save GRs (r3-r18) and DP (r27)
31 *         27:  callee save SRs (sr3)
32 *      28-47:  callee save FRs (fr12-fr21)
33 */
34
35/*
36 * int
37 * setjmp(env)
38 *      jmp_buf env;
39 *
40 * This routine does not restore signal state.
41 */
42
43        .export setjmp,entry
44        .export _setjmp,entry
45        .proc
46        .callinfo
47setjmp
48_setjmp
49        .entry
50
51        /*
52         * save sp and rp in sigcontext, skip the rest
53         */
54        stw     %r30,8(%r26)
55        stw     %r2,24(%r26)
56        ldo     40(%r26),%r26
57
58        /*
59         * save dp and the callee saves registers
60         */
61        stwm    %r3,4(%r26)
62        stwm    %r4,4(%r26)
63        stwm    %r5,4(%r26)
64        stwm    %r6,4(%r26)
65        stwm    %r7,4(%r26)
66        stwm    %r8,4(%r26)
67        stwm    %r9,4(%r26)
68        stwm    %r10,4(%r26)
69        stwm    %r11,4(%r26)
70        stwm    %r12,4(%r26)
71        stwm    %r13,4(%r26)
72        stwm    %r14,4(%r26)
73        stwm    %r15,4(%r26)
74        stwm    %r16,4(%r26)
75        stwm    %r17,4(%r26)
76        stwm    %r18,4(%r26)
77        stwm    %r27,4(%r26)
78
79        mfsp    %sr3,%r9
80        stwm    %r9,4(%r26)
81
82        bv      0(%r2)
83        copy    %r0,%r28
84        .exit
85        .procend
86
87/*
88 * void
89 * longjmp(env, val)
90 *      jmp_buf env;
91 *      int val;
92 *
93 * This routine does not retore signal state.
94 * This routine does not override a zero val.
95 */
96
97        .export longjmp,entry
98        .export _longjmp,entry
99        .proc
100        .callinfo
101longjmp
102_longjmp
103
104        .entry
105
106        /*
107         * restore sp and rp
108         */
109        ldw     8(%r26),%r30
110        ldw     24(%r26),%r2
111        ldo     40(%r26),%r26
112
113        /*
114         * restore callee saves registers
115         */
116        ldwm    4(%r26),%r3
117        ldwm    4(%r26),%r4
118        ldwm    4(%r26),%r5
119        ldwm    4(%r26),%r6
120        ldwm    4(%r26),%r7
121        ldwm    4(%r26),%r8
122        ldwm    4(%r26),%r9
123        ldwm    4(%r26),%r10
124        ldwm    4(%r26),%r11
125        ldwm    4(%r26),%r12
126        ldwm    4(%r26),%r13
127        ldwm    4(%r26),%r14
128        ldwm    4(%r26),%r15
129        ldwm    4(%r26),%r16
130        ldwm    4(%r26),%r17
131        ldwm    4(%r26),%r18
132        ldwm    4(%r26),%r27
133
134        ldwm    4(%r26),%r9
135        mtsp    %r9,%sr3
136
137        bv      0(%r2)
138        copy    %r25,%r28
139        .exit
140        .procend
Note: See TracBrowser for help on using the repository browser.