aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/ptrace.h')
-rw-r--r--include/asm-sh/ptrace.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
index ed358a376e6e..8d6c92b3e770 100644
--- a/include/asm-sh/ptrace.h
+++ b/include/asm-sh/ptrace.h
@@ -5,7 +5,16 @@
5 * Copyright (C) 1999, 2000 Niibe Yutaka 5 * Copyright (C) 1999, 2000 Niibe Yutaka
6 * 6 *
7 */ 7 */
8 8#if defined(__SH5__) || defined(CONFIG_SUPERH64)
9struct pt_regs {
10 unsigned long long pc;
11 unsigned long long sr;
12 unsigned long long syscall_nr;
13 unsigned long long regs[63];
14 unsigned long long tregs[8];
15 unsigned long long pad[2];
16};
17#else
9/* 18/*
10 * GCC defines register number like this: 19 * GCC defines register number like this:
11 * ----------------------------- 20 * -----------------------------
@@ -28,7 +37,7 @@
28 37
29#define REG_PR 17 38#define REG_PR 17
30#define REG_SR 18 39#define REG_SR 18
31#define REG_GBR 19 40#define REG_GBR 19
32#define REG_MACH 20 41#define REG_MACH 20
33#define REG_MACL 21 42#define REG_MACL 21
34 43
@@ -42,9 +51,6 @@
42#define REG_FPSCR 55 51#define REG_FPSCR 55
43#define REG_FPUL 56 52#define REG_FPUL 56
44 53
45/* options set using PTRACE_SETOPTIONS */
46#define PTRACE_O_TRACESYSGOOD 0x00000001
47
48/* 54/*
49 * This struct defines the way the registers are stored on the 55 * This struct defines the way the registers are stored on the
50 * kernel stack during a system call or other kernel entry. 56 * kernel stack during a system call or other kernel entry.
@@ -83,10 +89,14 @@ struct pt_dspregs {
83 89
84#define PTRACE_GETDSPREGS 55 90#define PTRACE_GETDSPREGS 55
85#define PTRACE_SETDSPREGS 56 91#define PTRACE_SETDSPREGS 56
92#endif
86 93
87#ifdef __KERNEL__ 94#ifdef __KERNEL__
88#define user_mode(regs) (((regs)->sr & 0x40000000)==0) 95#include <asm/addrspace.h>
89#define instruction_pointer(regs) ((regs)->pc) 96
97#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
98#define instruction_pointer(regs) ((unsigned long)(regs)->pc)
99
90extern void show_regs(struct pt_regs *); 100extern void show_regs(struct pt_regs *);
91 101
92#ifdef CONFIG_SH_DSP 102#ifdef CONFIG_SH_DSP
@@ -103,10 +113,13 @@ static inline unsigned long profile_pc(struct pt_regs *regs)
103{ 113{
104 unsigned long pc = instruction_pointer(regs); 114 unsigned long pc = instruction_pointer(regs);
105 115
106 if (pc >= 0xa0000000UL && pc < 0xc0000000UL) 116#ifdef P2SEG
117 if (pc >= P2SEG && pc < P3SEG)
107 pc -= 0x20000000; 118 pc -= 0x20000000;
119#endif
120
108 return pc; 121 return pc;
109} 122}
110#endif 123#endif /* __KERNEL__ */
111 124
112#endif /* __ASM_SH_PTRACE_H */ 125#endif /* __ASM_SH_PTRACE_H */