xref: /openbmc/linux/arch/arm64/include/asm/probes.h (revision c2249707)
12dd0e8d2SSandeepa Prabhu /*
22dd0e8d2SSandeepa Prabhu  * arch/arm64/include/asm/probes.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 #ifndef _ARM_PROBES_H
162dd0e8d2SSandeepa Prabhu #define _ARM_PROBES_H
172dd0e8d2SSandeepa Prabhu 
1839a67d49SSandeepa Prabhu #include <asm/opcodes.h>
1939a67d49SSandeepa Prabhu 
20c2249707SPratyush Anand typedef u32 probe_opcode_t;
21c2249707SPratyush Anand typedef void (probes_handler_t) (u32 opcode, long addr, struct pt_regs *);
222dd0e8d2SSandeepa Prabhu 
232dd0e8d2SSandeepa Prabhu /* architecture specific copy of original instruction */
24c2249707SPratyush Anand struct arch_probe_insn {
25c2249707SPratyush Anand 	probe_opcode_t *insn;
2639a67d49SSandeepa Prabhu 	pstate_check_t *pstate_cc;
27c2249707SPratyush Anand 	probes_handler_t *handler;
282dd0e8d2SSandeepa Prabhu 	/* restore address after step xol */
292dd0e8d2SSandeepa Prabhu 	unsigned long restore;
302dd0e8d2SSandeepa Prabhu };
31c2249707SPratyush Anand #ifdef CONFIG_KPROBES
32c2249707SPratyush Anand typedef u32 kprobe_opcode_t;
33c2249707SPratyush Anand struct arch_specific_insn {
34c2249707SPratyush Anand 	struct arch_probe_insn api;
35c2249707SPratyush Anand };
36c2249707SPratyush Anand #endif
372dd0e8d2SSandeepa Prabhu 
382dd0e8d2SSandeepa Prabhu #endif
39