blob: 0c2d3d0d4cc69594226a97df936cdde1fbc10cd7 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* 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
11struct addr_marker {
12 unsigned long start_address;
13 char *name;
14};
15
16struct ptdump_info {
17 struct mm_struct *mm;
18 const struct addr_marker *markers;
19 unsigned long base_addr;
20};
21
22void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info);
23#ifdef CONFIG_ARM_PTDUMP_DEBUGFS
David Brazdil0f672f62019-12-10 10:32:29 +000024void ptdump_debugfs_register(struct ptdump_info *info, const char *name);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000025#else
David Brazdil0f672f62019-12-10 10:32:29 +000026static inline void ptdump_debugfs_register(struct ptdump_info *info,
27 const char *name) { }
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000028#endif /* CONFIG_ARM_PTDUMP_DEBUGFS */
29
30void ptdump_check_wx(void);
31
32#endif /* CONFIG_ARM_PTDUMP_CORE */
33
34#ifdef CONFIG_DEBUG_WX
35#define debug_checkwx() ptdump_check_wx()
36#else
37#define debug_checkwx() do { } while (0)
38#endif
39
40#endif /* __ASM_PTDUMP_H */