1 #ifndef __ASM_SH_PTRACE_H
2 #define __ASM_SH_PTRACE_H
3 
4 #include <asm/processor.h>
5 #include <asm/ubc.h>
6 
7 /*
8  * Copyright (C) 1999, 2000  Niibe Yutaka
9  *
10  */
11 
12 /*
13  * GCC defines register number like this:
14  * -----------------------------
15  *	 0 - 15 are integer registers
16  *	17 - 22 are control/special registers
17  *	24 - 39 fp registers
18  *	40 - 47 xd registers
19  *	48 -    fpscr register
20  * -----------------------------
21  *
22  * We follows above, except:
23  *	16 --- program counter (PC)
24  *	22 --- expevt # (Exception Event Number)
25  *	23 --- floating point communication register
26  */
27 #define REG_REG0	 0
28 #define REG_REG15	15
29 
30 #define REG_PC		16
31 
32 #define REG_PR		17
33 #define REG_SR		18
34 #define REG_GBR      	19
35 #define REG_MACH	20
36 #define REG_MACL	21
37 
38 #define REG_EXPEVT	22
39 
40 #define REG_FPREG0	23
41 #define REG_FPREG15	38
42 #define REG_XFREG0	39
43 #define REG_XFREG15	54
44 
45 #define REG_FPSCR	55
46 #define REG_FPUL	56
47 
48 #define PTRACE_SETOPTIONS         21
49 
50 /* options set using PTRACE_SETOPTIONS */
51 #define PTRACE_O_TRACESYSGOOD     0x00000001
52 
53 /*
54  * This struct defines the way the registers are stored on the
55  * kernel stack during a system call or other kernel entry.
56  */
57 struct pt_regs {
58 	unsigned long regs[16];
59 	unsigned long pc;
60 	unsigned long pr;
61 	unsigned long sr;
62 	unsigned long gbr;
63 	unsigned long mach;
64 	unsigned long macl;
65 	unsigned long expevt;
66 };
67 
68 /*
69  * This struct defines the way the DSP registers are stored on the
70  * kernel stack during a system call or other kernel entry.
71  */
72 struct pt_dspregs {
73 	unsigned long	a1;
74 	unsigned long	a0g;
75 	unsigned long	a1g;
76 	unsigned long	m0;
77 	unsigned long	m1;
78 	unsigned long	a0;
79 	unsigned long	x0;
80 	unsigned long	x1;
81 	unsigned long	y0;
82 	unsigned long	y1;
83 	unsigned long	dsr;
84 	unsigned long	rs;
85 	unsigned long	re;
86 	unsigned long	mod;
87 };
88 
89 #define	PTRACE_GETDSPREGS	55
90 #define	PTRACE_SETDSPREGS	56
91 
92 #ifdef __KERNEL__
93 #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
94 #define instruction_pointer(regs) ((regs)->pc)
95 extern void show_regs(struct pt_regs *);
96 #endif
97 
98 #endif /* __ASM_SH_PTRACE_H */
99