/* Are the current registers suitable for user mode? * (used to maintain security in signal handlers)
*/ staticinlineint valid_user_regs(struct pt_regs *regs)
{ #ifndef CONFIG_CPU_V7M unsignedlong mode = regs->ARM_cpsr & MODE_MASK;
/* * Always clear the F (FIQ) and A (delayed abort) bits
*/
regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
if ((regs->ARM_cpsr & PSR_I_BIT) == 0) { if (mode == USR_MODE) return 1; if (elf_hwcap & HWCAP_26BIT && mode == USR26_MODE) return 1;
}
/* * Force CPSR to something logical...
*/
regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT; if (!(elf_hwcap & HWCAP_26BIT))
regs->ARM_cpsr |= USR_MODE;
/* * True if instr is a 32-bit thumb instruction. This works if instr * is the first or only half-word of a thumb instruction. It also works * when instr holds all 32-bits of a wide thumb instruction if stored * in the form (first_half<<16)|(second_half)
*/ #define is_wide_instruction(instr) ((unsigned)(instr) >= 0xe800)
/** * regs_get_register() - get register value from its offset * @regs: pt_regs from which register value is gotten * @offset: offset number of the register. * * regs_get_register returns the value of a register whose offset from @regs. * The @offset is the offset of the register in struct pt_regs. * If @offset is bigger than MAX_REG_OFFSET, this returns 0.
*/ staticinlineunsignedlong regs_get_register(struct pt_regs *regs, unsignedint offset)
{ if (unlikely(offset > MAX_REG_OFFSET)) return 0; return *(unsignedlong *)((unsignedlong)regs + offset);
}
/* Valid only for Kernel mode traps. */ staticinlineunsignedlong kernel_stack_pointer(struct pt_regs *regs)
{ return regs->ARM_sp;
}
/* * Update ITSTATE after normal execution of an IT block instruction. * * The 8 IT state bits are split into two parts in CPSR: * ITSTATE<1:0> are in CPSR<26:25> * ITSTATE<7:2> are in CPSR<15:10>
*/ staticinlineunsignedlong it_advance(unsignedlong cpsr)
{ if ((cpsr & 0x06000400) == 0) { /* ITSTATE<2:0> == 0 means end of IT block, so clear IT state */
cpsr &= ~PSR_IT_MASK;
} else { /* We need to shift left ITSTATE<4:0> */ constunsignedlong mask = 0x06001c00; /* Mask ITSTATE<4:0> */ unsignedlong it = cpsr & mask;
it <<= 1;
it |= it >> (27 - 10); /* Carry ITSTATE<2> to correct place */
it &= mask;
cpsr &= ~mask;
cpsr |= it;
} return cpsr;
}
int syscall_trace_enter(struct pt_regs *regs); void syscall_trace_exit(struct pt_regs *regs);
#endif/* __ASSEMBLY__ */ #endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.