diff options
author | Marcin Nowakowski <marcin.nowakowski@imgtec.com> | 2016-11-23 08:43:51 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-01-03 10:34:46 -0500 |
commit | 856b0f591e951a234d6642cc466023df182eb51c (patch) | |
tree | a7b54af7b77f0f6c8df7412c340cc24cd0726816 | |
parent | a8f108d70c74d83574c157648383eb2e4285a190 (diff) |
MIPS: kexec: add debug info about the new kexec'ed image
Print details of the new kexec image loaded.
Based on the original code from
commit 221f2c770e10d ("arm64/kexec: Add pr_debug output")
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14614/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/machine_kexec.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c index 59725204105c..8b574bcd39ba 100644 --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c | |||
@@ -28,9 +28,31 @@ atomic_t kexec_ready_to_reboot = ATOMIC_INIT(0); | |||
28 | void (*_crash_smp_send_stop)(void) = NULL; | 28 | void (*_crash_smp_send_stop)(void) = NULL; |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | static void kexec_image_info(const struct kimage *kimage) | ||
32 | { | ||
33 | unsigned long i; | ||
34 | |||
35 | pr_debug("kexec kimage info:\n"); | ||
36 | pr_debug(" type: %d\n", kimage->type); | ||
37 | pr_debug(" start: %lx\n", kimage->start); | ||
38 | pr_debug(" head: %lx\n", kimage->head); | ||
39 | pr_debug(" nr_segments: %lu\n", kimage->nr_segments); | ||
40 | |||
41 | for (i = 0; i < kimage->nr_segments; i++) { | ||
42 | pr_debug(" segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages\n", | ||
43 | i, | ||
44 | kimage->segment[i].mem, | ||
45 | kimage->segment[i].mem + kimage->segment[i].memsz, | ||
46 | (unsigned long)kimage->segment[i].memsz, | ||
47 | (unsigned long)kimage->segment[i].memsz / PAGE_SIZE); | ||
48 | } | ||
49 | } | ||
50 | |||
31 | int | 51 | int |
32 | machine_kexec_prepare(struct kimage *kimage) | 52 | machine_kexec_prepare(struct kimage *kimage) |
33 | { | 53 | { |
54 | kexec_image_info(kimage); | ||
55 | |||
34 | if (_machine_kexec_prepare) | 56 | if (_machine_kexec_prepare) |
35 | return _machine_kexec_prepare(kimage); | 57 | return _machine_kexec_prepare(kimage); |
36 | return 0; | 58 | return 0; |