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