xref: /linux/arch/arm64/kernel/probes/decode-insn.h (revision 7d134b2ce639448199052fd573a324f7e7cd5ed8)
12dd0e8d2SSandeepa Prabhu /*
22dd0e8d2SSandeepa Prabhu  * arch/arm64/kernel/probes/decode-insn.h
32dd0e8d2SSandeepa Prabhu  *
42dd0e8d2SSandeepa Prabhu  * Copyright (C) 2013 Linaro Limited.
52dd0e8d2SSandeepa Prabhu  *
62dd0e8d2SSandeepa Prabhu  * This program is free software; you can redistribute it and/or modify
72dd0e8d2SSandeepa Prabhu  * it under the terms of the GNU General Public License version 2 as
82dd0e8d2SSandeepa Prabhu  * published by the Free Software Foundation.
92dd0e8d2SSandeepa Prabhu  *
102dd0e8d2SSandeepa Prabhu  * This program is distributed in the hope that it will be useful,
112dd0e8d2SSandeepa Prabhu  * but WITHOUT ANY WARRANTY; without even the implied warranty of
122dd0e8d2SSandeepa Prabhu  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
132dd0e8d2SSandeepa Prabhu  * General Public License for more details.
142dd0e8d2SSandeepa Prabhu  */
152dd0e8d2SSandeepa Prabhu 
162dd0e8d2SSandeepa Prabhu #ifndef _ARM_KERNEL_KPROBES_ARM64_H
172dd0e8d2SSandeepa Prabhu #define _ARM_KERNEL_KPROBES_ARM64_H
182dd0e8d2SSandeepa Prabhu 
19*7d134b2cSLuis R. Rodriguez #include <asm/kprobes.h>
20*7d134b2cSLuis R. Rodriguez 
212dd0e8d2SSandeepa Prabhu /*
222dd0e8d2SSandeepa Prabhu  * ARM strongly recommends a limit of 128 bytes between LoadExcl and
232dd0e8d2SSandeepa Prabhu  * StoreExcl instructions in a single thread of execution. So keep the
242dd0e8d2SSandeepa Prabhu  * max atomic context size as 32.
252dd0e8d2SSandeepa Prabhu  */
262dd0e8d2SSandeepa Prabhu #define MAX_ATOMIC_CONTEXT_SIZE	(128 / sizeof(kprobe_opcode_t))
272dd0e8d2SSandeepa Prabhu 
28c2249707SPratyush Anand enum probe_insn {
292dd0e8d2SSandeepa Prabhu 	INSN_REJECTED,
3039a67d49SSandeepa Prabhu 	INSN_GOOD_NO_SLOT,
312dd0e8d2SSandeepa Prabhu 	INSN_GOOD,
322dd0e8d2SSandeepa Prabhu };
332dd0e8d2SSandeepa Prabhu 
34c2249707SPratyush Anand #ifdef CONFIG_KPROBES
35c2249707SPratyush Anand enum probe_insn __kprobes
362dd0e8d2SSandeepa Prabhu arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi);
37c2249707SPratyush Anand #endif
38c2249707SPratyush Anand enum probe_insn __kprobes
39c2249707SPratyush Anand arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *asi);
402dd0e8d2SSandeepa Prabhu 
412dd0e8d2SSandeepa Prabhu #endif /* _ARM_KERNEL_KPROBES_ARM64_H */
42