Lines Matching refs:regs

128 #define compat_usr(x)	regs[(x)]
129 #define compat_fp regs[11]
130 #define compat_sp regs[13]
131 #define compat_lr regs[14]
132 #define compat_sp_hyp regs[15]
133 #define compat_lr_irq regs[16]
134 #define compat_sp_irq regs[17]
135 #define compat_lr_svc regs[18]
136 #define compat_sp_svc regs[19]
137 #define compat_lr_abt regs[20]
138 #define compat_sp_abt regs[21]
139 #define compat_lr_und regs[22]
140 #define compat_sp_und regs[23]
141 #define compat_r8_fiq regs[24]
142 #define compat_r9_fiq regs[25]
143 #define compat_r10_fiq regs[26]
144 #define compat_r11_fiq regs[27]
145 #define compat_r12_fiq regs[28]
146 #define compat_sp_fiq regs[29]
147 #define compat_lr_fiq regs[30]
182 u64 regs[31];
206 static inline bool in_syscall(struct pt_regs const *regs)
208 return regs->syscallno != NO_SYSCALL;
211 static inline void forget_syscall(struct pt_regs *regs)
213 regs->syscallno = NO_SYSCALL;
221 #define compat_thumb_mode(regs) \
222 (((regs)->pstate & PSR_AA32_T_BIT))
224 #define compat_thumb_mode(regs) (0)
227 #define user_mode(regs) \
228 (((regs)->pstate & PSR_MODE_MASK) == PSR_MODE_EL0t)
230 #define compat_user_mode(regs) \
231 (((regs)->pstate & (PSR_MODE32_BIT | PSR_MODE_MASK)) == \
234 #define processor_mode(regs) \
235 ((regs)->pstate & PSR_MODE_MASK)
237 #define irqs_priority_unmasked(regs) \
239 (regs)->pmr_save == GIC_PRIO_IRQON : \
242 #define interrupts_enabled(regs) \
243 (!((regs)->pstate & PSR_I_BIT) && irqs_priority_unmasked(regs))
245 #define fast_interrupts_enabled(regs) \
246 (!((regs)->pstate & PSR_F_BIT))
248 static inline unsigned long user_stack_pointer(struct pt_regs *regs)
250 if (compat_user_mode(regs))
251 return regs->compat_sp;
252 return regs->sp;
256 extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
261 * @regs: pt_regs from which register value is gotten
264 * regs_get_register returns the value of a register whose offset from @regs.
268 static inline u64 regs_get_register(struct pt_regs *regs, unsigned int offset)
277 val = regs->regs[offset];
280 val = regs->sp;
283 val = regs->pc;
286 val = regs->pstate;
299 static inline unsigned long pt_regs_read_reg(const struct pt_regs *regs, int r)
301 return (r == 31) ? 0 : regs->regs[r];
308 static inline void pt_regs_write_reg(struct pt_regs *regs, int r,
312 regs->regs[r] = val;
316 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
318 return regs->sp;
321 static inline unsigned long regs_return_value(struct pt_regs *regs)
323 unsigned long val = regs->regs[0];
330 if (compat_user_mode(regs))
336 static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc)
338 regs->regs[0] = rc;
343 * @regs: pt_regs of that context
354 static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs,
359 return pt_regs_read_reg(regs, n);
365 int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task);
367 static inline unsigned long instruction_pointer(struct pt_regs *regs)
369 return regs->pc;
371 static inline void instruction_pointer_set(struct pt_regs *regs,
374 regs->pc = val;
377 static inline unsigned long frame_pointer(struct pt_regs *regs)
379 return regs->regs[29];
382 #define procedure_link_pointer(regs) ((regs)->regs[30])
384 static inline void procedure_link_pointer_set(struct pt_regs *regs,
387 procedure_link_pointer(regs) = val;
390 extern unsigned long profile_pc(struct pt_regs *regs);