Linux 4.1.18
[linux/fpc-iii.git] / arch / avr32 / include / asm / ptrace.h
blob630e4f9bf5f084be7a2942126d3e71666482f383
1 /*
2 * Copyright (C) 2004-2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8 #ifndef __ASM_AVR32_PTRACE_H
9 #define __ASM_AVR32_PTRACE_H
11 #include <uapi/asm/ptrace.h>
13 #ifndef __ASSEMBLY__
15 #include <asm/ocd.h>
17 #define arch_has_single_step() (1)
19 #define arch_ptrace_attach(child) ocd_enable(child)
21 #define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
22 #define instruction_pointer(regs) ((regs)->pc)
23 #define profile_pc(regs) instruction_pointer(regs)
24 #define user_stack_pointer(regs) ((regs)->sp)
26 static __inline__ int valid_user_regs(struct pt_regs *regs)
29 * Some of the Java bits might be acceptable if/when we
30 * implement some support for that stuff...
32 if ((regs->sr & 0xffff0000) == 0)
33 return 1;
36 * Force status register flags to be sane and report this
37 * illegal behaviour...
39 regs->sr &= 0x0000ffff;
40 return 0;
44 #endif /* ! __ASSEMBLY__ */
45 #endif /* __ASM_AVR32_PTRACE_H */