kcore.h 941 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. KCORE_OTHER,
  14. KCORE_REMAP,
  15. };
  16. struct kcore_list {
  17. struct list_head list;
  18. unsigned long addr;
  19. unsigned long vaddr;
  20. size_t size;
  21. int type;
  22. };
  23. struct vmcore {
  24. struct list_head list;
  25. unsigned long long paddr;
  26. unsigned long long size;
  27. loff_t offset;
  28. };
  29. struct vmcoredd_node {
  30. struct list_head list; /* List of dumps */
  31. void *buf; /* Buffer containing device's dump */
  32. unsigned int size; /* Size of the buffer */
  33. };
  34. #ifdef CONFIG_PROC_KCORE
  35. void __init kclist_add(struct kcore_list *, void *, size_t, int type);
  36. extern int __init register_mem_pfn_is_ram(int (*fn)(unsigned long pfn));
  37. #else
  38. static inline
  39. void kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
  40. {
  41. }
  42. #endif
  43. #endif /* _LINUX_KCORE_H */