linux/arch/x86/include/asm/kprobes.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _ASM_X86_KPROBES_H
#define _ASM_X86_KPROBES_H
/*
 *  Kernel Probes (KProbes)
 *
 * Copyright (C) IBM Corporation, 2002, 2004
 *
 * See arch/x86/kernel/kprobes.c for x86 kprobes history.
 */

#include <asm-generic/kprobes.h>

#ifdef CONFIG_KPROBES
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/percpu.h>
#include <asm/text-patching.h>
#include <asm/insn.h>

#define __ARCH_WANT_KPROBES_INSN_SLOT

struct pt_regs;
struct kprobe;

kprobe_opcode_t;

#define MAX_STACK_SIZE
#define CUR_STACK_SIZE(ADDR)
#define MIN_STACK_SIZE(ADDR)

#define flush_insn_slot(p)

/* optinsn template addresses */
extern __visible kprobe_opcode_t optprobe_template_entry[];
extern __visible kprobe_opcode_t optprobe_template_clac[];
extern __visible kprobe_opcode_t optprobe_template_val[];
extern __visible kprobe_opcode_t optprobe_template_call[];
extern __visible kprobe_opcode_t optprobe_template_end[];
#define MAX_OPTIMIZED_LENGTH
#define MAX_OPTINSN_SIZE

extern const int kretprobe_blacklist_size;

void arch_remove_kprobe(struct kprobe *p);

/* Architecture specific copy of original instruction*/
struct arch_specific_insn {};

struct arch_optimized_insn {};

/* Return true (!0) if optinsn is prepared for optimization. */
static inline int arch_prepared_optinsn(struct arch_optimized_insn *optinsn)
{}

struct prev_kprobe {};

/* per-cpu kprobe control block */
struct kprobe_ctlblk {};

extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
extern int kprobe_int3_handler(struct pt_regs *regs);

#else

static inline int kprobe_debug_handler(struct pt_regs *regs) { return 0; }

#endif /* CONFIG_KPROBES */
#endif /* _ASM_X86_KPROBES_H */