Lines Matching refs:regs

35 	unsigned long regs[32];
54 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
56 return regs->regs[29];
59 static inline void instruction_pointer_set(struct pt_regs *regs,
62 regs->cp0_epc = val;
63 regs->cp0_cause &= ~CAUSEF_BD;
72 * @regs: pt_regs from which register value is gotten.
76 * offset of the register in struct pt_regs address which specified by @regs.
79 static inline unsigned long regs_get_register(struct pt_regs *regs,
85 return *(unsigned long *)((unsigned long)regs + offset);
90 * @regs: pt_regs which contains kernel stack pointer.
96 static inline int regs_within_kernel_stack(struct pt_regs *regs,
100 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
105 * @regs: pt_regs which contains kernel stack pointer.
109 * is specified by @regs. If the @n th entry is NOT in the kernel stack,
112 static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
115 unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs);
118 if (regs_within_kernel_stack(regs, (unsigned long)addr))
142 #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
144 static inline int is_syscall_success(struct pt_regs *regs)
146 return !regs->regs[7];
149 static inline long regs_return_value(struct pt_regs *regs)
151 if (is_syscall_success(regs) || !user_mode(regs))
152 return regs->regs[2];
154 return -regs->regs[2];
157 #define instruction_pointer(regs) ((regs)->cp0_epc)
158 extern unsigned long exception_ip(struct pt_regs *regs);
159 #define exception_ip(regs) exception_ip(regs)
160 #define profile_pc(regs) instruction_pointer(regs)
162 extern asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall);
163 extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
167 static inline void die_if_kernel(const char *str, struct pt_regs *regs)
169 if (unlikely(!user_mode(regs)))
170 die(str, regs);
181 static inline unsigned long user_stack_pointer(struct pt_regs *regs)
183 return regs->regs[29];
186 static inline void user_stack_pointer_set(struct pt_regs *regs,
189 regs->regs[29] = val;