提交 87abef63 编写于 作者: D David A. Long

ARM: move generic thumb instruction parsing code to new files for use by other feature

Move the thumb version of the kprobes instruction parsing code into more generic
files from where it can be used by uprobes and possibly other subsystems. The
symbol names will be made more generic in a subsequent part of this patchset.
Signed-off-by: NDavid A. Long <dave.long@linaro.org>
Acked-by: NJon Medhurst <tixy@linaro.org>
上级 c18377c3
......@@ -52,7 +52,7 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_KPROBES) += probes.o kprobes.o kprobes-common.o patch.o
ifdef CONFIG_THUMB2_KERNEL
obj-$(CONFIG_KPROBES) += kprobes-thumb.o
obj-$(CONFIG_KPROBES) += kprobes-thumb.o probes-thumb.o
else
obj-$(CONFIG_KPROBES) += kprobes-arm.o probes-arm.o
endif
......
此差异已折叠。
此差异已折叠。
/*
* arch/arm/kernel/probes-thumb.h
*
* Copyright 2013 Linaro Ltd.
* Written by: David A. Long
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef _ARM_KERNEL_PROBES_THUMB_H
#define _ARM_KERNEL_PROBES_THUMB_H
/*
* True if current instruction is in an IT block.
*/
#define in_it_block(cpsr) ((cpsr & 0x06000c00) != 0x00000000)
/*
* Return the condition code to check for the currently executing instruction.
* This is in ITSTATE<7:4> which is in CPSR<15:12> but is only valid if
* in_it_block returns true.
*/
#define current_cond(cpsr) ((cpsr >> 12) & 0xf)
void __kprobes t16_simulate_bxblx(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_simulate_ldr_literal(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_simulate_ldrstr_sp_relative(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t16_simulate_reladr(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_simulate_add_sp_imm(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_simulate_cbz(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_simulate_it(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_singlestep_it(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t16_decode_it(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t16_simulate_cond_branch(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t16_decode_cond_branch(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t16_simulate_branch(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_emulate_loregs_rwflags(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t16_emulate_loregs_noitrwflags(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t16_emulate_hiregs(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t16_decode_hiregs(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t16_emulate_push(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t16_decode_push(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t16_emulate_pop_nopc(struct kprobe *p, struct pt_regs *regs);
void __kprobes t16_emulate_pop_pc(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t16_decode_pop(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t32_simulate_table_branch(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t32_simulate_mrs(struct kprobe *p, struct pt_regs *regs);
void __kprobes t32_simulate_cond_branch(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t32_decode_cond_branch(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t32_simulate_branch(struct kprobe *p, struct pt_regs *regs);
void __kprobes t32_simulate_ldr_literal(struct kprobe *p, struct pt_regs *regs);
enum kprobe_insn __kprobes t32_decode_ldmstm(kprobe_opcode_t insn,
struct arch_specific_insn *asi);
void __kprobes t32_emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs);
void __kprobes t32_emulate_ldrstr(struct kprobe *p, struct pt_regs *regs);
void __kprobes t32_emulate_rd8rn16rm0_rwflags(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t32_emulate_rd8pc16_noflags(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t32_emulate_rd8rn16_noflags(struct kprobe *p,
struct pt_regs *regs);
void __kprobes t32_emulate_rdlo12rdhi8rn16rm0_noflags(struct kprobe *p,
struct pt_regs *regs);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册