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