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 /* Other saved registers. */
45 unsigned long cp0_epc;
46 unsigned long cp0_badvaddr;
47 unsigned long cp0_status;
48 unsigned long cp0_cause;
52 #define __str(x) __str2(x)
54 #define save_static_function(symbol) \
56 ".globl\t" #symbol "\n\t" \
58 ".type\t" #symbol ", @function\n\t" \
59 ".ent\t" #symbol ", 0\n" \
61 ".frame\t$29, 0, $31\n\t" \
62 "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
63 "sw\t$17,"__str(PT_R17)"($29)\n\t" \
64 "sw\t$18,"__str(PT_R18)"($29)\n\t" \
65 "sw\t$19,"__str(PT_R19)"($29)\n\t" \
66 "sw\t$20,"__str(PT_R20)"($29)\n\t" \
67 "sw\t$21,"__str(PT_R21)"($29)\n\t" \
68 "sw\t$22,"__str(PT_R22)"($29)\n\t" \
69 "sw\t$23,"__str(PT_R23)"($29)\n\t" \
70 "sw\t$30,"__str(PT_R30)"($29)\n\t" \
71 ".end\t" #symbol "\n\t" \
72 ".size\t" #symbol",. - " #symbol)
74 /* Used in declaration of save_static functions. */
75 #define static_unused static __attribute__((unused))
77 #endif /* !__ASSEMBLY__ */
79 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
80 /* #define PTRACE_GETREGS 12 */
81 /* #define PTRACE_SETREGS 13 */
82 /* #define PTRACE_GETFPREGS 14 */
83 /* #define PTRACE_SETFPREGS 15 */
84 /* #define PTRACE_GETFPXREGS 18 */
85 /* #define PTRACE_SETFPXREGS 19 */
87 #define PTRACE_SETOPTIONS 21
89 /* options set using PTRACE_SETOPTIONS */
90 #define PTRACE_O_TRACESYSGOOD 0x00000001
93 #include <asm/offset.h>
100 * Does the process account for user or for system time?
102 #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
104 #define instruction_pointer(regs) ((regs)->cp0_epc)
106 extern void show_regs(struct pt_regs *);
107 #endif /* !__ASSEMBLY__ */
111 #endif /* _ASM_PTRACE_H */