]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/ptrace.h
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / ptrace.h
index 4435efe85d0edb37cd2d3de5b0307140cb8375b1..891d68932f39975143b7dcc42fe4e0fbf96a414a 100644 (file)
@@ -55,6 +55,8 @@ struct pt_regs {
 
 #ifdef __powerpc64__
 
+#define __ARCH_WANT_COMPAT_SYS_PTRACE
+
 #define STACK_FRAME_OVERHEAD   112     /* size of minimum stack frame */
 
 /* Size of dummy stack frame allocated when calling signal handler. */
@@ -73,6 +75,8 @@ struct pt_regs {
 #ifndef __ASSEMBLY__
 
 #define instruction_pointer(regs) ((regs)->nip)
+#define regs_return_value(regs) ((regs)->gpr[3])
+
 #ifdef CONFIG_SMP
 extern unsigned long profile_pc(struct pt_regs *regs);
 #else
@@ -90,6 +94,11 @@ extern unsigned long profile_pc(struct pt_regs *regs);
                set_thread_flag(TIF_NOERROR); \
        } while(0)
 
+struct task_struct;
+extern unsigned long ptrace_get_reg(struct task_struct *task, int regno);
+extern int ptrace_put_reg(struct task_struct *task, int regno,
+                         unsigned long data);
+
 /*
  * We use the least-significant bit of the trap field to indicate
  * whether we have saved the full set of registers, or only a
@@ -99,7 +108,8 @@ extern unsigned long profile_pc(struct pt_regs *regs);
  */
 #define FULL_REGS(regs)                (((regs)->trap & 1) == 0)
 #ifndef __powerpc64__
-#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) == 0)
+#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) != 0)
+#define IS_MCHECK_EXC(regs)    (((regs)->trap & 4) != 0)
 #endif /* ! __powerpc64__ */
 #define TRAP(regs)             ((regs)->trap & ~0xF)
 #ifdef __powerpc64__
@@ -112,6 +122,13 @@ do {                                                                             \
 } while (0)
 #endif /* __powerpc64__ */
 
+/*
+ * These are defined as per linux/ptrace.h, which see.
+ */
+#define arch_has_single_step() (1)
+extern void user_enable_single_step(struct task_struct *);
+extern void user_disable_single_step(struct task_struct *);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
@@ -156,9 +173,7 @@ do {                                                                              \
 
 #define PT_NIP 32
 #define PT_MSR 33
-#ifdef __KERNEL__
 #define PT_ORIG_R3 34
-#endif
 #define PT_CTR 35
 #define PT_LNK 36
 #define PT_XER 37
@@ -167,11 +182,12 @@ do {                                                                            \
 #define PT_MQ  39
 #else
 #define PT_SOFTE 39
+#endif
 #define PT_TRAP        40
 #define PT_DAR 41
 #define PT_DSISR 42
 #define PT_RESULT 43
-#endif
+#define PT_REGS_COUNT 44
 
 #define PT_FPR0        48      /* each FP reg occupies 2 slots in this space */
 
@@ -227,7 +243,17 @@ do {                                                                             \
 #define PTRACE_GET_DEBUGREG    25
 #define PTRACE_SET_DEBUGREG    26
 
-/* Additional PTRACE requests implemented on PowerPC. */
+/* (new) PTRACE requests using the same numbers as x86 and the same
+ * argument ordering. Additionally, they support more registers too
+ */
+#define PTRACE_GETREGS            12
+#define PTRACE_SETREGS            13
+#define PTRACE_GETFPREGS          14
+#define PTRACE_SETFPREGS          15
+#define PTRACE_GETREGS64         22
+#define PTRACE_SETREGS64         23
+
+/* (old) PTRACE requests with inverted arguments */
 #define PPC_PTRACE_GETREGS     0x99    /* Get GPRs 0 - 31 */
 #define PPC_PTRACE_SETREGS     0x98    /* Set GPRs 0 - 31 */
 #define PPC_PTRACE_GETFPREGS   0x97    /* Get FPRs 0 - 31 */