xref: /openbmc/linux/arch/arm64/include/asm/probes.h (revision 2dd0e8d2)
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 
182dd0e8d2SSandeepa Prabhu struct kprobe;
192dd0e8d2SSandeepa Prabhu struct arch_specific_insn;
202dd0e8d2SSandeepa Prabhu 
212dd0e8d2SSandeepa Prabhu typedef u32 kprobe_opcode_t;
222dd0e8d2SSandeepa Prabhu typedef unsigned long (kprobes_pstate_check_t)(unsigned long);
232dd0e8d2SSandeepa Prabhu typedef void (kprobes_handler_t) (u32 opcode, long addr, struct pt_regs *);
242dd0e8d2SSandeepa Prabhu 
252dd0e8d2SSandeepa Prabhu /* architecture specific copy of original instruction */
262dd0e8d2SSandeepa Prabhu struct arch_specific_insn {
272dd0e8d2SSandeepa Prabhu 	kprobe_opcode_t *insn;
282dd0e8d2SSandeepa Prabhu 	kprobes_pstate_check_t *pstate_cc;
292dd0e8d2SSandeepa Prabhu 	kprobes_handler_t *handler;
302dd0e8d2SSandeepa Prabhu 	/* restore address after step xol */
312dd0e8d2SSandeepa Prabhu 	unsigned long restore;
322dd0e8d2SSandeepa Prabhu };
332dd0e8d2SSandeepa Prabhu 
342dd0e8d2SSandeepa Prabhu #endif
35