diff options
author | Michal Simek <monstr@monstr.eu> | 2009-12-28 08:25:15 -0500 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-01-18 10:35:39 -0500 |
commit | 90974cb4cc283b36fe00b594446aba9177ac3287 (patch) | |
tree | 9d8eb90b376041f0c73099c975beca6000aef04a /arch/microblaze/include/asm/ptrace.h | |
parent | 4a3bb9a90083c064031f15c2ac38bcf68c3487e6 (diff) |
microblaze: Add PT_ macros for special purpose regs
PT_ macros are used by gdb and strace uses them too.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/include/asm/ptrace.h')
-rw-r--r-- | arch/microblaze/include/asm/ptrace.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h index a917dc517736..d74dbfb92c04 100644 --- a/arch/microblaze/include/asm/ptrace.h +++ b/arch/microblaze/include/asm/ptrace.h | |||
@@ -54,6 +54,7 @@ struct pt_regs { | |||
54 | int pt_mode; | 54 | int pt_mode; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #ifdef __KERNEL__ | ||
57 | #define kernel_mode(regs) ((regs)->pt_mode) | 58 | #define kernel_mode(regs) ((regs)->pt_mode) |
58 | #define user_mode(regs) (!kernel_mode(regs)) | 59 | #define user_mode(regs) (!kernel_mode(regs)) |
59 | 60 | ||
@@ -62,6 +63,19 @@ struct pt_regs { | |||
62 | 63 | ||
63 | void show_regs(struct pt_regs *); | 64 | void show_regs(struct pt_regs *); |
64 | 65 | ||
66 | #else /* __KERNEL__ */ | ||
67 | |||
68 | /* pt_regs offsets used by gdbserver etc in ptrace syscalls */ | ||
69 | #define PT_GPR(n) ((n) * sizeof(microblaze_reg_t)) | ||
70 | #define PT_PC (32 * sizeof(microblaze_reg_t)) | ||
71 | #define PT_MSR (33 * sizeof(microblaze_reg_t)) | ||
72 | #define PT_EAR (34 * sizeof(microblaze_reg_t)) | ||
73 | #define PT_ESR (35 * sizeof(microblaze_reg_t)) | ||
74 | #define PT_FSR (36 * sizeof(microblaze_reg_t)) | ||
75 | #define PT_KERNEL_MODE (37 * sizeof(microblaze_reg_t)) | ||
76 | |||
77 | #endif /* __KERNEL */ | ||
78 | |||
65 | #endif /* __ASSEMBLY__ */ | 79 | #endif /* __ASSEMBLY__ */ |
66 | 80 | ||
67 | #endif /* _ASM_MICROBLAZE_PTRACE_H */ | 81 | #endif /* _ASM_MICROBLAZE_PTRACE_H */ |