blob: 39d30ccf8d8798c1113ea70889ea106ecb25ad1f [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Dave Younga43cac02015-09-09 15:38:51 -07002#ifndef LINUX_KEXEC_INTERNAL_H
3#define LINUX_KEXEC_INTERNAL_H
4
5#include <linux/kexec.h>
6
7struct kimage *do_kimage_alloc_init(void);
8int sanity_check_segment_list(struct kimage *image);
9void kimage_free_page_list(struct list_head *list);
10void kimage_free(struct kimage *image);
11int kimage_load_segment(struct kimage *image, struct kexec_segment *segment);
12void kimage_terminate(struct kimage *image);
13int kimage_is_destination_range(struct kimage *image,
14 unsigned long start, unsigned long end);
15
Pavel Tatashinde68e4d2019-12-04 10:59:15 -050016int machine_kexec_post_load(struct kimage *image);
17
Dave Younga43cac02015-09-09 15:38:51 -070018extern struct mutex kexec_mutex;
19
20#ifdef CONFIG_KEXEC_FILE
Thomas Gleixner40c50c12017-03-10 13:17:18 +010021#include <linux/purgatory.h>
Dave Younga43cac02015-09-09 15:38:51 -070022void kimage_file_post_load_cleanup(struct kimage *image);
Kees Cooke2ae8ab2017-07-12 14:35:58 -070023extern char kexec_purgatory[];
24extern size_t kexec_purgatory_size;
Dave Younga43cac02015-09-09 15:38:51 -070025#else /* CONFIG_KEXEC_FILE */
26static inline void kimage_file_post_load_cleanup(struct kimage *image) { }
27#endif /* CONFIG_KEXEC_FILE */
28#endif /* LINUX_KEXEC_INTERNAL_H */