Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc: We need to implement arch_ptrace_stop().
  • Loading branch information
Linus Torvalds committed Dec 18, 2008
2 parents 52af894 + 878a553 commit 3653b9a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/sparc/include/asm/ptrace_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct sparc_stackf {

#ifdef __KERNEL__

#include <asm/system.h>

static inline bool pt_regs_is_syscall(struct pt_regs *regs)
{
return (regs->psr & PSR_SYSCALL);
Expand All @@ -72,6 +74,14 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
return (regs->psr &= ~PSR_SYSCALL);
}

#define arch_ptrace_stop_needed(exit_code, info) \
({ flush_user_windows(); \
current_thread_info()->w_saved != 0; \
})

#define arch_ptrace_stop(exit_code, info) \
synchronize_user_stack()

#define user_mode(regs) (!((regs)->psr & PSR_PS))
#define instruction_pointer(regs) ((regs)->pc)
#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
Expand Down
9 changes: 9 additions & 0 deletions arch/sparc/include/asm/ptrace_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct sparc_trapf {
#ifdef __KERNEL__

#include <linux/threads.h>
#include <asm/system.h>

static inline int pt_regs_trap_type(struct pt_regs *regs)
{
Expand All @@ -130,6 +131,14 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
return (regs->tstate &= ~TSTATE_SYSCALL);
}

#define arch_ptrace_stop_needed(exit_code, info) \
({ flush_user_windows(); \
get_thread_wsaved() != 0; \
})

#define arch_ptrace_stop(exit_code, info) \
synchronize_user_stack()

struct global_reg_snapshot {
unsigned long tstate;
unsigned long tpc;
Expand Down

0 comments on commit 3653b9a

Please sign in to comment.