staticenum probes_insn __kprobes t32_check_stack(probes_opcode_t insn, struct arch_probes_insn *asi, conststruct decode_header *h)
{ /* * PROBES_T32_LDMSTM, PROBES_T32_LDRDSTRD and PROBES_T32_LDRSTR * may get here. Simply mark all normal insns as STACK_USE_NONE.
*/ staticconstunion decode_item table[] = {
/* * First, filter out all ldr insns to make our life easier. * Following load insns may come here: * LDM, LDRD, LDR. * In T32 encoding, bit 20 is enough for distinguishing * load and store. All load insns have this bit set, when * all store insns have this bit clear.
*/
DECODE_CUSTOM (0x00100000, 0x00100000, STACK_USE_NONE),
/* * Mark all 'STR{,B,H}, Rt, [Rn, Rm]' as STACK_USE_UNKNOWN * if Rn or Rm is SP. T32 doesn't encode STRD.
*/ /* xx | Rn | Rt | | Rm |*/ /* STR (register) 1111 1000 0100 xxxx xxxx 0000 00xx xxxx */ /* STRB (register) 1111 1000 0000 xxxx xxxx 0000 00xx xxxx */ /* STRH (register) 1111 1000 0010 xxxx xxxx 0000 00xx xxxx */ /* INVALID INSN 1111 1000 0110 xxxx xxxx 0000 00xx xxxx */ /* By Introducing INVALID INSN, bit 21 and 22 can be ignored. */
DECODE_OR (0xff9f0fc0, 0xf80d0000),
DECODE_CUSTOM (0xff900fcf, 0xf800000d, STACK_USE_UNKNOWN),
/* For STR{,B,H} (imm 12), offset is always positive, so ignore them. */
/* P U W | Rn | Rt | Rt2| imm8 |*/ /* STRD (immediate) 1110 1001 01x0 1101 xxxx xxxx xxxx xxxx */ /* * Only consider U == 0 and P == 1. * Also note that STRD in T32 encoding is special: * imm = ZeroExtend(imm8:'00', 32)
*/
DECODE_CUSTOM (0xffdf0000, 0xe94d0000, STACK_USE_T32STRD),
/* * See following comments. This insn must be 'push'.
*/ staticenum probes_insn __kprobes t16_check_stack(probes_opcode_t insn, struct arch_probes_insn *asi, conststruct decode_header *h)
{ unsignedint reglist = insn & 0x1ff;
asi->stack_space = hweight32(reglist) * 4; return INSN_GOOD;
}
/* * T16 encoding is simple: only the 'push' insn can need extra stack space. * Other insns, like str, can only use r0-r7 as Rn.
*/ conststruct decode_checker t16_stack_checker[NUM_PROBES_T16_ACTIONS] = {
[PROBES_T16_PUSH] = {.checker = t16_check_stack},
};
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 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.