Skip to content

Commit

Permalink
microblaze: Add PT_ macros for special purpose regs
Browse files Browse the repository at this point in the history
PT_ macros are used by gdb and strace uses them too.

Signed-off-by: Michal Simek <[email protected]>
  • Loading branch information
michalsimek committed Jan 18, 2010

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 4a3bb9a commit 90974cb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arch/microblaze/include/asm/ptrace.h
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ struct pt_regs {
int pt_mode;
};

#ifdef __KERNEL__
#define kernel_mode(regs) ((regs)->pt_mode)
#define user_mode(regs) (!kernel_mode(regs))

@@ -62,6 +63,19 @@ struct pt_regs {

void show_regs(struct pt_regs *);

#else /* __KERNEL__ */

/* pt_regs offsets used by gdbserver etc in ptrace syscalls */
#define PT_GPR(n) ((n) * sizeof(microblaze_reg_t))
#define PT_PC (32 * sizeof(microblaze_reg_t))
#define PT_MSR (33 * sizeof(microblaze_reg_t))
#define PT_EAR (34 * sizeof(microblaze_reg_t))
#define PT_ESR (35 * sizeof(microblaze_reg_t))
#define PT_FSR (36 * sizeof(microblaze_reg_t))
#define PT_KERNEL_MODE (37 * sizeof(microblaze_reg_t))

#endif /* __KERNEL */

#endif /* __ASSEMBLY__ */

#endif /* _ASM_MICROBLAZE_PTRACE_H */

0 comments on commit 90974cb

Please sign in to comment.