xref: /original-bsd/sys/tahoe/inline/langpats.c (revision f1324ba5)
1 /*
2  * Copyright (c) 1984 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	1.6 (Berkeley) 10/09/88";
9 #endif
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 	{ 0, "_spl0\n",
20 "	mfpr	$8,r0\n\
21 	mtpr	$0,$8\n" },
22 
23 	{ 0, "_spl1\n",
24 "	mfpr	$8,r0\n\
25 	mtpr	$0x11,$8\n" },
26 
27 	{ 0, "_spl3\n",
28 "	mfpr	$8,r0\n\
29 	mtpr	$0x13,$8\n" },
30 
31 	{ 0, "_spl4\n",
32 "	mfpr	$8,r0\n\
33 	mtpr	$0x14,$8\n" },
34 
35 	{ 0, "_spl5\n",
36 "	mfpr	$8,r0\n\
37 	mtpr	$0x15,$8\n" },
38 
39 	{ 0, "_spl7\n",
40 "	mfpr	$8,r0\n\
41 	mtpr	$0x17,$8\n" },
42 
43 	{ 0, "_spl8\n",
44 "	mfpr	$8,r0\n\
45 	mtpr	$0x18,$8\n" },
46 
47 	{ 0, "_splimp\n",
48 "	mfpr	$8,r0\n\
49 	mtpr	$0x18,$8\n" },
50 
51 	{ 0, "_splsoftclock\n",
52 "	mfpr	$8,r0\n\
53 	mtpr	$0x8,$8\n" },
54 
55 	{ 0, "_splnet\n",
56 "	mfpr	$8,r0\n\
57 	mtpr	$0xc,$8\n" },
58 
59 	{ 0, "_splbio\n",
60 "	mfpr	$8,r0\n\
61 	mtpr	$0x18,$8\n" },
62 
63 	{ 0, "_spltty\n",
64 "	mfpr	$8,r0\n\
65 	mtpr	$0x18,$8\n" },
66 
67 	{ 0, "_splclock\n",
68 "	mfpr	$8,r0\n\
69 	mtpr	$0x18,$8\n" },
70 
71 	{ 0, "_splhigh\n",
72 "	mfpr	$8,r0\n\
73 	mtpr	$0x18,$8\n" },
74 
75 	{ 1, "_splx\n",
76 "	movl	(sp)+,r1\n\
77 	mfpr	$8,r0\n\
78 	mtpr	r1,$8\n" },
79 
80 	{ 1, "_mfpr\n",
81 "	movl	(sp)+,r1\n\
82 	mfpr	r1,r0\n" },
83 
84 	{ 2, "_mtpr\n",
85 "	movl	(sp)+,r1\n\
86 	movl	(sp)+,r0\n\
87 	mtpr	r0,r1\n" },
88 
89 #ifdef notdef
90 	{ 1, "_uncache\n",
91 "	movl	(sp)+,r1\n\
92 	mtpr	r1,$0x1c\n" },
93 #endif
94 
95 	{ 0, "_setsoftclock\n",
96 "	mtpr	$0x8,$0x10\n" },
97 
98 	{ 1, "_fuibyte\n",
99 "	callf	$8,_fubyte\n" },
100 
101 	{ 1, "_fuiword\n",
102 "	callf	$8,_fuword\n" },
103 
104 	{ 2, "_suibyte\n",
105 "	callf	$12,_subyte\n" },
106 
107 	{ 2, "_suiword\n",
108 "	callf	$12,_suword\n" },
109 
110 	{ 1, "_setjmp\n",
111 "	movl	(sp)+,r1\n\
112 	clrl	r0\n\
113 	movab	(fp),(r1)\n\
114 	addl2	$4,r1\n\
115 	movab	1(pc),(r1)\n" },
116 
117 	{ 1, "_ffs\n",
118 "	movl	(sp)+,r1\n\
119 	ffs	r1,r0\n\
120 	bgeq	1f\n\
121 	mnegl	$1,r0\n\
122 1:\n\
123 	incl	r0\n" },
124 
125 	{ 2, "__insque\n",
126 "	movl	(sp)+,r0\n\
127 	movl	(sp)+,r1\n\
128 	insque	(r0),(r1)\n" },
129 
130 	{ 1, "__remque\n",
131 "	movl	(sp)+,r1\n\
132 	remque	(r1)\n" },
133 
134 	{ 2, "_imin\n",
135 "	movl	(sp)+,r0\n\
136 	movl	(sp)+,r1\n\
137 	cmpl	r0,r1\n\
138 	bleq	1f\n\
139 	movl	r1,r0\n\
140 1:\n" },
141 
142 	{ 2, "_imax\n",
143 "	movl	(sp)+,r0\n\
144 	movl	(sp)+,r1\n\
145 	cmpl	r0,r1\n\
146 	bgeq	1f\n\
147 	movl	r1,r0\n\
148 1:\n" },
149 
150 	{ 2, "_min\n",
151 "	movl	(sp)+,r0\n\
152 	movl	(sp)+,r1\n\
153 	cmpl	r0,r1\n\
154 	blequ	1f\n\
155 	movl	r1,r0\n\
156 1:\n" },
157 
158 	{ 2, "_max\n",
159 "	movl	(sp)+,r0\n\
160 	movl	(sp)+,r1\n\
161 	cmpl	r0,r1\n\
162 	bgequ	1f\n\
163 	movl	r1,r0\n\
164 1:\n" },
165 
166 	{ 2, "__movow\n",
167 "	movl	(sp)+,r1\n\
168 	movl	(sp)+,r0\n\
169 	movow	r0,(r1)\n" },
170 
171 	{ 2, "__movob\n",
172 "	movl	(sp)+,r1\n\
173 	movl	(sp)+,r0\n\
174 	movob	r0,(r1)\n" },
175 
176 	{ 0, "_movpsl\n",
177 "	movpsl	r0\n" },
178 
179 	{ 0, "", "" }
180 };
181