include/linux/crash_dump.h
Source file repositories/reference/linux-study-clean/include/linux/crash_dump.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/crash_dump.h- Extension
.h- Size
- 6477 bytes
- Lines
- 193
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kexec.hlinux/proc_fs.hlinux/elf.hlinux/pgtable.huapi/linux/vmcore.h
Detected Declarations
struct vmcore_cbstruct vmcore_rangestruct vmcoredd_datafunction is_kdump_kernelfunction is_vmcore_usablefunction is_kdump_kernelfunction vmcore_alloc_add_rangefunction vmcore_free_rangesfunction list_for_each_entry_safefunction is_kdump_kernelfunction vmcore_add_device_dumpfunction read_from_oldmem
Annotated Snippet
struct vmcore_cb {
bool (*pfn_is_ram)(struct vmcore_cb *cb, unsigned long pfn);
int (*get_device_ram)(struct vmcore_cb *cb, struct list_head *list);
struct list_head next;
};
extern void register_vmcore_cb(struct vmcore_cb *cb);
extern void unregister_vmcore_cb(struct vmcore_cb *cb);
struct vmcore_range {
struct list_head list;
unsigned long long paddr;
unsigned long long size;
loff_t offset;
};
/* Allocate a vmcore range and add it to the list. */
static inline int vmcore_alloc_add_range(struct list_head *list,
unsigned long long paddr, unsigned long long size)
{
struct vmcore_range *m = kzalloc_obj(*m);
if (!m)
return -ENOMEM;
m->paddr = paddr;
m->size = size;
list_add_tail(&m->list, list);
return 0;
}
/* Free a list of vmcore ranges. */
static inline void vmcore_free_ranges(struct list_head *list)
{
struct vmcore_range *m, *tmp;
list_for_each_entry_safe(m, tmp, list, list) {
list_del(&m->list);
kfree(m);
}
}
#else /* !CONFIG_CRASH_DUMP */
static inline bool is_kdump_kernel(void) { return false; }
#endif /* CONFIG_CRASH_DUMP */
/* Device Dump information to be filled by drivers */
struct vmcoredd_data {
char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */
unsigned int size; /* Size of the dump */
/* Driver's registered callback to be invoked to collect dump */
int (*vmcoredd_callback)(struct vmcoredd_data *data, void *buf);
};
#ifdef CONFIG_PROC_VMCORE_DEVICE_DUMP
int vmcore_add_device_dump(struct vmcoredd_data *data);
#else
static inline int vmcore_add_device_dump(struct vmcoredd_data *data)
{
return -EOPNOTSUPP;
}
#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
#ifdef CONFIG_PROC_VMCORE
ssize_t read_from_oldmem(struct iov_iter *iter, size_t count,
u64 *ppos, bool encrypted);
#else
static inline ssize_t read_from_oldmem(struct iov_iter *iter, size_t count,
u64 *ppos, bool encrypted)
{
return -EOPNOTSUPP;
}
#endif /* CONFIG_PROC_VMCORE */
#endif /* LINUX_CRASHDUMP_H */
Annotation
- Immediate include surface: `linux/kexec.h`, `linux/proc_fs.h`, `linux/elf.h`, `linux/pgtable.h`, `uapi/linux/vmcore.h`.
- Detected declarations: `struct vmcore_cb`, `struct vmcore_range`, `struct vmcoredd_data`, `function is_kdump_kernel`, `function is_vmcore_usable`, `function is_kdump_kernel`, `function vmcore_alloc_add_range`, `function vmcore_free_ranges`, `function list_for_each_entry_safe`, `function is_kdump_kernel`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.