xref: /linux/include/linux/kcore.h (revision 3c36b419)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
22f96b8c1SDavid Howells /*
32f96b8c1SDavid Howells  * /proc/kcore definitions
42f96b8c1SDavid Howells  */
52f96b8c1SDavid Howells #ifndef _LINUX_KCORE_H
62f96b8c1SDavid Howells #define _LINUX_KCORE_H
72f96b8c1SDavid Howells 
82f96b8c1SDavid Howells enum kcore_type {
92f96b8c1SDavid Howells 	KCORE_TEXT,
102f96b8c1SDavid Howells 	KCORE_VMALLOC,
112f96b8c1SDavid Howells 	KCORE_RAM,
122f96b8c1SDavid Howells 	KCORE_VMEMMAP,
13595dd46eSJia Zhang 	KCORE_USER,
142f96b8c1SDavid Howells };
152f96b8c1SDavid Howells 
162f96b8c1SDavid Howells struct kcore_list {
172f96b8c1SDavid Howells 	struct list_head list;
182f96b8c1SDavid Howells 	unsigned long addr;
192f96b8c1SDavid Howells 	size_t size;
202f96b8c1SDavid Howells 	int type;
212f96b8c1SDavid Howells };
222f96b8c1SDavid Howells 
232f96b8c1SDavid Howells struct vmcore {
242f96b8c1SDavid Howells 	struct list_head list;
252f96b8c1SDavid Howells 	unsigned long long paddr;
262f96b8c1SDavid Howells 	unsigned long long size;
272f96b8c1SDavid Howells 	loff_t offset;
282f96b8c1SDavid Howells };
292f96b8c1SDavid Howells 
302724273eSRahul Lakkireddy struct vmcoredd_node {
312724273eSRahul Lakkireddy 	struct list_head list;	/* List of dumps */
322724273eSRahul Lakkireddy 	void *buf;		/* Buffer containing device's dump */
332724273eSRahul Lakkireddy 	unsigned int size;	/* Size of the buffer */
342724273eSRahul Lakkireddy };
352724273eSRahul Lakkireddy 
362f96b8c1SDavid Howells #ifdef CONFIG_PROC_KCORE
37a8dd9c4dSOmar Sandoval void __init kclist_add(struct kcore_list *, void *, size_t, int type);
38*ffc8599aSKairui Song 
39*ffc8599aSKairui Song extern int __init register_mem_pfn_is_ram(int (*fn)(unsigned long pfn));
402f96b8c1SDavid Howells #else
412f96b8c1SDavid Howells static inline
kclist_add(struct kcore_list * new,void * addr,size_t size,int type)422f96b8c1SDavid Howells void kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
432f96b8c1SDavid Howells {
442f96b8c1SDavid Howells }
452f96b8c1SDavid Howells #endif
462f96b8c1SDavid Howells 
472f96b8c1SDavid Howells #endif /* _LINUX_KCORE_H */
48