xref: /openbmc/linux/arch/arm64/include/asm/ptdump.h (revision caab277b)
1caab277bSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
24674fdb9SMark Rutland /*
34674fdb9SMark Rutland  * Copyright (C) 2014 ARM Ltd.
44674fdb9SMark Rutland  */
54674fdb9SMark Rutland #ifndef __ASM_PTDUMP_H
64674fdb9SMark Rutland #define __ASM_PTDUMP_H
74674fdb9SMark Rutland 
84ddb9bf8SLaura Abbott #ifdef CONFIG_ARM64_PTDUMP_CORE
94674fdb9SMark Rutland 
104674fdb9SMark Rutland #include <linux/mm_types.h>
114ddb9bf8SLaura Abbott #include <linux/seq_file.h>
124674fdb9SMark Rutland 
134674fdb9SMark Rutland struct addr_marker {
144674fdb9SMark Rutland 	unsigned long start_address;
154674fdb9SMark Rutland 	char *name;
164674fdb9SMark Rutland };
174674fdb9SMark Rutland 
184674fdb9SMark Rutland struct ptdump_info {
194674fdb9SMark Rutland 	struct mm_struct		*mm;
204674fdb9SMark Rutland 	const struct addr_marker	*markers;
214674fdb9SMark Rutland 	unsigned long			base_addr;
224674fdb9SMark Rutland };
234674fdb9SMark Rutland 
244ddb9bf8SLaura Abbott void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info);
254ddb9bf8SLaura Abbott #ifdef CONFIG_ARM64_PTDUMP_DEBUGFS
26e2a2e56eSGreg Kroah-Hartman void ptdump_debugfs_register(struct ptdump_info *info, const char *name);
274674fdb9SMark Rutland #else
28e2a2e56eSGreg Kroah-Hartman static inline void ptdump_debugfs_register(struct ptdump_info *info,
29e2a2e56eSGreg Kroah-Hartman 					   const char *name) { }
304ddb9bf8SLaura Abbott #endif
311404d6f1SLaura Abbott void ptdump_check_wx(void);
324ddb9bf8SLaura Abbott #endif /* CONFIG_ARM64_PTDUMP_CORE */
331404d6f1SLaura Abbott 
341404d6f1SLaura Abbott #ifdef CONFIG_DEBUG_WX
351404d6f1SLaura Abbott #define debug_checkwx()	ptdump_check_wx()
361404d6f1SLaura Abbott #else
371404d6f1SLaura Abbott #define debug_checkwx()	do { } while (0)
381404d6f1SLaura Abbott #endif
391404d6f1SLaura Abbott 
404674fdb9SMark Rutland #endif /* __ASM_PTDUMP_H */
41