kcore.h 891 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * /proc/kcore definitions
  4. */
  5. #ifndef _LINUX_KCORE_H
  6. #define _LINUX_KCORE_H
  7. enum kcore_type {
  8. KCORE_TEXT,
  9. KCORE_VMALLOC,
  10. KCORE_RAM,
  11. KCORE_VMEMMAP,
  12. KCORE_USER,
  13. };
  14. struct kcore_list {
  15. struct list_head list;
  16. unsigned long addr;
  17. size_t size;
  18. int type;
  19. };
  20. struct vmcore {
  21. struct list_head list;
  22. unsigned long long paddr;
  23. unsigned long long size;
  24. loff_t offset;
  25. };
  26. struct vmcoredd_node {
  27. struct list_head list; /* List of dumps */
  28. void *buf; /* Buffer containing device's dump */
  29. unsigned int size; /* Size of the buffer */
  30. };
  31. #ifdef CONFIG_PROC_KCORE
  32. void __init kclist_add(struct kcore_list *, void *, size_t, int type);
  33. extern int __init register_mem_pfn_is_ram(int (*fn)(unsigned long pfn));
  34. #else
  35. static inline
  36. void kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
  37. {
  38. }
  39. #endif
  40. #endif /* _LINUX_KCORE_H */