xref: /OK3568_Linux_fs/kernel/arch/arm64/include/asm/ptdump.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (C) 2014 ARM Ltd.
4*4882a593Smuzhiyun  */
5*4882a593Smuzhiyun #ifndef __ASM_PTDUMP_H
6*4882a593Smuzhiyun #define __ASM_PTDUMP_H
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifdef CONFIG_PTDUMP_CORE
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include <linux/mm_types.h>
11*4882a593Smuzhiyun #include <linux/seq_file.h>
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun struct addr_marker {
14*4882a593Smuzhiyun 	unsigned long start_address;
15*4882a593Smuzhiyun 	char *name;
16*4882a593Smuzhiyun };
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun struct ptdump_info {
19*4882a593Smuzhiyun 	struct mm_struct		*mm;
20*4882a593Smuzhiyun 	const struct addr_marker	*markers;
21*4882a593Smuzhiyun 	unsigned long			base_addr;
22*4882a593Smuzhiyun };
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun void ptdump_walk(struct seq_file *s, struct ptdump_info *info);
25*4882a593Smuzhiyun #ifdef CONFIG_PTDUMP_DEBUGFS
26*4882a593Smuzhiyun void ptdump_debugfs_register(struct ptdump_info *info, const char *name);
27*4882a593Smuzhiyun #else
ptdump_debugfs_register(struct ptdump_info * info,const char * name)28*4882a593Smuzhiyun static inline void ptdump_debugfs_register(struct ptdump_info *info,
29*4882a593Smuzhiyun 					   const char *name) { }
30*4882a593Smuzhiyun #endif
31*4882a593Smuzhiyun void ptdump_check_wx(void);
32*4882a593Smuzhiyun #endif /* CONFIG_PTDUMP_CORE */
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun #ifdef CONFIG_DEBUG_WX
35*4882a593Smuzhiyun #define debug_checkwx()	ptdump_check_wx()
36*4882a593Smuzhiyun #else
37*4882a593Smuzhiyun #define debug_checkwx()	do { } while (0)
38*4882a593Smuzhiyun #endif
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun #endif /* __ASM_PTDUMP_H */
41