blob: 8d3c412fc65ff7b86037b6230d953f3feee63b19 [file] [log] [blame]
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -07001/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
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
10
David Howells83b9d3a2012-10-10 12:09:31 +010011#include <uapi/asm/ptrace.h>
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070012
13#ifndef __ASSEMBLY__
Haavard Skinnemoen13b54a52007-11-27 13:50:45 +010014
15#include <asm/ocd.h>
16
Christoph Hellwig1d839312010-03-10 15:22:51 -080017#define arch_has_single_step() (1)
18
Haavard Skinnemoen13b54a52007-11-27 13:50:45 +010019#define arch_ptrace_attach(child) ocd_enable(child)
20
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
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070025static __inline__ int valid_user_regs(struct pt_regs *regs)
26{
27 /*
28 * Some of the Java bits might be acceptable if/when we
29 * implement some support for that stuff...
30 */
31 if ((regs->sr & 0xffff0000) == 0)
32 return 1;
33
34 /*
35 * Force status register flags to be sane and report this
36 * illegal behaviour...
37 */
38 regs->sr &= 0x0000ffff;
39 return 0;
40}
41
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070042
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070043#endif /* ! __ASSEMBLY__ */
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070044#endif /* __ASM_AVR32_PTRACE_H */