mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-03 18:20:25 +02:00 
			
		
		
		
	The NOKPROBE_SYMBOL macro (and others) were moved to asm-generic/kprobes.h in 2017 by commit7d134b2ce6("kprobes: move kprobe declarations to asm-generic/kprobes.h"), and this new header was included by asm/kprobes.h unconditionally on all architectures. When kprobe support was added to parisc in 2017 by commit8858ac8e9e("parisc: Implement kprobes"), that header was only included when CONFIG_KPROBES was enabled. This can lead to build failures when NOKPROBE_SYMBOL is used, but CONFIG_KPROBES is disabled. This mistake however was never actually noticed because linux/kprobes.h also includes asm-generic/kprobes.h (though I do not understand why that is, because it also includes asm/kprobes.h). To prevent eventual build failures, I suggest to always include asm-generic/kprobes.h on parisc, just like all the other architectures do. This way, including asm/kprobes.h suffices, and nobody (outside of arch/) ever needs to explicitly include asm-generic/kprobes.h. Signed-off-by: Max Kellermann <max.kellermann@ionos.com> Signed-off-by: Helge Deller <deller@gmx.de>
		
			
				
	
	
		
			61 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0 */
 | 
						|
/*
 | 
						|
 * arch/parisc/include/asm/kprobes.h
 | 
						|
 *
 | 
						|
 * PA-RISC kprobes implementation
 | 
						|
 *
 | 
						|
 * Copyright (c) 2019 Sven Schnelle <svens@stackframe.org>
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _PARISC_KPROBES_H
 | 
						|
#define _PARISC_KPROBES_H
 | 
						|
 | 
						|
#include <asm-generic/kprobes.h>
 | 
						|
 | 
						|
#ifdef CONFIG_KPROBES
 | 
						|
 | 
						|
#include <linux/types.h>
 | 
						|
#include <linux/ptrace.h>
 | 
						|
#include <linux/notifier.h>
 | 
						|
 | 
						|
#define PARISC_KPROBES_BREAK_INSN	0x3ff801f
 | 
						|
#define PARISC_KPROBES_BREAK_INSN2	0x3ff801e
 | 
						|
#define  __ARCH_WANT_KPROBES_INSN_SLOT
 | 
						|
#define MAX_INSN_SIZE 2
 | 
						|
 | 
						|
typedef u32 kprobe_opcode_t;
 | 
						|
struct kprobe;
 | 
						|
 | 
						|
void arch_remove_kprobe(struct kprobe *p);
 | 
						|
 | 
						|
#define flush_insn_slot(p) \
 | 
						|
	flush_icache_range((unsigned long)&(p)->ainsn.insn[0], \
 | 
						|
			   (unsigned long)&(p)->ainsn.insn[0] + \
 | 
						|
			   MAX_INSN_SIZE*sizeof(kprobe_opcode_t))
 | 
						|
 | 
						|
#define kretprobe_blacklist_size    0
 | 
						|
 | 
						|
struct arch_specific_insn {
 | 
						|
	kprobe_opcode_t *insn;
 | 
						|
};
 | 
						|
 | 
						|
struct prev_kprobe {
 | 
						|
	struct kprobe *kp;
 | 
						|
	unsigned long status;
 | 
						|
};
 | 
						|
 | 
						|
struct kprobe_ctlblk {
 | 
						|
	unsigned int kprobe_status;
 | 
						|
	struct prev_kprobe prev_kprobe;
 | 
						|
	unsigned long iaoq[2];
 | 
						|
};
 | 
						|
 | 
						|
int __kprobes parisc_kprobe_break_handler(struct pt_regs *regs);
 | 
						|
int __kprobes parisc_kprobe_ss_handler(struct pt_regs *regs);
 | 
						|
static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 | 
						|
{
 | 
						|
	return 0;
 | 
						|
}
 | 
						|
 | 
						|
#endif /* CONFIG_KPROBES */
 | 
						|
#endif /* _PARISC_KPROBES_H */
 |