Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sparc/v9/ml/crt.s
+++ new/usr/src/uts/sparc/v9/ml/crt.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright (c) 1988-1991 by Sun Microsystems, Inc.
24 24 */
25 25
26 26 #ident "%Z%%M% %I% %E% SMI" /* From SunOS 4.1 1.6 */
27 27
28 -#if defined(lint)
29 -#include <sys/types.h>
30 -#include <sys/regset.h>
31 -#include <sys/privregs.h>
32 -#endif /* lint */
33 -
34 28 #include <sys/asm_linkage.h>
35 29 #include <sys/trap.h>
36 30 #include <sys/machtrap.h>
37 31 #include <sys/simulate.h>
38 32
39 33 /*
40 34 * C run time subroutines.
41 35 *
42 36 * Those beginning in `.' are not callable from C and hence do not
43 37 * get lint prototypes.
44 38 */
45 39
46 -#if !defined(lint)
47 -
48 40 /*
49 41 * Structure return
50 42 */
51 43 #define UNIMP 0
52 44 #define MASK 0x00000fff
53 45 #define STRUCT_VAL_OFF (16*4)
54 46
55 47 RTENTRY(.stret4)
56 48 RTENTRY(.stret8)
57 49 !
58 50 ! see if key matches: if not, structure value not expected,
59 51 ! so just return
60 52 !
61 53 ld [%i7 + 8], %o3
62 54 and %o1, MASK, %o4
63 55 sethi %hi(UNIMP), %o5
64 56 or %o4, %o5, %o5
65 57 cmp %o5, %o3
66 58 be,a 0f
67 59 ld [%fp + STRUCT_VAL_OFF], %i0 ! set expected return value
68 60 ret
69 61 restore
70 62 0: ! copy the struct
71 63 subcc %o1, 4, %o1
72 64 ld [%o0 + %o1], %o4
73 65 bg 0b
74 66 st %o4, [%i0 + %o1] ! delay slot
75 67 add %i7, 0x4, %i7 ! bump return address
76 68 ret
77 69 restore
78 70 SET_SIZE(.stret4)
79 71 SET_SIZE(.stret8)
80 72
81 73 RTENTRY(.stret2)
82 74 !
83 75 ! see if key matches: if not, structure value not expected,
84 76 ! so just return
85 77 !
86 78 ld [%i7 + 8], %o3
87 79 and %o1, MASK, %o4
88 80 sethi %hi(UNIMP), %o5
89 81 or %o4, %o5, %o5
90 82 cmp %o5, %o3
91 83 be,a 0f
92 84 ld [%fp + STRUCT_VAL_OFF], %i0 ! set expected return value
93 85 ret
94 86 restore
95 87 0: ! copy the struct
96 88 subcc %o1, 2, %o1
97 89 lduh [%o0 + %o1], %o4
98 90 bg 0b
99 91 sth %o4, [%i0 + %o1] ! delay slot
100 92 add %i7, 0x4, %i7 ! bump return address
101 93 ret
102 94 restore
103 95 SET_SIZE(.stret2)
104 96
105 97 /*
106 98 * Convert 32-bit arg pairs in %o0:o1 and %o2:%o3 to 64-bit args in %o1 and %o2
107 99 */
108 100 #define ARGS_TO_64 \
109 101 sllx %o0, 32, %o0; \
110 102 srl %o1, 0, %o1; \
111 103 sllx %o2, 32, %o2; \
112 104 srl %o3, 0, %o3; \
113 105 or %o0, %o1, %o1; \
114 106 or %o2, %o3, %o2
115 107
116 108 RTENTRY(__mul64)
117 109 ALTENTRY(__umul64)
118 110 ARGS_TO_64
119 111 sub %o1, %o2, %o0 ! %o0 = a - b
120 112 movrlz %o0, %g0, %o0 ! %o0 = (a < b) ? 0 : a - b
121 113 sub %o1, %o0, %o1 ! %o1 = (a < b) ? a : b = min(a, b)
122 114 add %o2, %o0, %o2 ! %o2 = (a < b) ? b : a = max(a, b)
123 115 mulx %o1, %o2, %o1 ! min(a, b) in "rs1" for early exit
124 116 retl
125 117 srax %o1, 32, %o0
126 118 SET_SIZE(__mul64)
127 119 SET_SIZE(__umul64)
128 120
129 121 RTENTRY(__div64)
130 122 ARGS_TO_64
131 123 sdivx %o1, %o2, %o1
132 124 retl
133 125 srax %o1, 32, %o0
134 126 SET_SIZE(__div64)
135 127
136 128 RTENTRY(__udiv64)
137 129 ARGS_TO_64
138 130 udivx %o1, %o2, %o1
139 131 retl
140 132 srax %o1, 32, %o0
141 133 SET_SIZE(__udiv64)
142 134
143 135 RTENTRY(__rem64)
144 136 ARGS_TO_64
145 137 sdivx %o1, %o2, %o3
146 138 mulx %o2, %o3, %o3
147 139 sub %o1, %o3, %o1
148 140 retl
149 141 srax %o1, 32, %o0
150 142 SET_SIZE(__rem64)
↓ open down ↓ |
93 lines elided |
↑ open up ↑ |
151 143
152 144 RTENTRY(__urem64)
153 145 ARGS_TO_64
154 146 udivx %o1, %o2, %o3
155 147 mulx %o2, %o3, %o3
156 148 sub %o1, %o3, %o1
157 149 retl
158 150 srax %o1, 32, %o0
159 151 SET_SIZE(__urem64)
160 152
161 -#endif /* !lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX