123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #include <linux/kernel.h>
- #include "../decode.h"
- #include "../decode-thumb.h"
- #include "checkers.h"
- static enum probes_insn __kprobes t32_check_stack(probes_opcode_t insn,
- struct arch_probes_insn *asi,
- const struct decode_header *h)
- {
-
- static const union decode_item table[] = {
-
- DECODE_CUSTOM (0x00100000, 0x00100000, STACK_USE_NONE),
-
-
-
-
-
-
-
- DECODE_OR (0xff9f0fc0, 0xf80d0000),
- DECODE_CUSTOM (0xff900fcf, 0xf800000d, STACK_USE_UNKNOWN),
-
-
-
-
-
-
- DECODE_CUSTOM (0xff9f0e00, 0xf80d0c00, STACK_USE_FIXED_0XX),
-
-
-
-
- DECODE_CUSTOM (0xffdf0000, 0xe94d0000, STACK_USE_T32STRD),
-
-
- DECODE_CUSTOM (0xffdf0000, 0xe90d0000, STACK_USE_STMDX),
-
- DECODE_CUSTOM (0, 0, STACK_USE_NONE),
- DECODE_END
- };
- return probes_decode_insn(insn, asi, table, false, false, stack_check_actions, NULL);
- }
- const struct decode_checker t32_stack_checker[NUM_PROBES_T32_ACTIONS] = {
- [PROBES_T32_LDMSTM] = {.checker = t32_check_stack},
- [PROBES_T32_LDRDSTRD] = {.checker = t32_check_stack},
- [PROBES_T32_LDRSTR] = {.checker = t32_check_stack},
- };
- static enum probes_insn __kprobes t16_check_stack(probes_opcode_t insn,
- struct arch_probes_insn *asi,
- const struct decode_header *h)
- {
- unsigned int reglist = insn & 0x1ff;
- asi->stack_space = hweight32(reglist) * 4;
- return INSN_GOOD;
- }
- const struct decode_checker t16_stack_checker[NUM_PROBES_T16_ACTIONS] = {
- [PROBES_T16_PUSH] = {.checker = t16_check_stack},
- };
|