Path: blob/master/arch/csky/kernel/probes/decode-insn.c
26489 views
// SPDX-License-Identifier: GPL-2.0+12#include <linux/kernel.h>3#include <linux/kprobes.h>4#include <linux/module.h>5#include <linux/kallsyms.h>6#include <asm/sections.h>78#include "decode-insn.h"9#include "simulate-insn.h"1011/* Return:12* INSN_REJECTED If instruction is one not allowed to kprobe,13* INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.14*/15enum probe_insn __kprobes16csky_probe_decode_insn(probe_opcode_t *addr, struct arch_probe_insn *api)17{18probe_opcode_t insn = le32_to_cpu(*addr);1920CSKY_INSN_SET_SIMULATE(br16, insn);21CSKY_INSN_SET_SIMULATE(bt16, insn);22CSKY_INSN_SET_SIMULATE(bf16, insn);23CSKY_INSN_SET_SIMULATE(jmp16, insn);24CSKY_INSN_SET_SIMULATE(jsr16, insn);25CSKY_INSN_SET_SIMULATE(lrw16, insn);26CSKY_INSN_SET_SIMULATE(pop16, insn);2728CSKY_INSN_SET_SIMULATE(br32, insn);29CSKY_INSN_SET_SIMULATE(bt32, insn);30CSKY_INSN_SET_SIMULATE(bf32, insn);31CSKY_INSN_SET_SIMULATE(jmp32, insn);32CSKY_INSN_SET_SIMULATE(jsr32, insn);33CSKY_INSN_SET_SIMULATE(lrw32, insn);34CSKY_INSN_SET_SIMULATE(pop32, insn);3536CSKY_INSN_SET_SIMULATE(bez32, insn);37CSKY_INSN_SET_SIMULATE(bnez32, insn);38CSKY_INSN_SET_SIMULATE(bnezad32, insn);39CSKY_INSN_SET_SIMULATE(bhsz32, insn);40CSKY_INSN_SET_SIMULATE(bhz32, insn);41CSKY_INSN_SET_SIMULATE(blsz32, insn);42CSKY_INSN_SET_SIMULATE(blz32, insn);43CSKY_INSN_SET_SIMULATE(bsr32, insn);44CSKY_INSN_SET_SIMULATE(jmpi32, insn);45CSKY_INSN_SET_SIMULATE(jsri32, insn);4647return INSN_GOOD;48}495051