xref: /linux/arch/arm64/kernel/probes/decode-insn.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*1802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
22dd0e8d2SSandeepa Prabhu /*
32dd0e8d2SSandeepa Prabhu  * arch/arm64/kernel/probes/decode-insn.h
42dd0e8d2SSandeepa Prabhu  *
52dd0e8d2SSandeepa Prabhu  * Copyright (C) 2013 Linaro Limited.
62dd0e8d2SSandeepa Prabhu  */
72dd0e8d2SSandeepa Prabhu 
82dd0e8d2SSandeepa Prabhu #ifndef _ARM_KERNEL_KPROBES_ARM64_H
92dd0e8d2SSandeepa Prabhu #define _ARM_KERNEL_KPROBES_ARM64_H
102dd0e8d2SSandeepa Prabhu 
117d134b2cSLuis R. Rodriguez #include <asm/kprobes.h>
127d134b2cSLuis R. Rodriguez 
132dd0e8d2SSandeepa Prabhu /*
142dd0e8d2SSandeepa Prabhu  * ARM strongly recommends a limit of 128 bytes between LoadExcl and
152dd0e8d2SSandeepa Prabhu  * StoreExcl instructions in a single thread of execution. So keep the
162dd0e8d2SSandeepa Prabhu  * max atomic context size as 32.
172dd0e8d2SSandeepa Prabhu  */
182dd0e8d2SSandeepa Prabhu #define MAX_ATOMIC_CONTEXT_SIZE	(128 / sizeof(kprobe_opcode_t))
192dd0e8d2SSandeepa Prabhu 
20c2249707SPratyush Anand enum probe_insn {
212dd0e8d2SSandeepa Prabhu 	INSN_REJECTED,
2239a67d49SSandeepa Prabhu 	INSN_GOOD_NO_SLOT,
232dd0e8d2SSandeepa Prabhu 	INSN_GOOD,
242dd0e8d2SSandeepa Prabhu };
252dd0e8d2SSandeepa Prabhu 
26c2249707SPratyush Anand #ifdef CONFIG_KPROBES
27c2249707SPratyush Anand enum probe_insn __kprobes
282dd0e8d2SSandeepa Prabhu arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi);
29c2249707SPratyush Anand #endif
30c2249707SPratyush Anand enum probe_insn __kprobes
31c2249707SPratyush Anand arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *asi);
322dd0e8d2SSandeepa Prabhu 
332dd0e8d2SSandeepa Prabhu #endif /* _ARM_KERNEL_KPROBES_ARM64_H */
34