2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
8 * Machine dependent structs and defines to help the user use
9 * the ptrace system call.
14 #include <asm/isadep.h>
16 /* 0 - 31 are integer registers, 32 - 63 are fp registers. */
28 * This struct defines the way the registers are stored on the stack during a
29 * system call/exception. As usual the registers k0/k1 aren't being saved.
32 /* Pad bytes for argument save space on the stack. */
33 unsigned long pad0[6];
35 /* Saved main processor registers. */
36 unsigned long regs[32];
38 /* Saved special registers. */
39 unsigned long cp0_status;
42 unsigned long cp0_badvaddr;
43 unsigned long cp0_cause;
44 unsigned long cp0_epc;
48 #define __str(x) __str2(x)
50 #define save_static_function(symbol) \
52 ".globl\t" #symbol "\n\t" \
54 ".type\t" #symbol ", @function\n\t" \
55 ".ent\t" #symbol ", 0\n" \
57 ".frame\t$29, 0, $31\n\t" \
58 "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
59 "sw\t$17,"__str(PT_R17)"($29)\n\t" \
60 "sw\t$18,"__str(PT_R18)"($29)\n\t" \
61 "sw\t$19,"__str(PT_R19)"($29)\n\t" \
62 "sw\t$20,"__str(PT_R20)"($29)\n\t" \
63 "sw\t$21,"__str(PT_R21)"($29)\n\t" \
64 "sw\t$22,"__str(PT_R22)"($29)\n\t" \
65 "sw\t$23,"__str(PT_R23)"($29)\n\t" \
66 "sw\t$30,"__str(PT_R30)"($29)\n\t" \
67 ".end\t" #symbol "\n\t" \
68 ".size\t" #symbol",. - " #symbol)
70 /* Used in declaration of save_static functions. */
71 #define static_unused static __attribute__((unused))
73 #endif /* !__ASSEMBLY__ */
75 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
76 /* #define PTRACE_GETREGS 12 */
77 /* #define PTRACE_SETREGS 13 */
78 /* #define PTRACE_GETFPREGS 14 */
79 /* #define PTRACE_SETFPREGS 15 */
80 /* #define PTRACE_GETFPXREGS 18 */
81 /* #define PTRACE_SETFPXREGS 19 */
83 #define PTRACE_SETOPTIONS 21
85 /* options set using PTRACE_SETOPTIONS */
86 #define PTRACE_O_TRACESYSGOOD 0x00000001
89 #include <asm/offset.h>
96 * Does the process account for user or for system time?
98 #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
100 #define instruction_pointer(regs) ((regs)->cp0_epc)
102 extern void show_regs(struct pt_regs *);
103 #endif /* !__ASSEMBLY__ */
107 #endif /* _ASM_PTRACE_H */