This source file includes following definitions.
- valid_user_regs
1
2
3
4
5
6
7
8
9 #ifndef __UNICORE_PTRACE_H__
10 #define __UNICORE_PTRACE_H__
11
12 #include <uapi/asm/ptrace.h>
13
14 #ifndef __ASSEMBLY__
15
16 #define user_mode(regs) \
17 (processor_mode(regs) == USER_MODE)
18
19 #define processor_mode(regs) \
20 ((regs)->UCreg_asr & MODE_MASK)
21
22 #define interrupts_enabled(regs) \
23 (!((regs)->UCreg_asr & PSR_I_BIT))
24
25 #define fast_interrupts_enabled(regs) \
26 (!((regs)->UCreg_asr & PSR_R_BIT))
27
28
29
30
31 static inline int valid_user_regs(struct pt_regs *regs)
32 {
33 unsigned long mode = regs->UCreg_asr & MODE_MASK;
34
35
36
37
38 regs->UCreg_asr &= ~(PSR_R_BIT);
39
40 if ((regs->UCreg_asr & PSR_I_BIT) == 0) {
41 if (mode == USER_MODE)
42 return 1;
43 }
44
45
46
47
48 regs->UCreg_asr &= PSR_f | USER_MODE;
49
50 return 0;
51 }
52
53 #define instruction_pointer(regs) ((regs)->UCreg_pc)
54 #define user_stack_pointer(regs) ((regs)->UCreg_sp)
55 #define profile_pc(regs) instruction_pointer(regs)
56
57 #endif
58 #endif