Change-Id: I202c34f31152126eedd8f53303444bbd98816c45
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*/
static inline unsigned long swap_get_instr_ptr(struct pt_regs *regs)
{
- return regs->ARM_pc;
+ return regs->ARM_pc | !!thumb_mode(regs);
}
/**
*/
static inline void swap_set_instr_ptr(struct pt_regs *regs, unsigned long val)
{
- regs->ARM_pc = val;
+ if (val & 1) {
+ regs->ARM_pc = val & ~1;
+ regs->ARM_cpsr |= PSR_T_BIT;
+ } else {
+ regs->ARM_pc = val;
+ regs->ARM_cpsr &= ~PSR_T_BIT;
+ }
}
/**
swap_set_instr_ptr(regs, vaddr);
#ifdef CONFIG_ARM
- if (thumb_mode(regs)) {
- regs->ARM_cpsr &= ~PSR_T_BIT;
+ if (thumb_mode(regs))
ri->preload_thumb = 1;
- }
#endif /* CONFIG_ARM */
}