home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Include / asm / ptrace.h < prev    next >
C/C++ Source or Header  |  2002-04-26  |  1KB  |  66 lines

  1. /* $Id: ptrace.h,v 1.2 2002/04/26 23:09:21 smilcke Exp $ */
  2.  
  3. #ifndef _I386_PTRACE_H
  4. #define _I386_PTRACE_H
  5.  
  6. #define EBX 0
  7. #define ECX 1
  8. #define EDX 2
  9. #define ESI 3
  10. #define EDI 4
  11. #define EBP 5
  12. #define EAX 6
  13. #define DS 7
  14. #define ES 8
  15. #define FS 9
  16. #define GS 10
  17. #define ORIG_EAX 11
  18. #define EIP 12
  19. #define CS  13
  20. #define EFL 14
  21. #define UESP 15
  22. #define SS   16
  23. #define FRAME_SIZE 17
  24.  
  25. /* this struct defines the way the registers are stored on the 
  26.    stack during a system call. */
  27.  
  28. struct pt_regs {
  29.     long ebx;
  30.     long ecx;
  31.     long edx;
  32.     long esi;
  33.     long edi;
  34.     long ebp;
  35.     long eax;
  36.     int  xds;
  37.     int  xes;
  38.     long orig_eax;
  39.     long eip;
  40.     int  xcs;
  41.     long eflags;
  42.     long esp;
  43.     int  xss;
  44. };
  45.  
  46. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  47. #define PTRACE_GETREGS            12
  48. #define PTRACE_SETREGS            13
  49. #define PTRACE_GETFPREGS          14
  50. #define PTRACE_SETFPREGS          15
  51. #define PTRACE_GETFPXREGS         18
  52. #define PTRACE_SETFPXREGS         19
  53.  
  54. #define PTRACE_SETOPTIONS         21
  55.  
  56. /* options set using PTRACE_SETOPTIONS */
  57. #define PTRACE_O_TRACESYSGOOD     0x00000001
  58.  
  59. #ifdef __KERNEL__
  60. #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs))
  61. #define instruction_pointer(regs) ((regs)->eip)
  62. extern void show_regs(struct pt_regs *);
  63. #endif
  64.  
  65. #endif
  66.