1/* 2 * Blackfin testcase for testing illegal/legal 16-bit opcodes from userspace 3 * we track all instructions which cause some sort of exception when run from 4 * userspace, this is normally EXCAUSE : 5 * - 0x21 : illegal instruction 6 * - 0x22 : illegal instruction combination 7 * - 0x2e : use of supervisor resource from userspace 8 * and walk every instruction from 0x0000 to 0xbfff 9 */ 10 11# mach: bfin 12# sim: --environment operating 13 14#include "test.h" 15 16#define SE_ALL_BITS 16 17#define SE_ALL_NEW_INSN_STUB 18#include "se_allopcodes.h" 19 .include "testutils.inc" 20 21.macro se_all_load_insn 22 R2 = W[P5]; 23 R0 = R2; 24.endm 25 26.macro se_all_next_insn 27 /* increment, and go again. */ 28 R0 = R2; 29 30 R0 += 1; 31 /* finish once we hit the 32bit limit */ 32 R1 = 0xC000 (Z); 33 CC = R1 == R0; 34 IF CC JUMP pass_lvl; 35 36 W[P5] = R0; 37.endm 38 39.macro se_all_new_insn_stub 40 jump _legal_instruction; 41.endm 42 43.macro se_all_insn_init 44 .dw 0x0000; 45.endm 46.macro se_all_insn_table 47 /* this table must be sorted, and end with zero */ 48 /* start end SEQSTAT */ 49 .dw 0x0001, 0x000f, 0x21 50 .dw 0x0011, 0x0013, 0x2e 51.ifndef BFIN_JTAG 52 .dw 0x0014, 0x0014, 0x2e /* anomaly - RTX works when emulator attached */ 53.endif 54 .dw 0x0015, 0x001F, 0x21 55 .dw 0x0021, 0x0022, 0x21 56 .dw 0x0026, 0x0026, 0x21 57.ifndef BFIN_JTAG 58 .dw 0x0027, 0x0027, 0x21 /* anomaly 492 - unknown */ 59.endif 60 .dw 0x0028, 0x002F, 0x21 61 .dw 0x0030, 0x0037, 0x2e 62 .dw 0x0038, 0x003F, 0x21 63 .dw 0x0040, 0x0047, 0x2e 64 .dw 0x0048, 0x004F, 0x21 65 .dw 0x0058, 0x005F, 0x21 66 .dw 0x0068, 0x006F, 0x21 67 .dw 0x0078, 0x007F, 0x21 68 .dw 0x0088, 0x008F, 0x21 69 .dw 0x0090, 0x009F, 0x2E 70 .dw 0x00a0, 0x00a0, 0x00 71 .dw 0x00a1, 0x00a1, 0x01 72 .dw 0x00a2, 0x00a2, 0x02 73 .dw 0x00a3, 0x00a3, 0x03 74 .dw 0x00a4, 0x00a4, 0x04 75 .dw 0x00a5, 0x00a5, 0x05 76 .dw 0x00a6, 0x00a6, 0x06 77 .dw 0x00a7, 0x00a7, 0x07 78 .dw 0x00a8, 0x00a8, 0x08 79 .dw 0x00a9, 0x00a9, 0x09 80 .dw 0x00aa, 0x00aa, 0x0a 81 .dw 0x00ab, 0x00ab, 0x0b 82 .dw 0x00ac, 0x00ac, 0x0c 83 .dw 0x00ad, 0x00ad, 0x0d 84 .dw 0x00ae, 0x00ae, 0x0e 85 .dw 0x00af, 0x00af, 0x0f 86 .dw 0x00b6, 0x010f, 0x21 87 .dw 0x0124, 0x0124, 0x21 88.ifndef BFIN_JTAG 89 .dw 0x0125, 0x0125, 0x21 /* anomaly 492 res = [SP++] */ 90.endif 91 .dw 0x0128, 0x012F, 0x21 92 .dw 0x0138, 0x0138, 0x22 93 .dw 0x0139, 0x013F, 0x2E 94 .dw 0x0164, 0x0164, 0x21 95.ifndef BFIN_JTAG 96 .dw 0x0165, 0x0165, 0x21 /* anomaly 492 [--SP] = res */ 97.endif 98 .dw 0x0168, 0x016F, 0x21 99 .dw 0x0178, 0x017F, 0x2E 100 .dw 0x0180, 0x01FF, 0x21 101 .dw 0x0210, 0x0217, 0x21 102.ifndef BFIN_JTAG 103 .dw 0x0219, 0x021F, 0x21 /* anomaly 492 CC = !CC opcode is 0000 0010 0001 1xxx */ 104.endif 105 .dw 0x0220, 0x023F, 0x21 106 .dw 0x0280, 0x02FF, 0x21 107 .dw 0x0305, 0x0305, 0x21 108 .dw 0x0325, 0x0325, 0x21 109 .dw 0x0345, 0x0345, 0x21 110 .dw 0x0365, 0x0365, 0x21 111 .dw 0x0385, 0x0385, 0x21 112 .dw 0x03a5, 0x03a5, 0x21 113 .dw 0x03c5, 0x03c5, 0x21 114 .dw 0x03e5, 0x03e5, 0x21 115 .dw 0x0400, 0x047F, 0x21 116 .dw 0x0486, 0x04Bf, 0x21 117 .dw 0x04c6, 0x04FF, 0x21 118 .dw 0x0501, 0x0507, 0x21 119 .dw 0x0509, 0x050F, 0x21 120 .dw 0x0511, 0x0517, 0x21 121 .dw 0x0519, 0x051F, 0x21 122 .dw 0x0521, 0x0527, 0x21 123 .dw 0x0529, 0x052F, 0x21 124 .dw 0x0531, 0x0537, 0x21 125 .dw 0x0539, 0x053F, 0x21 126 .dw 0x0541, 0x0547, 0x21 127 .dw 0x0549, 0x054F, 0x21 128 .dw 0x0551, 0x0557, 0x21 129 .dw 0x0559, 0x055F, 0x21 130 .dw 0x0561, 0x0567, 0x21 131 .dw 0x0569, 0x056F, 0x21 132 .dw 0x0571, 0x0577, 0x21 133 .dw 0x0579, 0x057F, 0x21 134 .dw 0x0586, 0x0587, 0x21 135 .dw 0x058e, 0x058F, 0x21 136 .dw 0x0596, 0x0597, 0x21 137 .dw 0x059e, 0x059f, 0x21 138 .dw 0x05a6, 0x05a7, 0x21 139 .dw 0x05ae, 0x05af, 0x21 140 .dw 0x05b6, 0x05b7, 0x21 141 .dw 0x05be, 0x05bf, 0x21 142 .dw 0x05c6, 0x05c7, 0x21 143 .dw 0x05ce, 0x05cf, 0x21 144 .dw 0x05d6, 0x05d7, 0x21 145 .dw 0x05de, 0x05df, 0x21 146 .dw 0x05e6, 0x05e7, 0x21 147 .dw 0x05ee, 0x05ef, 0x21 148 .dw 0x05f6, 0x05f7, 0x21 149 .dw 0x05fe, 0x05ff, 0x21 150 .dw 0x0a81, 0x0aff, 0x21 151 .dw 0x0b01, 0x0b7f, 0x21 152 .dw 0x0b81, 0x0bff, 0x21 153 .dw 0x0e80, 0x0fff, 0x21 154 .dw 0x3104, 0x3105, 0x21 155 .dw 0x310c, 0x310d, 0x21 156 .dw 0x3114, 0x3115, 0x21 157 .dw 0x311c, 0x311d, 0x21 158 .dw 0x3124, 0x3125, 0x21 159 .dw 0x312c, 0x312d, 0x21 160 .dw 0x3134, 0x3135, 0x21 161 .dw 0x313c, 0x313d, 0x21 162 .dw 0x3140, 0x317F, 0x21 163 .dw 0x31c0, 0x31ff, 0x2E 164 .dw 0x3304, 0x3305, 0x21 165 .dw 0x330c, 0x330d, 0x21 166 .dw 0x3314, 0x3315, 0x21 167 .dw 0x331c, 0x331d, 0x21 168 .dw 0x3324, 0x3325, 0x21 169 .dw 0x332c, 0x332d, 0x21 170 .dw 0x3334, 0x3335, 0x21 171 .dw 0x333c, 0x333d, 0x21 172 .dw 0x3340, 0x337f, 0x21 173 .dw 0x33c0, 0x33ff, 0x2e 174 .dw 0x3504, 0x3507, 0x21 175 .dw 0x350c, 0x350F, 0x21 176 .dw 0x3514, 0x3517, 0x21 177 .dw 0x351c, 0x351F, 0x21 178 .dw 0x3524, 0x3527, 0x21 179 .dw 0x352c, 0x352f, 0x21 180 .dw 0x3534, 0x3537, 0x21 181 .dw 0x353c, 0x353f, 0x21 182 .dw 0x3540, 0x35c6, 0x21 183 .dw 0x35c7, 0x35c7, 0x2e 184 .dw 0x35c8, 0x35ce, 0x21 185 .dw 0x35cf, 0x35cf, 0x2e 186 .dw 0x35d0, 0x35d6, 0x21 187 .dw 0x35d7, 0x35d7, 0x2e 188 .dw 0x35d8, 0x35de, 0x21 189 .dw 0x35df, 0x35df, 0x2e 190 .dw 0x35e0, 0x35e6, 0x21 191 .dw 0x35e7, 0x35e7, 0x2e 192 .dw 0x35e8, 0x35ee, 0x21 193 .dw 0x35ef, 0x35ef, 0x2e 194 .dw 0x35f0, 0x35f6, 0x21 195 .dw 0x35f7, 0x35f7, 0x2e 196 .dw 0x35f8, 0x35fe, 0x21 197 .dw 0x35ff, 0x35ff, 0x2e 198 .dw 0x3704, 0x3707, 0x21 199 .dw 0x370c, 0x370f, 0x21 200 .dw 0x3714, 0x3717, 0x21 201 .dw 0x371c, 0x371f, 0x21 202 .dw 0x3724, 0x3727, 0x21 203 .dw 0x372c, 0x372f, 0x21 204 .dw 0x3734, 0x3737, 0x21 205 .dw 0x373c, 0x37c6, 0x21 206 .dw 0x37c7, 0x37c7, 0x2e 207 .dw 0x37c8, 0x37ce, 0x21 208 .dw 0x37cf, 0x37cf, 0x2e 209 .dw 0x37d0, 0x37d6, 0x21 210 .dw 0x37d7, 0x37d7, 0x2e 211 .dw 0x37d8, 0x37de, 0x21 212 .dw 0x37df, 0x37df, 0x2e 213 .dw 0x37e0, 0x37e6, 0x21 214 .dw 0x37e7, 0x37e7, 0x2e 215 .dw 0x37e8, 0x37ee, 0x21 216 .dw 0x37ef, 0x37ef, 0x2e 217 .dw 0x37f0, 0x37f6, 0x21 218 .dw 0x37f7, 0x37f7, 0x2e 219 .dw 0x37f8, 0x37fe, 0x21 220 .dw 0x37ff, 0x37ff, 0x2e 221 .dw 0x3820, 0x382f, 0x21 222 .dw 0x3860, 0x386f, 0x21 223 .dw 0x38a0, 0x38af, 0x21 224 .dw 0x38b0, 0x38bf, 0x21 225 .dw 0x38e0, 0x38ef, 0x21 226 .dw 0x38f0, 0x38ff, 0x21 227 .dw 0x3904, 0x3907, 0x21 228 .dw 0x390c, 0x390f, 0x21 229 .dw 0x3914, 0x3917, 0x21 230 .dw 0x391c, 0x392f, 0x21 231 .dw 0x3934, 0x3937, 0x21 232 .dw 0x393c, 0x39bf, 0x21 233 .dw 0x397f, 0x397f, 0x2e 234 .dw 0x3980, 0x39bf, 0x21 235 .dw 0x39c0, 0x39c0, 0x2e 236 .dw 0x39c1, 0x39c7, 0x21 237 .dw 0x39c8, 0x39c8, 0x2e 238 .dw 0x39c9, 0x39cf, 0x21 239 .dw 0x39d0, 0x39d0, 0x2e 240 .dw 0x39d1, 0x39d7, 0x21 241 .dw 0x39d8, 0x39d8, 0x2e 242 .dw 0x39d9, 0x39ef, 0x21 243 .dw 0x39f0, 0x39f0, 0x2e 244 .dw 0x39f1, 0x39f6, 0x21 245 .dw 0x39f7, 0x39f8, 0x2e 246 .dw 0x39f9, 0x39fe, 0x21 247 .dw 0x39ff, 0x39ff, 0x2e 248 .dw 0x3a00, 0x3bff, 0x21 249 .dw 0x3c80, 0x3cff, 0x21 250 .dw 0x3d04, 0x3d07, 0x21 251 .dw 0x3d0c, 0x3d0f, 0x21 252 .dw 0x3d14, 0x3d17, 0x21 253 .dw 0x3d1c, 0x3d1f, 0x21 254 .dw 0x3d24, 0x3d27, 0x21 255 .dw 0x3d2c, 0x3d2f, 0x21 256 .dw 0x3d34, 0x3d37, 0x21 257 .dw 0x3d3c, 0x3dbf, 0X21 258 .dw 0x3dc0, 0x3dc0, 0x2e 259 .dw 0x3dc1, 0x3dc6, 0x21 260 .dw 0x3dc7, 0x3dc8, 0x2e 261 .dw 0x3dc9, 0x3dce, 0x21 262 .dw 0x3dcf, 0x3dd0, 0x2e 263 .dw 0x3dd1, 0x3dd6, 0x21 264 .dw 0x3dd7, 0x3dd8, 0x2e 265 .dw 0x3dd9, 0x3dde, 0x21 266 .dw 0x3ddf, 0x3de0, 0x2e 267 .dw 0x3de1, 0x3de6, 0x21 268 .dw 0x3de7, 0x3de8, 0x2e 269 .dw 0x3de9, 0x3dee, 0x21 270 .dw 0x3def, 0x3df0, 0x2e 271 .dw 0x3df1, 0x3df6, 0x21 272 .dw 0x3df7, 0x3df8, 0x2e 273 .dw 0x3df9, 0x3dfe, 0x21 274 .dw 0x3dff, 0x3e7f, 0x2e 275 .dw 0x3e80, 0x3eb7, 0x21 276 .dw 0x3eb8, 0x3ebf, 0x2e 277 .dw 0x3ec0, 0x3ef7, 0x21 278 .dw 0x3ef8, 0x3f03, 0x2e 279 .dw 0x3f04, 0x3f07, 0x21 280 .dw 0x3f08, 0x3f0b, 0x2e 281 .dw 0x3f0c, 0x3f0f, 0x21 282 .dw 0x3f10, 0x3f13, 0x2e 283 .dw 0x3f14, 0x3f17, 0x21 284 .dw 0x3f18, 0x3f1b, 0x2e 285 .dw 0x3f1c, 0x3f1f, 0x21 286 .dw 0x3f20, 0x3f23, 0x2e 287 .dw 0x3f24, 0x3f27, 0x21 288 .dw 0x3f28, 0x3f2b, 0x2e 289 .dw 0x3f2c, 0x3f2f, 0x21 290 .dw 0x3f30, 0x3f33, 0x2e 291 .dw 0x3f34, 0x3f37, 0x21 292 .dw 0x3f38, 0x3f3b, 0x2e 293 .dw 0x3f3c, 0x3f3d, 0x21 294 .dw 0x3f3e, 0x3f3f, 0x2e 295 .dw 0x3f40, 0x3fb7, 0x21 296 .dw 0x3fb8, 0x3fc0, 0x2e 297 .dw 0x3fc1, 0x3fc6, 0x21 298 .dw 0x3fc7, 0x3fc8, 0x2e 299 .dw 0x3fc9, 0x3fce, 0x21 300 .dw 0x3fcf, 0x3fd0, 0x2e 301 .dw 0x3fd1, 0x3fd6, 0x21 302 .dw 0x3fd7, 0x3fd8, 0x2e 303 .dw 0x3fd9, 0x3fde, 0x21 304 .dw 0x3fdf, 0x3fe0, 0x2e 305 .dw 0x3fe1, 0x3fe6, 0x21 306 .dw 0x3fe7, 0x3fe8, 0x2e 307 .dw 0x3fe9, 0x3fee, 0x21 308 .dw 0x3fef, 0x3ff0, 0x2e 309 .dw 0x3ff1, 0x3ff6, 0x21 310 .dw 0x3ff7, 0x3fff, 0x2e 311 .dw 0x4180, 0x41FF, 0x21 312 .dw 0x4480, 0x44bF, 0x21 313 .dw 0x4600, 0x47FF, 0x21 314 .dw 0x7000, 0x7FFF, 0x21 315 .dw 0x9040, 0x9040, 0x22 316 .dw 0x9049, 0x9049, 0x22 317 .dw 0x9052, 0x9052, 0x22 318 .dw 0x905b, 0x905b, 0x22 319 .dw 0x9064, 0x9064, 0x22 320 .dw 0x906d, 0x906d, 0x22 321 .dw 0x9076, 0x9076, 0x22 322 .dw 0x907f, 0x907f, 0x22 323 .dw 0x90c0, 0x90c0, 0x22 324 .dw 0x90c9, 0x90c9, 0x22 325 .dw 0x90d2, 0x90d2, 0x22 326 .dw 0x90db, 0x90db, 0x22 327 .dw 0x90e4, 0x90e4, 0x22 328 .dw 0x90ed, 0x90ed, 0x22 329 .dw 0x90f6, 0x90f6, 0x22 330 .dw 0x90ff, 0x90ff, 0x22 331 .dw 0x9180, 0x91ff, 0x21 332 .dw 0x9380, 0x93ff, 0x21 333 .dw 0x9580, 0x95ff, 0x21 334 .dw 0x9640, 0x967f, 0x21 335 .dw 0x96c0, 0x96ff, 0x21 336 .dw 0x9740, 0x97ff, 0x21 337 .dw 0x9980, 0x99ff, 0x21 338 .dw 0x9a40, 0x9a7f, 0x21 339 .dw 0x9ac0, 0x9aff, 0x21 340 .dw 0x9b40, 0x9bff, 0x21 341 .dw 0x9c60, 0x9c7f, 0x21 342 .dw 0x9ce0, 0x9cff, 0x21 343 .dw 0x9d60, 0x9d7f, 0x21 344 .dw 0x9ef0, 0x9eff, 0x21 345 .dw 0x9f70, 0x9f7f, 0x21 346 .dw 0x0000, 0x0000, 0x00 347.endm 348 349 se_all_test 350