MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / asm-arm26 / ptrace.h
blob6a46b5ae1156087ce49eae960ab5455a6279de15
1 #ifndef __ASM_ARM_PTRACE_H
2 #define __ASM_ARM_PTRACE_H
4 #define PTRACE_GETREGS 12
5 #define PTRACE_SETREGS 13
6 #define PTRACE_GETFPREGS 14
7 #define PTRACE_SETFPREGS 15
8 #define PTRACE_OLDSETOPTIONS 21
10 /* options set using PTRACE_SETOPTIONS */
11 #define PTRACE_O_TRACESYSGOOD 0x00000001
13 #define MODE_USR26 0x00000000
14 #define MODE_FIQ26 0x00000001
15 #define MODE_IRQ26 0x00000002
16 #define MODE_SVC26 0x00000003
17 #define MODE_MASK 0x00000003
19 #define PSR_F_BIT 0x04000000
20 #define PSR_I_BIT 0x08000000
21 #define PSR_V_BIT 0x10000000
22 #define PSR_C_BIT 0x20000000
23 #define PSR_Z_BIT 0x40000000
24 #define PSR_N_BIT 0x80000000
26 #define PCMASK 0xfc000003
29 #ifndef __ASSEMBLY__
31 #define pc_pointer(v) ((v) & ~PCMASK) /* convert v to pc type address */
32 #define instruction_pointer(regs) (pc_pointer((regs)->ARM_pc)) /* get pc */
33 #define profile_pc(regs) instruction_pointer(regs)
35 /* this struct defines the way the registers are stored on the
36 stack during a system call. */
38 struct pt_regs {
39 long uregs[17];
42 #define ARM_pc uregs[15]
43 #define ARM_lr uregs[14]
44 #define ARM_sp uregs[13]
45 #define ARM_ip uregs[12]
46 #define ARM_fp uregs[11]
47 #define ARM_r10 uregs[10]
48 #define ARM_r9 uregs[9]
49 #define ARM_r8 uregs[8]
50 #define ARM_r7 uregs[7]
51 #define ARM_r6 uregs[6]
52 #define ARM_r5 uregs[5]
53 #define ARM_r4 uregs[4]
54 #define ARM_r3 uregs[3]
55 #define ARM_r2 uregs[2]
56 #define ARM_r1 uregs[1]
57 #define ARM_r0 uregs[0]
58 #define ARM_ORIG_r0 uregs[16]
60 #ifdef __KERNEL__
62 #define processor_mode(regs) \
63 ((regs)->ARM_pc & MODE_MASK)
65 #define user_mode(regs) \
66 (processor_mode(regs) == MODE_USR26)
68 #define interrupts_enabled(regs) \
69 (!((regs)->ARM_pc & PSR_I_BIT))
71 #define fast_interrupts_enabled(regs) \
72 (!((regs)->ARM_pc & PSR_F_BIT))
74 #define condition_codes(regs) \
75 ((regs)->ARM_pc & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT))
77 /* Are the current registers suitable for user mode?
78 * (used to maintain security in signal handlers)
80 static inline int valid_user_regs(struct pt_regs *regs)
82 if (user_mode(regs) &&
83 (regs->ARM_pc & (PSR_F_BIT | PSR_I_BIT)) == 0)
84 return 1;
87 * force it to be something sensible
89 regs->ARM_pc &= ~(MODE_MASK | PSR_F_BIT | PSR_I_BIT);
91 return 0;
94 extern void show_regs(struct pt_regs *);
96 #define predicate(x) (x & 0xf0000000)
97 #define PREDICATE_ALWAYS 0xe0000000
99 #endif /* __KERNEL__ */
101 #endif /* __ASSEMBLY__ */
103 #endif