1 /* 2 * linux/include/asm-mips/ptrace.h 3 * 4 * This file is subject to the terms and conditions of the GNU General Public 5 * License. See the file "COPYING" in the main directory of this archive 6 * for more details. 7 * 8 * Copyright (C) 1994, 1995 by Waldorf GMBH 9 * written by Ralf Baechle 10 * 11 * Machine dependent structs and defines to help the user use 12 * the ptrace system call. 13 */ 14 #ifndef__ASM_MIPS_PTRACE_H 15 #define__ASM_MIPS_PTRACE_H 16
17 /* 18 * This struct defines the way the registers are stored on the stack during a 19 * system call/exception. As usual the registers k0/k1 aren't being saved. 20 */ 21 structpt_regs{ 22 /* 23 * Pad bytes for argument save space on the stack 24 * 20/40 Bytes for 32/64 bit code 25 */ 26 unsignedlongpad0[5];
27
28 /* 29 * saved main processor registers 30 */ 31 longreg1, reg2, reg3, reg4, reg5, reg6, reg7;
32 longreg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15;
33 longreg16, reg17, reg18, reg19, reg20, reg21, reg22, reg23;
34 longreg24, reg25, reg28, reg29, reg30, reg31;
35
36 /* 37 * Saved special registers 38 */ 39 longlo;
40 longhi;
41
42 /* 43 * saved cp0 registers 44 */ 45 unsignedlongcp0_status;
46 unsignedlongcp0_epc;
47 unsignedlongcp0_cause;
48
49 /* 50 * Some goodies... 51 */ 52 unsignedlonginterrupt;
53 longorig_reg2;
54 longpad1;
55 };
56
57 #ifdef__KERNEL__ 58
59 /* 60 * Does the process account for user or for system time? 61 */ 62 #ifdefined (__R4000__)
63
64 #defineuser_mode(regs) ((regs)->cp0_status & 0x10)
65
66 #else/* !defined (__R4000__) */ 67
68 #defineuser_mode(regs) (!((regs)->cp0_status & 0x8))
69
70 #endif/* !defined (__R4000__) */ 71
72 #defineinstruction_pointer(regs) ((regs)->cp0_epc)
73 externvoidshow_regs(structpt_regs *);
74 #endif 75
76 #endif/* __ASM_MIPS_PTRACE_H */