diff options
Diffstat (limited to 'arch/score/include/asm/ptrace.h')
-rw-r--r-- | arch/score/include/asm/ptrace.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/arch/score/include/asm/ptrace.h b/arch/score/include/asm/ptrace.h new file mode 100644 index 000000000000..1a4900ac49f3 --- /dev/null +++ b/arch/score/include/asm/ptrace.h | |||
@@ -0,0 +1,87 @@ | |||
1 | #ifndef _ASM_SCORE_PTRACE_H | ||
2 | #define _ASM_SCORE_PTRACE_H | ||
3 | |||
4 | #define PC 32 | ||
5 | #define CONDITION 33 | ||
6 | #define ECR 34 | ||
7 | #define EMA 35 | ||
8 | #define CEH 36 | ||
9 | #define CEL 37 | ||
10 | #define COUNTER 38 | ||
11 | #define LDCR 39 | ||
12 | #define STCR 40 | ||
13 | #define PSR 41 | ||
14 | |||
15 | #define SINGLESTEP16_INSN 0x7006 | ||
16 | #define SINGLESTEP32_INSN 0x840C8000 | ||
17 | #define BREAKPOINT16_INSN 0x7002 /* work on SPG300 */ | ||
18 | #define BREAKPOINT32_INSN 0x84048000 /* work on SPG300 */ | ||
19 | |||
20 | /* Define instruction mask */ | ||
21 | #define INSN32_MASK 0x80008000 | ||
22 | |||
23 | #define J32 0x88008000 /* 1_00010_0000000000_1_000000000000000 */ | ||
24 | #define J32M 0xFC008000 /* 1_11111_0000000000_1_000000000000000 */ | ||
25 | |||
26 | #define B32 0x90008000 /* 1_00100_0000000000_1_000000000000000 */ | ||
27 | #define B32M 0xFC008000 | ||
28 | #define BL32 0x90008001 /* 1_00100_0000000000_1_000000000000001 */ | ||
29 | #define BL32M B32 | ||
30 | #define BR32 0x80008008 /* 1_00000_0000000000_1_00000000_000100_0 */ | ||
31 | #define BR32M 0xFFE0807E | ||
32 | #define BRL32 0x80008009 /* 1_00000_0000000000_1_00000000_000100_1 */ | ||
33 | #define BRL32M BR32M | ||
34 | |||
35 | #define B32_SET (J32 | B32 | BL32 | BR32 | BRL32) | ||
36 | |||
37 | #define J16 0x3000 /* 0_011_....... */ | ||
38 | #define J16M 0xF000 | ||
39 | #define B16 0x4000 /* 0_100_....... */ | ||
40 | #define B16M 0xF000 | ||
41 | #define BR16 0x0004 /* 0_000.......0100 */ | ||
42 | #define BR16M 0xF00F | ||
43 | #define B16_SET (J16 | B16 | BR16) | ||
44 | |||
45 | |||
46 | /* | ||
47 | * This struct defines the way the registers are stored on the stack during a | ||
48 | * system call/exception. As usual the registers k0/k1 aren't being saved. | ||
49 | */ | ||
50 | struct pt_regs { | ||
51 | unsigned long pad0[6]; | ||
52 | unsigned long orig_r4; | ||
53 | unsigned long orig_r7; | ||
54 | unsigned long regs[32]; | ||
55 | |||
56 | unsigned long cel; | ||
57 | unsigned long ceh; | ||
58 | |||
59 | unsigned long sr0; /* cnt */ | ||
60 | unsigned long sr1; /* lcr */ | ||
61 | unsigned long sr2; /* scr */ | ||
62 | |||
63 | unsigned long cp0_epc; | ||
64 | unsigned long cp0_ema; | ||
65 | unsigned long cp0_psr; | ||
66 | unsigned long cp0_ecr; | ||
67 | unsigned long cp0_condition; | ||
68 | |||
69 | long is_syscall; | ||
70 | }; | ||
71 | |||
72 | #ifdef __KERNEL__ | ||
73 | |||
74 | /* | ||
75 | * Does the process account for user or for system time? | ||
76 | */ | ||
77 | #define user_mode(regs) ((regs->cp0_psr & 8) == 8) | ||
78 | |||
79 | #define instruction_pointer(regs) (0) | ||
80 | #define profile_pc(regs) instruction_pointer(regs) | ||
81 | |||
82 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); | ||
83 | extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); | ||
84 | extern void clear_single_step(struct task_struct *); | ||
85 | #endif | ||
86 | |||
87 | #endif /* _ASM_SCORE_PTRACE_H */ | ||