ptrace-tar.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2015 Anshuman Khandual, IBM Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #define TAR_1 10
  10. #define TAR_2 20
  11. #define TAR_3 30
  12. #define TAR_4 40
  13. #define TAR_5 50
  14. #define DSCR_1 100
  15. #define DSCR_2 200
  16. #define DSCR_3 300
  17. #define DSCR_4 400
  18. #define DSCR_5 500
  19. #define PPR_1 0x4000000000000 /* or 31,31,31*/
  20. #define PPR_2 0x8000000000000 /* or 1,1,1 */
  21. #define PPR_3 0xc000000000000 /* or 6,6,6 */
  22. #define PPR_4 0x10000000000000 /* or 2,2,2 */
  23. char *user_read = "[User Read (Running)]";
  24. char *user_write = "[User Write (Running)]";
  25. char *ptrace_read_running = "[Ptrace Read (Running)]";
  26. char *ptrace_write_running = "[Ptrace Write (Running)]";
  27. char *ptrace_read_ckpt = "[Ptrace Read (Checkpointed)]";
  28. char *ptrace_write_ckpt = "[Ptrace Write (Checkpointed)]";
  29. int validate_tar_registers(unsigned long *reg, unsigned long tar,
  30. unsigned long ppr, unsigned long dscr)
  31. {
  32. int match = 1;
  33. if (reg[0] != tar)
  34. match = 0;
  35. if (reg[1] != ppr)
  36. match = 0;
  37. if (reg[2] != dscr)
  38. match = 0;
  39. if (!match)
  40. return TEST_FAIL;
  41. return TEST_PASS;
  42. }