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.
8 #ifndef __ASM_AVR32_PTRACE_H
9 #define __ASM_AVR32_PTRACE_H
11 #define PTRACE_GETREGS 12
12 #define PTRACE_SETREGS 13
15 * Status Register bits
17 #define SR_H 0x20000000
18 #define SR_J 0x10000000
19 #define SR_DM 0x08000000
20 #define SR_D 0x04000000
21 #define MODE_NMI 0x01c00000
22 #define MODE_EXCEPTION 0x01800000
23 #define MODE_INT3 0x01400000
24 #define MODE_INT2 0x01000000
25 #define MODE_INT1 0x00c00000
26 #define MODE_INT0 0x00800000
27 #define MODE_SUPERVISOR 0x00400000
28 #define MODE_USER 0x00000000
29 #define MODE_MASK 0x01c00000
30 #define SR_EM 0x00200000
31 #define SR_I3M 0x00100000
32 #define SR_I2M 0x00080000
33 #define SR_I1M 0x00040000
34 #define SR_I0M 0x00020000
35 #define SR_GM 0x00010000
49 /* The user-visible part */
50 #define SR_L 0x00000020
51 #define SR_Q 0x00000010
52 #define SR_V 0x00000008
53 #define SR_N 0x00000004
54 #define SR_Z 0x00000002
55 #define SR_C 0x00000001
65 * The order is defined by the stmts instruction. r0 is stored first,
66 * so it gets the highest address.
68 * Registers 0-12 are general-purpose registers (r12 is normally used for
69 * the function return value).
70 * Register 13 is the stack pointer
71 * Register 14 is the link register
72 * Register 15 is the program counter (retrieved from the RAR sysreg)
74 #define FRAME_SIZE_FULL 72
75 #define REG_R12_ORIG 68
92 #define FRAME_SIZE_MIN 8
98 /* These are always saved */
102 /* These are sometimes saved */
119 /* Only saved on system call */
120 unsigned long r12_orig
;
127 #define arch_ptrace_attach(child) ocd_enable(child)
129 #define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
130 #define instruction_pointer(regs) ((regs)->pc)
131 #define profile_pc(regs) instruction_pointer(regs)
133 extern void show_regs (struct pt_regs
*);
135 static __inline__
int valid_user_regs(struct pt_regs
*regs
)
138 * Some of the Java bits might be acceptable if/when we
139 * implement some support for that stuff...
141 if ((regs
->sr
& 0xffff0000) == 0)
145 * Force status register flags to be sane and report this
146 * illegal behaviour...
148 regs
->sr
&= 0x0000ffff;
153 #endif /* __KERNEL__ */
155 #endif /* ! __ASSEMBLY__ */
157 #endif /* __ASM_AVR32_PTRACE_H */