summaryrefslogtreecommitdiffstats
path: root/include/linux/kexec.h
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>2016-11-29 07:45:47 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-30 07:14:57 -0500
commit60fe3910bb029e3671ce7ac080a7acb7e032b9e0 (patch)
tree89bd58b4985af7713e59f34933c11a450b1677fa /include/linux/kexec.h
parent0ab5171b8971282d7562b77f9b14137a827117fc (diff)
kexec_file: Allow arch-specific memory walking for kexec_add_buffer
Allow architectures to specify a different memory walking function for kexec_add_buffer. x86 uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> Acked-by: Dave Young <dyoung@redhat.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'include/linux/kexec.h')
-rw-r--r--include/linux/kexec.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 406c33dcae13..5e320ddaaa82 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -148,7 +148,34 @@ struct kexec_file_ops {
148 kexec_verify_sig_t *verify_sig; 148 kexec_verify_sig_t *verify_sig;
149#endif 149#endif
150}; 150};
151#endif 151
152/**
153 * struct kexec_buf - parameters for finding a place for a buffer in memory
154 * @image: kexec image in which memory to search.
155 * @buffer: Contents which will be copied to the allocated memory.
156 * @bufsz: Size of @buffer.
157 * @mem: On return will have address of the buffer in memory.
158 * @memsz: Size for the buffer in memory.
159 * @buf_align: Minimum alignment needed.
160 * @buf_min: The buffer can't be placed below this address.
161 * @buf_max: The buffer can't be placed above this address.
162 * @top_down: Allocate from top of memory.
163 */
164struct kexec_buf {
165 struct kimage *image;
166 char *buffer;
167 unsigned long bufsz;
168 unsigned long mem;
169 unsigned long memsz;
170 unsigned long buf_align;
171 unsigned long buf_min;
172 unsigned long buf_max;
173 bool top_down;
174};
175
176int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf,
177 int (*func)(u64, u64, void *));
178#endif /* CONFIG_KEXEC_FILE */
152 179
153struct kimage { 180struct kimage {
154 kimage_entry_t head; 181 kimage_entry_t head;