xref: /linux-6.15/include/linux/kcore.h (revision 819403c8)
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 #ifdef CONFIG_PROC_KCORE
24a8dd9c4dSOmar Sandoval void __init kclist_add(struct kcore_list *, void *, size_t, int type);
25*ffc8599aSKairui Song 
26*ffc8599aSKairui Song extern int __init register_mem_pfn_is_ram(int (*fn)(unsigned long pfn));
272f96b8c1SDavid Howells #else
282f96b8c1SDavid Howells static inline
kclist_add(struct kcore_list * new,void * addr,size_t size,int type)292f96b8c1SDavid Howells void kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
302f96b8c1SDavid Howells {
312f96b8c1SDavid Howells }
322f96b8c1SDavid Howells #endif
332f96b8c1SDavid Howells 
342f96b8c1SDavid Howells #endif /* _LINUX_KCORE_H */
35