ptrace.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. /*
  2. * Ptrace interface test helper functions
  3. *
  4. * Copyright (C) 2015 Anshuman Khandual, IBM Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <inttypes.h>
  12. #include <unistd.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <malloc.h>
  16. #include <errno.h>
  17. #include <time.h>
  18. #include <sys/ptrace.h>
  19. #include <sys/ioctl.h>
  20. #include <sys/uio.h>
  21. #include <sys/types.h>
  22. #include <sys/wait.h>
  23. #include <sys/signal.h>
  24. #include <sys/ipc.h>
  25. #include <sys/shm.h>
  26. #include <sys/user.h>
  27. #include <linux/elf.h>
  28. #include <linux/types.h>
  29. #include <linux/auxvec.h>
  30. #include "reg.h"
  31. #include "utils.h"
  32. #define TEST_PASS 0
  33. #define TEST_FAIL 1
  34. struct fpr_regs {
  35. unsigned long fpr[32];
  36. unsigned long fpscr;
  37. };
  38. struct tm_spr_regs {
  39. unsigned long tm_tfhar;
  40. unsigned long tm_texasr;
  41. unsigned long tm_tfiar;
  42. };
  43. #ifndef NT_PPC_TAR
  44. #define NT_PPC_TAR 0x103
  45. #define NT_PPC_PPR 0x104
  46. #define NT_PPC_DSCR 0x105
  47. #define NT_PPC_EBB 0x106
  48. #define NT_PPC_PMU 0x107
  49. #define NT_PPC_TM_CGPR 0x108
  50. #define NT_PPC_TM_CFPR 0x109
  51. #define NT_PPC_TM_CVMX 0x10a
  52. #define NT_PPC_TM_CVSX 0x10b
  53. #define NT_PPC_TM_SPR 0x10c
  54. #define NT_PPC_TM_CTAR 0x10d
  55. #define NT_PPC_TM_CPPR 0x10e
  56. #define NT_PPC_TM_CDSCR 0x10f
  57. #endif
  58. /* Basic ptrace operations */
  59. int start_trace(pid_t child)
  60. {
  61. int ret;
  62. ret = ptrace(PTRACE_ATTACH, child, NULL, NULL);
  63. if (ret) {
  64. perror("ptrace(PTRACE_ATTACH) failed");
  65. return TEST_FAIL;
  66. }
  67. ret = waitpid(child, NULL, 0);
  68. if (ret != child) {
  69. perror("waitpid() failed");
  70. return TEST_FAIL;
  71. }
  72. return TEST_PASS;
  73. }
  74. int stop_trace(pid_t child)
  75. {
  76. int ret;
  77. ret = ptrace(PTRACE_DETACH, child, NULL, NULL);
  78. if (ret) {
  79. perror("ptrace(PTRACE_DETACH) failed");
  80. return TEST_FAIL;
  81. }
  82. return TEST_PASS;
  83. }
  84. int cont_trace(pid_t child)
  85. {
  86. int ret;
  87. ret = ptrace(PTRACE_CONT, child, NULL, NULL);
  88. if (ret) {
  89. perror("ptrace(PTRACE_CONT) failed");
  90. return TEST_FAIL;
  91. }
  92. return TEST_PASS;
  93. }
  94. int ptrace_read_regs(pid_t child, unsigned long type, unsigned long regs[],
  95. int n)
  96. {
  97. struct iovec iov;
  98. long ret;
  99. FAIL_IF(start_trace(child));
  100. iov.iov_base = regs;
  101. iov.iov_len = n * sizeof(unsigned long);
  102. ret = ptrace(PTRACE_GETREGSET, child, type, &iov);
  103. if (ret)
  104. return ret;
  105. FAIL_IF(stop_trace(child));
  106. return TEST_PASS;
  107. }
  108. long ptrace_write_regs(pid_t child, unsigned long type, unsigned long regs[],
  109. int n)
  110. {
  111. struct iovec iov;
  112. long ret;
  113. FAIL_IF(start_trace(child));
  114. iov.iov_base = regs;
  115. iov.iov_len = n * sizeof(unsigned long);
  116. ret = ptrace(PTRACE_SETREGSET, child, type, &iov);
  117. FAIL_IF(stop_trace(child));
  118. return ret;
  119. }
  120. /* TAR, PPR, DSCR */
  121. int show_tar_registers(pid_t child, unsigned long *out)
  122. {
  123. struct iovec iov;
  124. unsigned long *reg;
  125. int ret;
  126. reg = malloc(sizeof(unsigned long));
  127. if (!reg) {
  128. perror("malloc() failed");
  129. return TEST_FAIL;
  130. }
  131. iov.iov_base = (u64 *) reg;
  132. iov.iov_len = sizeof(unsigned long);
  133. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TAR, &iov);
  134. if (ret) {
  135. perror("ptrace(PTRACE_GETREGSET) failed");
  136. goto fail;
  137. }
  138. if (out)
  139. out[0] = *reg;
  140. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_PPR, &iov);
  141. if (ret) {
  142. perror("ptrace(PTRACE_GETREGSET) failed");
  143. goto fail;
  144. }
  145. if (out)
  146. out[1] = *reg;
  147. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_DSCR, &iov);
  148. if (ret) {
  149. perror("ptrace(PTRACE_GETREGSET) failed");
  150. goto fail;
  151. }
  152. if (out)
  153. out[2] = *reg;
  154. free(reg);
  155. return TEST_PASS;
  156. fail:
  157. free(reg);
  158. return TEST_FAIL;
  159. }
  160. int write_tar_registers(pid_t child, unsigned long tar,
  161. unsigned long ppr, unsigned long dscr)
  162. {
  163. struct iovec iov;
  164. unsigned long *reg;
  165. int ret;
  166. reg = malloc(sizeof(unsigned long));
  167. if (!reg) {
  168. perror("malloc() failed");
  169. return TEST_FAIL;
  170. }
  171. iov.iov_base = (u64 *) reg;
  172. iov.iov_len = sizeof(unsigned long);
  173. *reg = tar;
  174. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TAR, &iov);
  175. if (ret) {
  176. perror("ptrace(PTRACE_SETREGSET) failed");
  177. goto fail;
  178. }
  179. *reg = ppr;
  180. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_PPR, &iov);
  181. if (ret) {
  182. perror("ptrace(PTRACE_SETREGSET) failed");
  183. goto fail;
  184. }
  185. *reg = dscr;
  186. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_DSCR, &iov);
  187. if (ret) {
  188. perror("ptrace(PTRACE_SETREGSET) failed");
  189. goto fail;
  190. }
  191. free(reg);
  192. return TEST_PASS;
  193. fail:
  194. free(reg);
  195. return TEST_FAIL;
  196. }
  197. int show_tm_checkpointed_state(pid_t child, unsigned long *out)
  198. {
  199. struct iovec iov;
  200. unsigned long *reg;
  201. int ret;
  202. reg = malloc(sizeof(unsigned long));
  203. if (!reg) {
  204. perror("malloc() failed");
  205. return TEST_FAIL;
  206. }
  207. iov.iov_base = (u64 *) reg;
  208. iov.iov_len = sizeof(unsigned long);
  209. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CTAR, &iov);
  210. if (ret) {
  211. perror("ptrace(PTRACE_GETREGSET) failed");
  212. goto fail;
  213. }
  214. if (out)
  215. out[0] = *reg;
  216. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CPPR, &iov);
  217. if (ret) {
  218. perror("ptrace(PTRACE_GETREGSET) failed");
  219. goto fail;
  220. }
  221. if (out)
  222. out[1] = *reg;
  223. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CDSCR, &iov);
  224. if (ret) {
  225. perror("ptrace(PTRACE_GETREGSET) failed");
  226. goto fail;
  227. }
  228. if (out)
  229. out[2] = *reg;
  230. free(reg);
  231. return TEST_PASS;
  232. fail:
  233. free(reg);
  234. return TEST_FAIL;
  235. }
  236. int write_ckpt_tar_registers(pid_t child, unsigned long tar,
  237. unsigned long ppr, unsigned long dscr)
  238. {
  239. struct iovec iov;
  240. unsigned long *reg;
  241. int ret;
  242. reg = malloc(sizeof(unsigned long));
  243. if (!reg) {
  244. perror("malloc() failed");
  245. return TEST_FAIL;
  246. }
  247. iov.iov_base = (u64 *) reg;
  248. iov.iov_len = sizeof(unsigned long);
  249. *reg = tar;
  250. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CTAR, &iov);
  251. if (ret) {
  252. perror("ptrace(PTRACE_GETREGSET) failed");
  253. goto fail;
  254. }
  255. *reg = ppr;
  256. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CPPR, &iov);
  257. if (ret) {
  258. perror("ptrace(PTRACE_GETREGSET) failed");
  259. goto fail;
  260. }
  261. *reg = dscr;
  262. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CDSCR, &iov);
  263. if (ret) {
  264. perror("ptrace(PTRACE_GETREGSET) failed");
  265. goto fail;
  266. }
  267. free(reg);
  268. return TEST_PASS;
  269. fail:
  270. free(reg);
  271. return TEST_FAIL;
  272. }
  273. /* FPR */
  274. int show_fpr(pid_t child, unsigned long *fpr)
  275. {
  276. struct fpr_regs *regs;
  277. int ret, i;
  278. regs = (struct fpr_regs *) malloc(sizeof(struct fpr_regs));
  279. ret = ptrace(PTRACE_GETFPREGS, child, NULL, regs);
  280. if (ret) {
  281. perror("ptrace(PTRACE_GETREGSET) failed");
  282. return TEST_FAIL;
  283. }
  284. if (fpr) {
  285. for (i = 0; i < 32; i++)
  286. fpr[i] = regs->fpr[i];
  287. }
  288. return TEST_PASS;
  289. }
  290. int write_fpr(pid_t child, unsigned long val)
  291. {
  292. struct fpr_regs *regs;
  293. int ret, i;
  294. regs = (struct fpr_regs *) malloc(sizeof(struct fpr_regs));
  295. ret = ptrace(PTRACE_GETFPREGS, child, NULL, regs);
  296. if (ret) {
  297. perror("ptrace(PTRACE_GETREGSET) failed");
  298. return TEST_FAIL;
  299. }
  300. for (i = 0; i < 32; i++)
  301. regs->fpr[i] = val;
  302. ret = ptrace(PTRACE_SETFPREGS, child, NULL, regs);
  303. if (ret) {
  304. perror("ptrace(PTRACE_GETREGSET) failed");
  305. return TEST_FAIL;
  306. }
  307. return TEST_PASS;
  308. }
  309. int show_ckpt_fpr(pid_t child, unsigned long *fpr)
  310. {
  311. struct fpr_regs *regs;
  312. struct iovec iov;
  313. int ret, i;
  314. regs = (struct fpr_regs *) malloc(sizeof(struct fpr_regs));
  315. iov.iov_base = regs;
  316. iov.iov_len = sizeof(struct fpr_regs);
  317. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CFPR, &iov);
  318. if (ret) {
  319. perror("ptrace(PTRACE_GETREGSET) failed");
  320. return TEST_FAIL;
  321. }
  322. if (fpr) {
  323. for (i = 0; i < 32; i++)
  324. fpr[i] = regs->fpr[i];
  325. }
  326. return TEST_PASS;
  327. }
  328. int write_ckpt_fpr(pid_t child, unsigned long val)
  329. {
  330. struct fpr_regs *regs;
  331. struct iovec iov;
  332. int ret, i;
  333. regs = (struct fpr_regs *) malloc(sizeof(struct fpr_regs));
  334. iov.iov_base = regs;
  335. iov.iov_len = sizeof(struct fpr_regs);
  336. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CFPR, &iov);
  337. if (ret) {
  338. perror("ptrace(PTRACE_GETREGSET) failed");
  339. return TEST_FAIL;
  340. }
  341. for (i = 0; i < 32; i++)
  342. regs->fpr[i] = val;
  343. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CFPR, &iov);
  344. if (ret) {
  345. perror("ptrace(PTRACE_GETREGSET) failed");
  346. return TEST_FAIL;
  347. }
  348. return TEST_PASS;
  349. }
  350. /* GPR */
  351. int show_gpr(pid_t child, unsigned long *gpr)
  352. {
  353. struct pt_regs *regs;
  354. int ret, i;
  355. regs = (struct pt_regs *) malloc(sizeof(struct pt_regs));
  356. if (!regs) {
  357. perror("malloc() failed");
  358. return TEST_FAIL;
  359. }
  360. ret = ptrace(PTRACE_GETREGS, child, NULL, regs);
  361. if (ret) {
  362. perror("ptrace(PTRACE_GETREGSET) failed");
  363. return TEST_FAIL;
  364. }
  365. if (gpr) {
  366. for (i = 14; i < 32; i++)
  367. gpr[i-14] = regs->gpr[i];
  368. }
  369. return TEST_PASS;
  370. }
  371. int write_gpr(pid_t child, unsigned long val)
  372. {
  373. struct pt_regs *regs;
  374. int i, ret;
  375. regs = (struct pt_regs *) malloc(sizeof(struct pt_regs));
  376. if (!regs) {
  377. perror("malloc() failed");
  378. return TEST_FAIL;
  379. }
  380. ret = ptrace(PTRACE_GETREGS, child, NULL, regs);
  381. if (ret) {
  382. perror("ptrace(PTRACE_GETREGSET) failed");
  383. return TEST_FAIL;
  384. }
  385. for (i = 14; i < 32; i++)
  386. regs->gpr[i] = val;
  387. ret = ptrace(PTRACE_SETREGS, child, NULL, regs);
  388. if (ret) {
  389. perror("ptrace(PTRACE_GETREGSET) failed");
  390. return TEST_FAIL;
  391. }
  392. return TEST_PASS;
  393. }
  394. int show_ckpt_gpr(pid_t child, unsigned long *gpr)
  395. {
  396. struct pt_regs *regs;
  397. struct iovec iov;
  398. int ret, i;
  399. regs = (struct pt_regs *) malloc(sizeof(struct pt_regs));
  400. if (!regs) {
  401. perror("malloc() failed");
  402. return TEST_FAIL;
  403. }
  404. iov.iov_base = (u64 *) regs;
  405. iov.iov_len = sizeof(struct pt_regs);
  406. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CGPR, &iov);
  407. if (ret) {
  408. perror("ptrace(PTRACE_GETREGSET) failed");
  409. return TEST_FAIL;
  410. }
  411. if (gpr) {
  412. for (i = 14; i < 32; i++)
  413. gpr[i-14] = regs->gpr[i];
  414. }
  415. return TEST_PASS;
  416. }
  417. int write_ckpt_gpr(pid_t child, unsigned long val)
  418. {
  419. struct pt_regs *regs;
  420. struct iovec iov;
  421. int ret, i;
  422. regs = (struct pt_regs *) malloc(sizeof(struct pt_regs));
  423. if (!regs) {
  424. perror("malloc() failed\n");
  425. return TEST_FAIL;
  426. }
  427. iov.iov_base = (u64 *) regs;
  428. iov.iov_len = sizeof(struct pt_regs);
  429. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CGPR, &iov);
  430. if (ret) {
  431. perror("ptrace(PTRACE_GETREGSET) failed");
  432. return TEST_FAIL;
  433. }
  434. for (i = 14; i < 32; i++)
  435. regs->gpr[i] = val;
  436. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CGPR, &iov);
  437. if (ret) {
  438. perror("ptrace(PTRACE_GETREGSET) failed");
  439. return TEST_FAIL;
  440. }
  441. return TEST_PASS;
  442. }
  443. /* VMX */
  444. int show_vmx(pid_t child, unsigned long vmx[][2])
  445. {
  446. int ret;
  447. ret = ptrace(PTRACE_GETVRREGS, child, 0, vmx);
  448. if (ret) {
  449. perror("ptrace(PTRACE_GETVRREGS) failed");
  450. return TEST_FAIL;
  451. }
  452. return TEST_PASS;
  453. }
  454. int show_vmx_ckpt(pid_t child, unsigned long vmx[][2])
  455. {
  456. unsigned long regs[34][2];
  457. struct iovec iov;
  458. int ret;
  459. iov.iov_base = (u64 *) regs;
  460. iov.iov_len = sizeof(regs);
  461. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CVMX, &iov);
  462. if (ret) {
  463. perror("ptrace(PTRACE_GETREGSET, NT_PPC_TM_CVMX) failed");
  464. return TEST_FAIL;
  465. }
  466. memcpy(vmx, regs, sizeof(regs));
  467. return TEST_PASS;
  468. }
  469. int write_vmx(pid_t child, unsigned long vmx[][2])
  470. {
  471. int ret;
  472. ret = ptrace(PTRACE_SETVRREGS, child, 0, vmx);
  473. if (ret) {
  474. perror("ptrace(PTRACE_SETVRREGS) failed");
  475. return TEST_FAIL;
  476. }
  477. return TEST_PASS;
  478. }
  479. int write_vmx_ckpt(pid_t child, unsigned long vmx[][2])
  480. {
  481. unsigned long regs[34][2];
  482. struct iovec iov;
  483. int ret;
  484. memcpy(regs, vmx, sizeof(regs));
  485. iov.iov_base = (u64 *) regs;
  486. iov.iov_len = sizeof(regs);
  487. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CVMX, &iov);
  488. if (ret) {
  489. perror("ptrace(PTRACE_SETREGSET, NT_PPC_TM_CVMX) failed");
  490. return TEST_FAIL;
  491. }
  492. return TEST_PASS;
  493. }
  494. /* VSX */
  495. int show_vsx(pid_t child, unsigned long *vsx)
  496. {
  497. int ret;
  498. ret = ptrace(PTRACE_GETVSRREGS, child, 0, vsx);
  499. if (ret) {
  500. perror("ptrace(PTRACE_GETVSRREGS) failed");
  501. return TEST_FAIL;
  502. }
  503. return TEST_PASS;
  504. }
  505. int show_vsx_ckpt(pid_t child, unsigned long *vsx)
  506. {
  507. unsigned long regs[32];
  508. struct iovec iov;
  509. int ret;
  510. iov.iov_base = (u64 *) regs;
  511. iov.iov_len = sizeof(regs);
  512. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_CVSX, &iov);
  513. if (ret) {
  514. perror("ptrace(PTRACE_GETREGSET, NT_PPC_TM_CVSX) failed");
  515. return TEST_FAIL;
  516. }
  517. memcpy(vsx, regs, sizeof(regs));
  518. return TEST_PASS;
  519. }
  520. int write_vsx(pid_t child, unsigned long *vsx)
  521. {
  522. int ret;
  523. ret = ptrace(PTRACE_SETVSRREGS, child, 0, vsx);
  524. if (ret) {
  525. perror("ptrace(PTRACE_SETVSRREGS) failed");
  526. return TEST_FAIL;
  527. }
  528. return TEST_PASS;
  529. }
  530. int write_vsx_ckpt(pid_t child, unsigned long *vsx)
  531. {
  532. unsigned long regs[32];
  533. struct iovec iov;
  534. int ret;
  535. memcpy(regs, vsx, sizeof(regs));
  536. iov.iov_base = (u64 *) regs;
  537. iov.iov_len = sizeof(regs);
  538. ret = ptrace(PTRACE_SETREGSET, child, NT_PPC_TM_CVSX, &iov);
  539. if (ret) {
  540. perror("ptrace(PTRACE_SETREGSET, NT_PPC_TM_CVSX) failed");
  541. return TEST_FAIL;
  542. }
  543. return TEST_PASS;
  544. }
  545. /* TM SPR */
  546. int show_tm_spr(pid_t child, struct tm_spr_regs *out)
  547. {
  548. struct tm_spr_regs *regs;
  549. struct iovec iov;
  550. int ret;
  551. regs = (struct tm_spr_regs *) malloc(sizeof(struct tm_spr_regs));
  552. if (!regs) {
  553. perror("malloc() failed");
  554. return TEST_FAIL;
  555. }
  556. iov.iov_base = (u64 *) regs;
  557. iov.iov_len = sizeof(struct tm_spr_regs);
  558. ret = ptrace(PTRACE_GETREGSET, child, NT_PPC_TM_SPR, &iov);
  559. if (ret) {
  560. perror("ptrace(PTRACE_GETREGSET) failed");
  561. return TEST_FAIL;
  562. }
  563. if (out)
  564. memcpy(out, regs, sizeof(struct tm_spr_regs));
  565. return TEST_PASS;
  566. }
  567. /* Analyse TEXASR after TM failure */
  568. inline unsigned long get_tfiar(void)
  569. {
  570. unsigned long ret;
  571. asm volatile("mfspr %0,%1" : "=r" (ret) : "i" (SPRN_TFIAR));
  572. return ret;
  573. }
  574. void analyse_texasr(unsigned long texasr)
  575. {
  576. printf("TEXASR: %16lx\t", texasr);
  577. if (texasr & TEXASR_FP)
  578. printf("TEXASR_FP ");
  579. if (texasr & TEXASR_DA)
  580. printf("TEXASR_DA ");
  581. if (texasr & TEXASR_NO)
  582. printf("TEXASR_NO ");
  583. if (texasr & TEXASR_FO)
  584. printf("TEXASR_FO ");
  585. if (texasr & TEXASR_SIC)
  586. printf("TEXASR_SIC ");
  587. if (texasr & TEXASR_NTC)
  588. printf("TEXASR_NTC ");
  589. if (texasr & TEXASR_TC)
  590. printf("TEXASR_TC ");
  591. if (texasr & TEXASR_TIC)
  592. printf("TEXASR_TIC ");
  593. if (texasr & TEXASR_IC)
  594. printf("TEXASR_IC ");
  595. if (texasr & TEXASR_IFC)
  596. printf("TEXASR_IFC ");
  597. if (texasr & TEXASR_ABT)
  598. printf("TEXASR_ABT ");
  599. if (texasr & TEXASR_SPD)
  600. printf("TEXASR_SPD ");
  601. if (texasr & TEXASR_HV)
  602. printf("TEXASR_HV ");
  603. if (texasr & TEXASR_PR)
  604. printf("TEXASR_PR ");
  605. if (texasr & TEXASR_FS)
  606. printf("TEXASR_FS ");
  607. if (texasr & TEXASR_TE)
  608. printf("TEXASR_TE ");
  609. if (texasr & TEXASR_ROT)
  610. printf("TEXASR_ROT ");
  611. printf("TFIAR :%lx\n", get_tfiar());
  612. }
  613. void store_gpr(unsigned long *addr);
  614. void store_fpr(float *addr);