]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blob - include/linux/kcore.h
Merge tag 'imx-fixes-4.20-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawngu...
[mirror_ubuntu-eoan-kernel.git] / include / linux / kcore.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * /proc/kcore definitions
4 */
5 #ifndef _LINUX_KCORE_H
6 #define _LINUX_KCORE_H
7
8 enum kcore_type {
9 KCORE_TEXT,
10 KCORE_VMALLOC,
11 KCORE_RAM,
12 KCORE_VMEMMAP,
13 KCORE_USER,
14 KCORE_OTHER,
15 KCORE_REMAP,
16 };
17
18 struct kcore_list {
19 struct list_head list;
20 unsigned long addr;
21 unsigned long vaddr;
22 size_t size;
23 int type;
24 };
25
26 struct vmcore {
27 struct list_head list;
28 unsigned long long paddr;
29 unsigned long long size;
30 loff_t offset;
31 };
32
33 struct vmcoredd_node {
34 struct list_head list; /* List of dumps */
35 void *buf; /* Buffer containing device's dump */
36 unsigned int size; /* Size of the buffer */
37 };
38
39 #ifdef CONFIG_PROC_KCORE
40 void __init kclist_add(struct kcore_list *, void *, size_t, int type);
41 static inline
42 void kclist_add_remap(struct kcore_list *m, void *addr, void *vaddr, size_t sz)
43 {
44 m->vaddr = (unsigned long)vaddr;
45 kclist_add(m, addr, sz, KCORE_REMAP);
46 }
47 #else
48 static inline
49 void kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
50 {
51 }
52
53 static inline
54 void kclist_add_remap(struct kcore_list *m, void *addr, void *vaddr, size_t sz)
55 {
56 }
57 #endif
58
59 #endif /* _LINUX_KCORE_H */