summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/ptrace.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1995-11-14 08:00:00 +0000
committer <ralf@linux-mips.org>1995-11-14 08:00:00 +0000
commite7c2a72e2680827d6a733931273a93461c0d8d1b (patch)
treec9abeda78ef7504062bb2e816bcf3e3c9d680112 /include/asm-mips/ptrace.h
parentec6044459060a8c9ce7f64405c465d141898548c (diff)
Import of Linux/MIPS 1.3.0
Diffstat (limited to 'include/asm-mips/ptrace.h')
-rw-r--r--include/asm-mips/ptrace.h138
1 files changed, 80 insertions, 58 deletions
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 97b08ce74..18cdb8387 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -1,110 +1,132 @@
/*
* linux/include/asm-mips/ptrace.h
*
- * machine dependend structs and defines to help the user use
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 1995 by Waldorf GMBH
+ * written by Ralf Baechle
+ *
+ * Machine dependent structs and defines to help the user use
* the ptrace system call.
*/
-#ifndef _ASM_MIPS_PTRACE_H
-#define _ASM_MIPS_PTRACE_H
+#ifndef __ASM_MIPS_PTRACE_H
+#define __ASM_MIPS_PTRACE_H
/*
- * use ptrace (3 or 6, pid, PT_EXCL, data); to read or write
- * the processes registers.
- *
- * This defines/structures corrospond to the register layout on stack -
+ * This defines/structures correspond to the register layout on stack -
* if the order here is changed, it needs to be updated in
- * arch/mips/fork.c:copy_process, asm/mips/signal.c:do_signal,
- * asm-mips/ptrace.c, include/asm-mips/ptrace.h.
+ * include/asm-mips/stackframe.h
*/
-
-#define IN_REG1 0
-#define IN_REG2 1
-#define IN_REG3 2
-#define IN_REG4 3
-#define IN_REG5 4
-#define IN_REG6 5
-#define IN_REG7 6
-#define IN_REG8 7
-#define IN_REG9 8
-#define IN_REG10 9
-#define IN_REG11 10
-#define IN_REG12 11
-#define IN_REG13 12
-#define IN_REG14 13
-#define IN_REG15 14
-#define IN_REG16 15
-#define IN_REG17 16
-#define IN_REG18 17
-#define IN_REG19 18
-#define IN_REG20 19
-#define IN_REG21 20
-#define IN_REG22 21
-#define IN_REG23 22
-#define IN_REG24 23
-#define IN_REG25 24
-
+#define IN_REG1 5
+#define IN_REG2 6
+#define IN_REG3 7
+#define IN_REG4 8
+#define IN_REG5 9
+#define IN_REG6 10
+#define IN_REG7 11
+#define IN_REG8 12
+#define IN_REG9 13
+#define IN_REG10 14
+#define IN_REG11 15
+#define IN_REG12 16
+#define IN_REG13 17
+#define IN_REG14 18
+#define IN_REG15 19
+#define IN_REG16 20
+#define IN_REG17 21
+#define IN_REG18 22
+#define IN_REG19 23
+#define IN_REG20 24
+#define IN_REG21 25
+#define IN_REG22 26
+#define IN_REG23 27
+#define IN_REG24 28
+#define IN_REG25 29
/*
- * k0 and k1 not saved
+ * k0/k1 unsaved
*/
-#define IN_REG28 25
-#define IN_REG29 26
-#define IN_REG30 27
-#define IN_REG31 28
+#define IN_REG28 30
+#define IN_REG29 31
+#define IN_REG30 32
+#define IN_REG31 33
/*
* Saved special registers
*/
-#define FR_LO ((IN_REG31) + 1)
-#define FR_HI ((IN_LO) + 1)
+#define IN_LO 34
+#define IN_HI 35
/*
- * Saved cp0 registers
+ * saved cp0 registers
*/
-#define IN_CP0_STATUS ((IN_LO) + 1)
-#define IN_CP0_EPC ((IN_CP0_STATUS) + 1)
-#define IN_CP0_ERROREPC ((IN_CP0_EPC) + 1)
+#define IN_CP0_STATUS 36
+#define IN_CP0_EPC 37
+#define IN_CP0_CAUSE 38
/*
- * Some goodies...
+ * Some goodies
*/
-#define IN_INTERRUPT ((IN_CP0_ERROREPC) + 1)
-#define IN_ORIG_REG2 ((IN_INTERRUPT) + 1)
+#define IN_INTERRUPT 39
+#define IN_ORIG_REG2 40
/*
- * this struct defines the way the registers are stored on the
- * stack during a system call/exception. As usual the registers
- * k0/k1 aren't being saved.
+ * This struct defines the way the registers are stored on the stack during a
+ * system call/exception. As usual the registers k0/k1 aren't being saved.
*/
-
struct pt_regs {
/*
+ * Pad bytes for argument save space on the stack
+ * 20/40 Bytes for 32/64 bit code
+ */
+ unsigned long pad0[5];
+
+ /*
* saved main processor registers
*/
long reg1, reg2, reg3, reg4, reg5, reg6, reg7;
long reg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15;
long reg16, reg17, reg18, reg19, reg20, reg21, reg22, reg23;
long reg24, reg25, reg28, reg29, reg30, reg31;
+
/*
* Saved special registers
*/
long lo;
long hi;
+
/*
* saved cp0 registers
*/
unsigned long cp0_status;
unsigned long cp0_epc;
- unsigned long cp0_errorepc;
+ unsigned long cp0_cause;
+
/*
* Some goodies...
*/
unsigned long interrupt;
long orig_reg2;
+ long pad1;
};
+#ifdef __KERNEL__
+
/*
- * This function computes the interrupt number from the stack frame
+ * Does the process account for user or for system time?
*/
-#define pt_regs2irq(p) ((int) ((struct pt_regs *)p)->interrupt)
+#if defined (__R4000__)
+
+#define user_mode(regs) ((regs)->cp0_status & 0x10)
+
+#else /* !defined (__R4000__) */
+
+#define user_mode(regs) (!((regs)->cp0_status & 0x8))
+
+#endif /* !defined (__R4000__) */
+
+extern void show_regs(struct pt_regs *);
+#endif
-#endif /* _ASM_MIPS_PTRACE_H */
+#endif /* __ASM_MIPS_PTRACE_H */