Lines Matching refs:regs

123 #define compat_usr(x)	regs[(x)]
124 #define compat_fp regs[11]
125 #define compat_sp regs[13]
126 #define compat_lr regs[14]
127 #define compat_sp_hyp regs[15]
128 #define compat_lr_irq regs[16]
129 #define compat_sp_irq regs[17]
130 #define compat_lr_svc regs[18]
131 #define compat_sp_svc regs[19]
132 #define compat_lr_abt regs[20]
133 #define compat_sp_abt regs[21]
134 #define compat_lr_und regs[22]
135 #define compat_sp_und regs[23]
136 #define compat_r8_fiq regs[24]
137 #define compat_r9_fiq regs[25]
138 #define compat_r10_fiq regs[26]
139 #define compat_r11_fiq regs[27]
140 #define compat_r12_fiq regs[28]
141 #define compat_sp_fiq regs[29]
142 #define compat_lr_fiq regs[30]
177 u64 regs[31];
202 static inline bool in_syscall(struct pt_regs const *regs)
204 return regs->syscallno != NO_SYSCALL;
207 static inline void forget_syscall(struct pt_regs *regs)
209 regs->syscallno = NO_SYSCALL;
217 #define compat_thumb_mode(regs) \
218 (((regs)->pstate & PSR_AA32_T_BIT))
220 #define compat_thumb_mode(regs) (0)
223 #define user_mode(regs) \
224 (((regs)->pstate & PSR_MODE_MASK) == PSR_MODE_EL0t)
226 #define compat_user_mode(regs) \
227 (((regs)->pstate & (PSR_MODE32_BIT | PSR_MODE_MASK)) == \
230 #define processor_mode(regs) \
231 ((regs)->pstate & PSR_MODE_MASK)
233 #define irqs_priority_unmasked(regs) \
235 (regs)->pmr_save == GIC_PRIO_IRQON : \
238 #define interrupts_enabled(regs) \
239 (!((regs)->pstate & PSR_I_BIT) && irqs_priority_unmasked(regs))
241 #define fast_interrupts_enabled(regs) \
242 (!((regs)->pstate & PSR_F_BIT))
244 static inline unsigned long user_stack_pointer(struct pt_regs *regs)
246 if (compat_user_mode(regs))
247 return regs->compat_sp;
248 return regs->sp;
252 extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
257 * @regs: pt_regs from which register value is gotten
260 * regs_get_register returns the value of a register whose offset from @regs.
264 static inline u64 regs_get_register(struct pt_regs *regs, unsigned int offset)
273 val = regs->regs[offset];
276 val = regs->sp;
279 val = regs->pc;
282 val = regs->pstate;
295 static inline unsigned long pt_regs_read_reg(const struct pt_regs *regs, int r)
297 return (r == 31) ? 0 : regs->regs[r];
304 static inline void pt_regs_write_reg(struct pt_regs *regs, int r,
308 regs->regs[r] = val;
312 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
314 return regs->sp;
317 static inline unsigned long regs_return_value(struct pt_regs *regs)
319 unsigned long val = regs->regs[0];
326 if (compat_user_mode(regs))
332 static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc)
334 regs->regs[0] = rc;
339 * @regs: pt_regs of that context
350 static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs,
355 return pt_regs_read_reg(regs, n);
361 int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task);
363 static inline unsigned long instruction_pointer(struct pt_regs *regs)
365 return regs->pc;
367 static inline void instruction_pointer_set(struct pt_regs *regs,
370 regs->pc = val;
373 static inline unsigned long frame_pointer(struct pt_regs *regs)
375 return regs->regs[29];
378 #define procedure_link_pointer(regs) ((regs)->regs[30])
380 static inline void procedure_link_pointer_set(struct pt_regs *regs,
383 procedure_link_pointer(regs) = val;
386 extern unsigned long profile_pc(struct pt_regs *regs);