1 /* 2 * linux/include/asm-mips/ptrace.h 3 * 4 * machine dependent structs and defines to help the user use 5 * the ptrace system call. 6 */ 7 #ifndef __ASM_MIPS_PTRACE_H 8 #define __ASM_MIPS_PTRACE_H 9 10 /* 11 * use ptrace (3 or 6, pid, PT_EXCL, data); to read or write 12 * the processes registers. 13 * 14 * This defines/structures correspond to the register layout on stack - 15 * if the order here is changed, it needs to be updated in 16 * arch/mips/fork.c:copy_process, asm/mips/signal.c:do_signal, 17 * asm-mips/ptrace.c, include/asm-mips/ptrace.h. 18 */ 19 20 #include <asm/stackframe.h> 21 22 /* 23 * This struct defines the way the registers are stored on the 24 * stack during a system call/exception. As usual the registers 25 * k0/k1 aren't being saved. 26 */ 27 struct pt_regs { 28 /* 29 * Pad bytes for argument save space on the stack 30 */ 31 unsigned long pad0[FR_REG1/sizeof(unsigned long)]; 32 33 /* 34 * saved main processor registers 35 */ 36 long reg1, reg2, reg3, reg4, reg5, reg6, reg7; 37 long reg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15; 38 long reg16, reg17, reg18, reg19, reg20, reg21, reg22, reg23; 39 long reg24, reg25, reg28, reg29, reg30, reg31; 40 41 /* 42 * Saved special registers 43 */ 44 long lo; 45 long hi; 46 47 /* 48 * saved cp0 registers 49 */ 50 unsigned long cp0_status; 51 unsigned long cp0_epc; 52 unsigned long cp0_cause; 53 54 /* 55 * Some goodies... 56 */ 57 unsigned long interrupt; 58 long orig_reg2; 59 }; 60 61 /* 62 * Does the process account for user or for system time? 63 */ 64 #if defined (__R4000__) 65 66 #define user_mode(regs) (!((regs)->cp0_status & 0x18)) 67 68 #else /* !defined (__R4000__) */ 69 70 #error "#define user_mode(regs) for R3000!" 71 72 #endif /* !defined (__R4000__) */ 73 74 #endif /* __ASM_MIPS_PTRACE_H */