OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [sh64/] [setjmp.S] - Blame information for rev 1325

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* setjmp for SH-5.
2
   Copyright (C) 2001 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
 
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Library General Public License as
7
   published by the Free Software Foundation; either version 2 of the
8
   License, or (at your option) any later version.
9
 
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Library General Public License for more details.
14
 
15
   You should have received a copy of the GNU Library General Public
16
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
17
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
   Boston, MA 02111-1307, USA.  */
19
 
20
 
21
#define _SETJMP_H
22
#define _ASM
23
#include 
24
 
25
 
26
#define INTEGER(reg,offset)     st.q    r2, offset*8, reg
27
#define DOUBLE(reg,offset)      fst.d   r2, offset*8, reg
28
 
29
 
30
        .file   "setjmp.S"
31
 
32
        .section .text64,"xa"
33
        .align 2
34
 
35
        .global __sigsetjmp
36
        .type   __sigsetjmp,@function
37
 
38
__sigsetjmp:
39
        /*
40
         *      extern int __sigsetjmp(jmp_buf env, int savemask);
41
         *
42
         *      r2 == env
43
         *      r3 == savemask
44
         *      r4 == temporary
45
         */
46
 
47
                        /* callee-save registers R10-R16 */
48
        INTEGER(r10, __SETJMP_INT(0))
49
        INTEGER(r11, __SETJMP_INT(1))
50
        INTEGER(r12, __SETJMP_INT(2))
51
        INTEGER(r13, __SETJMP_INT(3))
52
        INTEGER(r14, __SETJMP_INT(4))
53
        INTEGER(r15, __SETJMP_INT(5))
54
        INTEGER(r16, __SETJMP_INT(6))
55
 
56
                        /* callee-save registers R28-R35 */
57
        INTEGER(r28, __SETJMP_INT(7))
58
        INTEGER(r29, __SETJMP_INT(8))
59
        INTEGER(r30, __SETJMP_INT(9))
60
        INTEGER(r31, __SETJMP_INT(10))
61
        INTEGER(r32, __SETJMP_INT(11))
62
        INTEGER(r33, __SETJMP_INT(12))
63
        INTEGER(r34, __SETJMP_INT(13))
64
        INTEGER(r35, __SETJMP_INT(14))
65
 
66
                        /* callee-save registers R44-R59 */
67
        INTEGER(r44, __SETJMP_INT(15))
68
        INTEGER(r45, __SETJMP_INT(16))
69
        INTEGER(r46, __SETJMP_INT(17))
70
        INTEGER(r47, __SETJMP_INT(18))
71
        INTEGER(r48, __SETJMP_INT(19))
72
        INTEGER(r49, __SETJMP_INT(20))
73
        INTEGER(r50, __SETJMP_INT(21))
74
        INTEGER(r51, __SETJMP_INT(22))
75
        INTEGER(r52, __SETJMP_INT(23))
76
        INTEGER(r53, __SETJMP_INT(24))
77
        INTEGER(r54, __SETJMP_INT(25))
78
        INTEGER(r55, __SETJMP_INT(26))
79
        INTEGER(r56, __SETJMP_INT(27))
80
        INTEGER(r57, __SETJMP_INT(28))
81
        INTEGER(r58, __SETJMP_INT(29))
82
        INTEGER(r59, __SETJMP_INT(30))
83
 
84
        #if __SETJMP_NUM_INT != 31
85
        #error  __SETJMP_NUM_INT does agree with expected value
86
        #endif
87
 
88
#if __SETJMP_NUM_DBL > 0
89
                        /* callee-save registers FR12-FR15 */
90
        DOUBLE(d12, __SETJMP_DBL(0))
91
        DOUBLE(d14, __SETJMP_DBL(1))
92
 
93
                        /* callee-save registers FR36-FR63 */
94
        DOUBLE(d36, __SETJMP_DBL(2))
95
        DOUBLE(d38, __SETJMP_DBL(3))
96
        DOUBLE(d40, __SETJMP_DBL(4))
97
        DOUBLE(d42, __SETJMP_DBL(5))
98
        DOUBLE(d44, __SETJMP_DBL(6))
99
        DOUBLE(d46, __SETJMP_DBL(7))
100
        DOUBLE(d48, __SETJMP_DBL(8))
101
        DOUBLE(d50, __SETJMP_DBL(9))
102
        DOUBLE(d52, __SETJMP_DBL(10))
103
        DOUBLE(d54, __SETJMP_DBL(11))
104
        DOUBLE(d56, __SETJMP_DBL(12))
105
        DOUBLE(d58, __SETJMP_DBL(13))
106
        DOUBLE(d60, __SETJMP_DBL(14))
107
        DOUBLE(d62, __SETJMP_DBL(15))
108
 
109
        #if __SETJMP_NUM_DBL != 16
110
        #error  __SETJMP_NUM_DBL does agree with expected value
111
        #endif
112
 
113
#endif  /* __SETJMP_NUM_DBL > 0 */
114
 
115
                        /* callee-save registers TR5-TR7 */
116
        gettr   tr5, r4
117
        INTEGER(r4, __SETJMP_TRG(0))
118
        gettr   tr6, r4
119
        INTEGER(r4, __SETJMP_TRG(1))
120
        gettr   tr7, r4
121
        INTEGER(r4, __SETJMP_TRG(2))
122
 
123
        #if __SETJMP_NUM_TRG != 3
124
        #error  __SETJMP_NUM_TRG does agree with expected value
125
        #endif
126
 
127
                        /* save Linkage Register (LR) for longjmp return */
128
        INTEGER(r18, __SETJMP_LR)
129
 
130
                        /*
131
                         *      return a value of zero if call is __sigsetjmp().
132
                         *      This is so that caller of setjmp() knows
133
                         *      we have retruned via setjmp, and not via longjmp.
134
                         *      R0 is the result register.
135
                         */
136
 
137
        ptabs/l r18, tr0        /* return to caller */
138
        movi    0, r2   /* return value */
139
        blink   tr0, r63
140
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.