ptdump.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2014 ARM Ltd.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __ASM_PTDUMP_H
  17. #define __ASM_PTDUMP_H
  18. #ifdef CONFIG_ARM64_PTDUMP_CORE
  19. #include <linux/mm_types.h>
  20. #include <linux/seq_file.h>
  21. struct addr_marker {
  22. unsigned long start_address;
  23. char *name;
  24. };
  25. struct ptdump_info {
  26. struct mm_struct *mm;
  27. const struct addr_marker *markers;
  28. unsigned long base_addr;
  29. };
  30. void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info);
  31. #ifdef CONFIG_ARM64_PTDUMP_DEBUGFS
  32. int ptdump_debugfs_register(struct ptdump_info *info, const char *name);
  33. #else
  34. static inline int ptdump_debugfs_register(struct ptdump_info *info,
  35. const char *name)
  36. {
  37. return 0;
  38. }
  39. #endif
  40. void ptdump_check_wx(void);
  41. #endif /* CONFIG_ARM64_PTDUMP_CORE */
  42. #ifdef CONFIG_DEBUG_WX
  43. #define debug_checkwx() ptdump_check_wx()
  44. #else
  45. #define debug_checkwx() do { } while (0)
  46. #endif
  47. #endif /* __ASM_PTDUMP_H */