From 93bd94e000e78e81982d03db0e1ce54a54dad859 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 17 Nov 2006 19:56:35 +0900 Subject: kexec-tools: Add length parameter to get_crash_notes_per_cpu() kexec-tools: Add length parameter to get_crash_notes_per_cpu() Let get_crash_notes_per_cpu() pass both physical base address and length. Under Xen we export this information from the hypervisor, and it would be a nice improvement for the kernel to actually export the size too. So let's change the framework to use both base address and length. Signed-off-by: Magnus Damm Removed trainling whitespace Signed-off-by: Simon Horman --- kexec/crashdump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kexec/crashdump.c') diff --git a/kexec/crashdump.c b/kexec/crashdump.c index e987b16..0c10cf8 100644 --- a/kexec/crashdump.c +++ b/kexec/crashdump.c @@ -26,9 +26,10 @@ #include #include #include "kexec.h" +#include "crashdump.h" /* Returns the physical address of start of crash notes buffer for a cpu. */ -int get_crash_notes_per_cpu(int cpu, uint64_t *addr) +int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len) { char crash_notes[PATH_MAX]; char line[MAX_LINE]; @@ -40,6 +41,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr) int stat_errno; *addr = 0; + *len = 0; sprintf(crash_notes, "/sys/devices/system/cpu/cpu%d/crash_notes", cpu); fp = fopen(crash_notes, "r"); @@ -68,6 +70,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr) if (count != 1) die("Cannot parse %s: %s\n", crash_notes, strerror(errno)); *addr = (uint64_t) temp; + *len = MAX_NOTE_BYTES; /* we should get this from the kernel instead */ #if 0 printf("crash_notes addr = %Lx\n", *addr); #endif -- cgit