Lines Matching refs:regs

20 	unsigned long regs[32];
36 static inline int regs_irqs_disabled(struct pt_regs *regs)
38 return arch_irqs_disabled_flags(regs->csr_prmd);
41 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
43 return regs->regs[3];
51 static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val)
53 regs->csr_era = val;
62 * @regs: pt_regs from which register value is gotten.
66 * offset of the register in struct pt_regs address which specified by @regs.
69 static inline unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset)
74 return *(unsigned long *)((unsigned long)regs + offset);
79 * @regs: pt_regs which contains kernel stack pointer.
85 static inline int regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr)
88 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
93 * @regs: pt_regs which contains kernel stack pointer.
97 * is specified by @regs. If the @n th entry is NOT in the kernel stack,
100 static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
102 unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs);
105 if (regs_within_kernel_stack(regs, (unsigned long)addr))
115 * @regs: pt_regs of that context
121 * This is expected to be called from kprobes or ftrace with regs
124 static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs,
129 offsetof(struct pt_regs, regs[4]),
130 offsetof(struct pt_regs, regs[5]),
131 offsetof(struct pt_regs, regs[6]),
132 offsetof(struct pt_regs, regs[7]),
133 offsetof(struct pt_regs, regs[8]),
134 offsetof(struct pt_regs, regs[9]),
135 offsetof(struct pt_regs, regs[10]),
136 offsetof(struct pt_regs, regs[11]),
140 return regs_get_register(regs, args[n]);
143 return regs_get_kernel_stack_nth(regs, n);
150 #define user_mode(regs) (((regs)->csr_prmd & PLV_MASK) == PLV_USER)
152 static inline long regs_return_value(struct pt_regs *regs)
154 return regs->regs[4];
157 static inline void regs_set_return_value(struct pt_regs *regs, unsigned long val)
159 regs->regs[4] = val;
162 #define instruction_pointer(regs) ((regs)->csr_era)
163 #define profile_pc(regs) instruction_pointer(regs)
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)
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[3];
186 static inline void user_stack_pointer_set(struct pt_regs *regs,
189 regs->regs[3] = val;