|
|
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.2 (Berkeley) 6/24/90";
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, "_ffs\n",
155: " movl (sp)+,r1\n\
156: ffs $0,$32,r1,r0\n\
157: bneq 1f\n\
158: mnegl $1,r0\n\
159: 1:\n\
160: incl r0\n" },
161:
162: { 1, "_htons\n",
163: " movl (sp)+,r5\n\
164: rotl $8,r5,r0\n\
165: rotl $-8,r5,r1\n\
166: movb r1,r0\n\
167: movzwl r0,r0\n" },
168:
169: { 1, "_ntohs\n",
170: " movl (sp)+,r5\n\
171: rotl $8,r5,r0\n\
172: rotl $-8,r5,r1\n\
173: movb r1,r0\n\
174: movzwl r0,r0\n" },
175:
176: { 1, "_htonl\n",
177: " movl (sp)+,r5\n\
178: rotl $-8,r5,r0\n\
179: insv r0,$16,$8,r0\n\
180: rotl $8,r5,r1\n\
181: movb r1,r0\n" },
182:
183: { 1, "_ntohl\n",
184: " movl (sp)+,r5\n\
185: rotl $-8,r5,r0\n\
186: insv r0,$16,$8,r0\n\
187: rotl $8,r5,r1\n\
188: movb r1,r0\n" },
189:
190: { 2, "__insque\n",
191: " movl (sp)+,r4\n\
192: movl (sp)+,r5\n\
193: insque (r4),(r5)\n" },
194:
195: { 1, "__remque\n",
196: " movl (sp)+,r5\n\
197: remque (r5),r0\n" },
198:
199: { 2, "__queue\n",
200: " movl (sp)+,r0\n\
201: movl (sp)+,r1\n\
202: insque (r1),*4(r0)\n" },
203:
204: { 1, "__dequeue\n",
205: " movl (sp)+,r0\n\
206: remque *(r0),r0\n" },
207:
208: { 2, "_imin\n",
209: " movl (sp)+,r0\n\
210: movl (sp)+,r5\n\
211: cmpl r0,r5\n\
212: bleq 1f\n\
213: movl r5,r0\n\
214: 1:\n" },
215:
216: { 2, "_imax\n",
217: " movl (sp)+,r0\n\
218: movl (sp)+,r5\n\
219: cmpl r0,r5\n\
220: bgeq 1f\n\
221: movl r5,r0\n\
222: 1:\n" },
223:
224: { 2, "_min\n",
225: " movl (sp)+,r0\n\
226: movl (sp)+,r5\n\
227: cmpl r0,r5\n\
228: blequ 1f\n\
229: movl r5,r0\n\
230: 1:\n" },
231:
232: { 2, "_max\n",
233: " movl (sp)+,r0\n\
234: movl (sp)+,r5\n\
235: cmpl r0,r5\n\
236: bgequ 1f\n\
237: movl r5,r0\n\
238: 1:\n" },
239: #endif vax
240:
241: #ifdef mc68000
242: /* someday... */
243: #endif mc68000
244:
245: { 0, "", "" }
246: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.