Commit | Line | Data |
---|---|---|
da7c5cc6 | 1 | /* |
0880b18e | 2 | * Copyright (c) 1984, 1986 Regents of the University of California. |
da7c5cc6 KM |
3 | * All rights reserved. The Berkeley software License Agreement |
4 | * specifies the terms and conditions for redistribution. | |
5 | */ | |
7c77452d | 6 | |
2a48bcf5 | 7 | #ifndef lint |
0880b18e | 8 | static char sccsid[] = "@(#)langpats.c 7.1 (Berkeley) %G%"; |
da7c5cc6 | 9 | #endif not lint |
2a48bcf5 | 10 | |
7c77452d | 11 | #include "inline.h" |
2a48bcf5 SL |
12 | |
13 | /* | |
7c77452d KM |
14 | * Pattern table for kernel specific routines. |
15 | * These patterns are based on the old asm.sed script. | |
2a48bcf5 | 16 | */ |
7c77452d | 17 | struct pats language_ptab[] = { |
2a48bcf5 | 18 | |
7c77452d | 19 | #ifdef vax |
c8869d53 | 20 | { 0, "_spl0\n", |
2a48bcf5 SL |
21 | " mfpr $18,r0\n\ |
22 | mtpr $0,$18\n" }, | |
23 | ||
c8869d53 | 24 | { 0, "_spl1\n", |
2a48bcf5 SL |
25 | " mfpr $18,r0\n\ |
26 | mtpr $1,$18\n" }, | |
27 | ||
c8869d53 | 28 | { 0, "_splsoftclock\n", |
2a48bcf5 SL |
29 | " mfpr $18,r0\n\ |
30 | mtpr $0x8,$18\n" }, | |
31 | ||
c8869d53 | 32 | { 0, "_splnet\n", |
2a48bcf5 SL |
33 | " mfpr $18,r0\n\ |
34 | mtpr $0xc,$18\n" }, | |
35 | ||
c8869d53 | 36 | { 0, "_splimp\n", |
2a48bcf5 SL |
37 | " mfpr $18,r0\n\ |
38 | mtpr $0x16,$18\n" }, | |
39 | ||
c8869d53 | 40 | { 0, "_spl4\n", |
2a48bcf5 SL |
41 | " mfpr $18,r0\n\ |
42 | mtpr $0x14,$18\n" }, | |
43 | ||
c8869d53 | 44 | { 0, "_splbio\n", |
2a48bcf5 SL |
45 | " mfpr $18,r0\n\ |
46 | mtpr $0x15,$18\n" }, | |
47 | ||
c8869d53 | 48 | { 0, "_spltty\n", |
2a48bcf5 SL |
49 | " mfpr $18,r0\n\ |
50 | mtpr $0x15,$18\n" }, | |
2a48bcf5 | 51 | |
c8869d53 | 52 | { 0, "_spl5\n", |
2a48bcf5 SL |
53 | " mfpr $18,r0\n\ |
54 | mtpr $0x15,$18\n" }, | |
55 | ||
fc39b6e0 | 56 | { 0, "_spl6\n", |
2a48bcf5 | 57 | " mfpr $18,r0\n\ |
fc39b6e0 | 58 | mtpr $0x16,$18\n" }, |
2a48bcf5 | 59 | |
fc39b6e0 | 60 | { 0, "_spl7\n", |
2a48bcf5 | 61 | " mfpr $18,r0\n\ |
fc39b6e0 | 62 | mtpr $0x17,$18\n" }, |
2a48bcf5 | 63 | |
fc39b6e0 | 64 | { 0, "_splclock\n", |
2a48bcf5 | 65 | " mfpr $18,r0\n\ |
fc39b6e0 | 66 | mtpr $0x18,$18\n" }, |
2a48bcf5 | 67 | |
fc39b6e0 | 68 | { 0, "_splhigh\n", |
6a1722ed MK |
69 | " mfpr $18,r0\n\ |
70 | mtpr $0x1f,$18\n" }, | |
71 | ||
c8869d53 | 72 | { 1, "_splx\n", |
d2885b71 MK |
73 | " movl (sp)+,r0\n\ |
74 | mtpr r0,$18\n" }, | |
2a48bcf5 | 75 | |
c8869d53 | 76 | { 1, "_mfpr\n", |
7c77452d KM |
77 | " movl (sp)+,r5\n\ |
78 | mfpr r5,r0\n" }, | |
2a48bcf5 | 79 | |
c8869d53 | 80 | { 2, "_mtpr\n", |
7c77452d KM |
81 | " movl (sp)+,r4\n\ |
82 | movl (sp)+,r5\n\ | |
83 | mtpr r5,r4\n" }, | |
2a48bcf5 | 84 | |
c8869d53 | 85 | { 0, "_setsoftclock\n", |
2a48bcf5 SL |
86 | " mtpr $0x8,$0x14\n" }, |
87 | ||
c8869d53 | 88 | { 1, "_resume\n", |
7c77452d KM |
89 | " movl (sp)+,r5\n\ |
90 | ashl $9,r5,r0\n\ | |
91 | movpsl -(sp)\n\ | |
2a48bcf5 SL |
92 | jsb _Resume\n" }, |
93 | ||
c8869d53 | 94 | { 3, "_copyin\n", |
af0d1cb8 KM |
95 | " movl (sp)+,r1\n\ |
96 | movl (sp)+,r3\n\ | |
97 | movl (sp)+,r5\n\ | |
98 | jsb _Copyin\n" }, | |
2a48bcf5 | 99 | |
c8869d53 | 100 | { 3, "_copyout\n", |
af0d1cb8 KM |
101 | " movl (sp)+,r1\n\ |
102 | movl (sp)+,r3\n\ | |
103 | movl (sp)+,r5\n\ | |
104 | jsb _Copyout\n" }, | |
2a48bcf5 | 105 | |
c8869d53 | 106 | { 1, "_fubyte\n", |
2a48bcf5 SL |
107 | " movl (sp)+,r0\n\ |
108 | jsb _Fubyte\n" }, | |
109 | ||
c8869d53 | 110 | { 1, "_fuibyte\n", |
7c77452d | 111 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
112 | jsb _Fubyte\n" }, |
113 | ||
c8869d53 | 114 | { 1, "_fuword\n", |
7c77452d | 115 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
116 | jsb _Fuword\n" }, |
117 | ||
c8869d53 | 118 | { 1, "_fuiword\n", |
7c77452d | 119 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
120 | jsb _Fuword\n" }, |
121 | ||
c8869d53 | 122 | { 2, "_subyte\n", |
2a48bcf5 SL |
123 | " movl (sp)+,r0\n\ |
124 | movl (sp)+,r1\n\ | |
125 | jsb _Subyte\n" }, | |
126 | ||
c8869d53 | 127 | { 2, "_suibyte\n", |
7c77452d | 128 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
129 | movl (sp)+,r1\n\ |
130 | jsb _Subyte\n" }, | |
131 | ||
c8869d53 | 132 | { 2, "_suword\n", |
7c77452d | 133 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
134 | movl (sp)+,r1\n\ |
135 | jsb _Suword\n" }, | |
136 | ||
c8869d53 | 137 | { 2, "_suiword\n", |
7c77452d | 138 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
139 | movl (sp)+,r1\n\ |
140 | jsb _Suword\n" }, | |
141 | ||
c8869d53 | 142 | { 1, "_setrq\n", |
7c77452d | 143 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
144 | jsb _Setrq\n" }, |
145 | ||
c8869d53 | 146 | { 1, "_remrq\n", |
7c77452d | 147 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
148 | jsb _Remrq\n" }, |
149 | ||
c8869d53 | 150 | { 0, "_swtch\n", |
2a48bcf5 SL |
151 | " movpsl -(sp)\n\ |
152 | jsb _Swtch\n" }, | |
153 | ||
c8869d53 | 154 | { 1, "_setjmp\n", |
7c77452d KM |
155 | " movl (sp)+,r1\n\ |
156 | clrl r0\n\ | |
157 | movl fp,(r1)+\n\ | |
7a619593 | 158 | moval 1(pc),(r1)\n" }, |
2a48bcf5 | 159 | |
c8869d53 | 160 | { 1, "_longjmp\n", |
7c77452d | 161 | " movl (sp)+,r0\n\ |
2a48bcf5 SL |
162 | jsb _Longjmp\n" }, |
163 | ||
c8869d53 | 164 | { 1, "_ffs\n", |
2a48bcf5 | 165 | " movl (sp)+,r1\n\ |
7c77452d KM |
166 | ffs $0,$32,r1,r0\n\ |
167 | bneq 1f\n\ | |
168 | mnegl $1,r0\n\ | |
169 | 1:\n\ | |
2a48bcf5 SL |
170 | incl r0\n" }, |
171 | ||
c8869d53 | 172 | { 1, "_htons\n", |
7c77452d KM |
173 | " movl (sp)+,r5\n\ |
174 | rotl $8,r5,r0\n\ | |
a2231391 KM |
175 | rotl $-8,r5,r1\n\ |
176 | movb r1,r0\n\ | |
7c77452d KM |
177 | movzwl r0,r0\n" }, |
178 | ||
c8869d53 | 179 | { 1, "_ntohs\n", |
7c77452d | 180 | " movl (sp)+,r5\n\ |
a2231391 KM |
181 | rotl $8,r5,r0\n\ |
182 | rotl $-8,r5,r1\n\ | |
183 | movb r1,r0\n\ | |
7c77452d KM |
184 | movzwl r0,r0\n" }, |
185 | ||
c8869d53 | 186 | { 1, "_htonl\n", |
7c77452d | 187 | " movl (sp)+,r5\n\ |
a2231391 | 188 | rotl $-8,r5,r0\n\ |
2a48bcf5 | 189 | insv r0,$16,$8,r0\n\ |
a2231391 KM |
190 | rotl $8,r5,r1\n\ |
191 | movb r1,r0\n" }, | |
2a48bcf5 | 192 | |
c8869d53 | 193 | { 1, "_ntohl\n", |
7c77452d | 194 | " movl (sp)+,r5\n\ |
a2231391 | 195 | rotl $-8,r5,r0\n\ |
2a48bcf5 | 196 | insv r0,$16,$8,r0\n\ |
a2231391 KM |
197 | rotl $8,r5,r1\n\ |
198 | movb r1,r0\n" }, | |
2a48bcf5 | 199 | |
c8869d53 | 200 | { 2, "__insque\n", |
7c77452d KM |
201 | " movl (sp)+,r4\n\ |
202 | movl (sp)+,r5\n\ | |
203 | insque (r4),(r5)\n" }, | |
2a48bcf5 | 204 | |
c8869d53 | 205 | { 1, "__remque\n", |
7c77452d KM |
206 | " movl (sp)+,r5\n\ |
207 | remque (r5),r0\n" }, | |
2a48bcf5 | 208 | |
c8869d53 | 209 | { 2, "__queue\n", |
2a48bcf5 SL |
210 | " movl (sp)+,r0\n\ |
211 | movl (sp)+,r1\n\ | |
06b6c74a | 212 | insque (r1),*4(r0)\n" }, |
2a48bcf5 | 213 | |
c8869d53 | 214 | { 1, "__dequeue\n", |
2a48bcf5 SL |
215 | " movl (sp)+,r0\n\ |
216 | remque *(r0),r0\n" }, | |
52eb78c8 | 217 | |
c8869d53 | 218 | { 2, "_imin\n", |
52eb78c8 KM |
219 | " movl (sp)+,r0\n\ |
220 | movl (sp)+,r5\n\ | |
221 | cmpl r0,r5\n\ | |
222 | bleq 1f\n\ | |
223 | movl r5,r0\n\ | |
224 | 1:\n" }, | |
225 | ||
c8869d53 | 226 | { 2, "_imax\n", |
52eb78c8 KM |
227 | " movl (sp)+,r0\n\ |
228 | movl (sp)+,r5\n\ | |
229 | cmpl r0,r5\n\ | |
230 | bgeq 1f\n\ | |
231 | movl r5,r0\n\ | |
232 | 1:\n" }, | |
233 | ||
c8869d53 | 234 | { 2, "_min\n", |
52eb78c8 KM |
235 | " movl (sp)+,r0\n\ |
236 | movl (sp)+,r5\n\ | |
237 | cmpl r0,r5\n\ | |
238 | blequ 1f\n\ | |
239 | movl r5,r0\n\ | |
240 | 1:\n" }, | |
241 | ||
c8869d53 | 242 | { 2, "_max\n", |
52eb78c8 KM |
243 | " movl (sp)+,r0\n\ |
244 | movl (sp)+,r5\n\ | |
245 | cmpl r0,r5\n\ | |
246 | bgequ 1f\n\ | |
247 | movl r5,r0\n\ | |
248 | 1:\n" }, | |
7c77452d KM |
249 | #endif vax |
250 | ||
251 | #ifdef mc68000 | |
252 | /* someday... */ | |
253 | #endif mc68000 | |
254 | ||
c8869d53 | 255 | { 0, "", "" } |
2a48bcf5 | 256 | }; |