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