aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/ptrace.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-sh/ptrace.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-sh/ptrace.h')
-rw-r--r--include/asm-sh/ptrace.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
new file mode 100644
index 000000000000..0f75e16a7415
--- /dev/null
+++ b/include/asm-sh/ptrace.h
@@ -0,0 +1,104 @@
1#ifndef __ASM_SH_PTRACE_H
2#define __ASM_SH_PTRACE_H
3
4#include <asm/ubc.h>
5
6/*
7 * Copyright (C) 1999, 2000 Niibe Yutaka
8 *
9 */
10
11/*
12 * GCC defines register number like this:
13 * -----------------------------
14 * 0 - 15 are integer registers
15 * 17 - 22 are control/special registers
16 * 24 - 39 fp registers
17 * 40 - 47 xd registers
18 * 48 - fpscr register
19 * -----------------------------
20 *
21 * We follows above, except:
22 * 16 --- program counter (PC)
23 * 22 --- syscall #
24 * 23 --- floating point communication register
25 */
26#define REG_REG0 0
27#define REG_REG15 15
28
29#define REG_PC 16
30
31#define REG_PR 17
32#define REG_SR 18
33#define REG_GBR 19
34#define REG_MACH 20
35#define REG_MACL 21
36
37#define REG_SYSCALL 22
38
39#define REG_FPREG0 23
40#define REG_FPREG15 38
41#define REG_XFREG0 39
42#define REG_XFREG15 54
43
44#define REG_FPSCR 55
45#define REG_FPUL 56
46
47/* options set using PTRACE_SETOPTIONS */
48#define PTRACE_O_TRACESYSGOOD 0x00000001
49
50/*
51 * This struct defines the way the registers are stored on the
52 * kernel stack during a system call or other kernel entry.
53 */
54struct pt_regs {
55 unsigned long regs[16];
56 unsigned long pc;
57 unsigned long pr;
58 unsigned long sr;
59 unsigned long gbr;
60 unsigned long mach;
61 unsigned long macl;
62 long tra;
63};
64
65/*
66 * This struct defines the way the DSP registers are stored on the
67 * kernel stack during a system call or other kernel entry.
68 */
69struct pt_dspregs {
70 unsigned long a1;
71 unsigned long a0g;
72 unsigned long a1g;
73 unsigned long m0;
74 unsigned long m1;
75 unsigned long a0;
76 unsigned long x0;
77 unsigned long x1;
78 unsigned long y0;
79 unsigned long y1;
80 unsigned long dsr;
81 unsigned long rs;
82 unsigned long re;
83 unsigned long mod;
84};
85
86#define PTRACE_GETDSPREGS 55
87#define PTRACE_SETDSPREGS 56
88
89#ifdef __KERNEL__
90#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
91#define instruction_pointer(regs) ((regs)->pc)
92extern void show_regs(struct pt_regs *);
93
94static inline unsigned long profile_pc(struct pt_regs *regs)
95{
96 unsigned long pc = instruction_pointer(regs);
97
98 if (pc >= 0xa0000000UL && pc < 0xc0000000UL)
99 pc -= 0x20000000;
100 return pc;
101}
102#endif
103
104#endif /* __ASM_SH_PTRACE_H */