Lines Matching refs:regs
20 unsigned long regs[32]; member
36 static inline int regs_irqs_disabled(struct pt_regs *regs) in regs_irqs_disabled() argument
38 return arch_irqs_disabled_flags(regs->csr_prmd); in regs_irqs_disabled()
41 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) in kernel_stack_pointer() argument
43 return regs->regs[3]; in kernel_stack_pointer()
51 static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val) in instruction_pointer_set() argument
53 regs->csr_era = val; in instruction_pointer_set()
69 static inline unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset) in regs_get_register() argument
74 return *(unsigned long *)((unsigned long)regs + offset); in regs_get_register()
85 static inline int regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr) in regs_within_kernel_stack() argument
88 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1))); in regs_within_kernel_stack()
100 static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n) in regs_get_kernel_stack_nth() argument
102 unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs); in regs_get_kernel_stack_nth()
105 if (regs_within_kernel_stack(regs, (unsigned long)addr)) in regs_get_kernel_stack_nth()
124 static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs, in regs_get_kernel_argument() argument
129 offsetof(struct pt_regs, regs[4]), in regs_get_kernel_argument()
130 offsetof(struct pt_regs, regs[5]), in regs_get_kernel_argument()
131 offsetof(struct pt_regs, regs[6]), in regs_get_kernel_argument()
132 offsetof(struct pt_regs, regs[7]), in regs_get_kernel_argument()
133 offsetof(struct pt_regs, regs[8]), in regs_get_kernel_argument()
134 offsetof(struct pt_regs, regs[9]), in regs_get_kernel_argument()
135 offsetof(struct pt_regs, regs[10]), in regs_get_kernel_argument()
136 offsetof(struct pt_regs, regs[11]), in regs_get_kernel_argument()
140 return regs_get_register(regs, args[n]); in regs_get_kernel_argument()
143 return regs_get_kernel_stack_nth(regs, n); in regs_get_kernel_argument()
150 #define user_mode(regs) (((regs)->csr_prmd & PLV_MASK) == PLV_USER) argument
152 static inline long regs_return_value(struct pt_regs *regs) in regs_return_value() argument
154 return regs->regs[4]; in regs_return_value()
157 static inline void regs_set_return_value(struct pt_regs *regs, unsigned long val) in regs_set_return_value() argument
159 regs->regs[4] = val; in regs_set_return_value()
162 #define instruction_pointer(regs) ((regs)->csr_era) argument
163 #define profile_pc(regs) instruction_pointer(regs) argument
165 extern void die(const char *str, struct pt_regs *regs);
167 static inline void die_if_kernel(const char *str, struct pt_regs *regs) in die_if_kernel() argument
169 if (unlikely(!user_mode(regs))) in die_if_kernel()
170 die(str, regs); in die_if_kernel()
181 static inline unsigned long user_stack_pointer(struct pt_regs *regs) in user_stack_pointer() argument
183 return regs->regs[3]; in user_stack_pointer()
186 static inline void user_stack_pointer_set(struct pt_regs *regs, in user_stack_pointer_set() argument
189 regs->regs[3] = val; in user_stack_pointer_set()