2019-05-27 14:55:21 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2011-04-20 17:52:38 +08:00
|
|
|
/*
|
|
|
|
* arch/arm/kernel/kprobes.h
|
|
|
|
*
|
2011-04-26 22:15:56 +08:00
|
|
|
* Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
|
|
|
|
*
|
|
|
|
* Some contents moved here from arch/arm/include/asm/kprobes.h which is
|
2011-04-20 17:52:38 +08:00
|
|
|
* Copyright (C) 2006, 2007 Motorola Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ARM_KERNEL_KPROBES_H
|
|
|
|
#define _ARM_KERNEL_KPROBES_H
|
|
|
|
|
2015-01-09 10:19:49 +08:00
|
|
|
#include <asm/kprobes.h>
|
|
|
|
#include "../decode.h"
|
2014-03-07 07:12:07 +08:00
|
|
|
|
2011-04-20 17:52:38 +08:00
|
|
|
/*
|
2011-04-20 00:18:35 +08:00
|
|
|
* These undefined instructions must be unique and
|
2011-04-20 17:52:38 +08:00
|
|
|
* reserved solely for kprobes' use.
|
|
|
|
*/
|
2011-06-17 00:22:37 +08:00
|
|
|
#define KPROBE_ARM_BREAKPOINT_INSTRUCTION 0x07f001f8
|
2011-04-20 00:18:35 +08:00
|
|
|
#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18
|
|
|
|
#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018
|
|
|
|
|
2015-01-09 14:37:36 +08:00
|
|
|
extern void kprobes_remove_breakpoint(void *addr, unsigned int insn);
|
|
|
|
|
2014-03-07 07:12:07 +08:00
|
|
|
enum probes_insn __kprobes
|
2014-03-06 10:41:29 +08:00
|
|
|
kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_probes_insn *asi,
|
2014-03-07 07:12:07 +08:00
|
|
|
const struct decode_header *h);
|
2011-04-20 17:52:38 +08:00
|
|
|
|
2014-03-06 10:23:42 +08:00
|
|
|
typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
|
2014-03-06 10:41:29 +08:00
|
|
|
struct arch_probes_insn *,
|
2014-03-06 10:40:12 +08:00
|
|
|
bool,
|
2015-01-05 19:29:18 +08:00
|
|
|
const union decode_action *,
|
2015-02-10 15:03:22 +08:00
|
|
|
const struct decode_checker *[]);
|
2011-04-20 00:56:58 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_THUMB2_KERNEL
|
|
|
|
|
2014-03-07 07:12:07 +08:00
|
|
|
extern const union decode_action kprobes_t32_actions[];
|
|
|
|
extern const union decode_action kprobes_t16_actions[];
|
2015-01-05 19:29:18 +08:00
|
|
|
extern const struct decode_checker *kprobes_t32_checkers[];
|
|
|
|
extern const struct decode_checker *kprobes_t16_checkers[];
|
2011-04-20 00:56:58 +08:00
|
|
|
#else /* !CONFIG_THUMB2_KERNEL */
|
|
|
|
|
2014-03-07 07:12:07 +08:00
|
|
|
extern const union decode_action kprobes_arm_actions[];
|
2015-01-05 19:29:18 +08:00
|
|
|
extern const struct decode_checker *kprobes_arm_checkers[];
|
2014-03-07 07:06:43 +08:00
|
|
|
|
2011-04-20 00:56:58 +08:00
|
|
|
#endif
|
2011-04-20 17:52:38 +08:00
|
|
|
|
|
|
|
#endif /* _ARM_KERNEL_KPROBES_H */
|