David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2014 ARM Ltd. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 4 | */ |
| 5 | #ifndef __ASM_PTDUMP_H |
| 6 | #define __ASM_PTDUMP_H |
| 7 | |
| 8 | #ifdef CONFIG_ARM64_PTDUMP_CORE |
| 9 | |
| 10 | #include <linux/mm_types.h> |
| 11 | #include <linux/seq_file.h> |
| 12 | |
| 13 | struct addr_marker { |
| 14 | unsigned long start_address; |
| 15 | char *name; |
| 16 | }; |
| 17 | |
| 18 | struct ptdump_info { |
| 19 | struct mm_struct *mm; |
| 20 | const struct addr_marker *markers; |
| 21 | unsigned long base_addr; |
| 22 | }; |
| 23 | |
| 24 | void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info); |
| 25 | #ifdef CONFIG_ARM64_PTDUMP_DEBUGFS |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 26 | void ptdump_debugfs_register(struct ptdump_info *info, const char *name); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 27 | #else |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 28 | static inline void ptdump_debugfs_register(struct ptdump_info *info, |
| 29 | const char *name) { } |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 30 | #endif |
| 31 | void ptdump_check_wx(void); |
| 32 | #endif /* CONFIG_ARM64_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 */ |