| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
/* |
| 3 |
* Copyright (C) 2014-2016 Pratyush Anand <[email protected]> |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef _ASM_UPROBES_H |
| 7 |
#define _ASM_UPROBES_H |
| 8 |
|
| 9 |
#include <asm/debug-monitors.h> |
| 10 |
#include <asm/insn.h> |
| 11 |
#include <asm/probes.h> |
| 12 |
|
| 13 |
#define UPROBE_SWBP_INSN cpu_to_le32(BRK64_OPCODE_UPROBES) |
| 14 |
#define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE |
| 15 |
#define UPROBE_XOL_SLOT_BYTES AARCH64_INSN_SIZE |
| 16 |
|
| 17 |
typedef __le32 uprobe_opcode_t; |
| 18 |
|
| 19 |
struct arch_uprobe_task { |
| 20 |
}; |
| 21 |
|
| 22 |
struct arch_uprobe { |
| 23 |
union { |
| 24 |
__le32 insn; |
| 25 |
__le32 ixol; |
| 26 |
}; |
| 27 |
struct arch_probe_insn api; |
| 28 |
bool simulate; |
| 29 |
}; |
| 30 |
|
| 31 |
int uprobe_brk_handler(struct pt_regs *regs, unsigned long esr); |
| 32 |
#ifdef CONFIG_UPROBES |
| 33 |
int uprobe_single_step_handler(struct pt_regs *regs, unsigned long esr); |
| 34 |
#else |
| 35 |
static inline int uprobe_single_step_handler(struct pt_regs *regs, |
| 36 |
unsigned long esr) |
| 37 |
{ |
| 38 |
return DBG_HOOK_ERROR; |
| 39 |
} |
| 40 |
#endif |
| 41 |
|
| 42 |
#endif |