diff options
author | Magnus Damm <magnus@valinux.co.jp> | 2006-11-17 19:56:35 +0900 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-11-27 12:25:12 +0900 |
commit | 93bd94e000e78e81982d03db0e1ce54a54dad859 (patch) | |
tree | b973dbc25af2758428be69a94b3e8ae738156997 /kexec/crashdump.c | |
parent | 920a98d04e4f97d0799a8e924e03a8a9721973aa (diff) |
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 <magnus@valinux.co.jp>
Removed trainling whitespace
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/crashdump.c')
-rw-r--r-- | kexec/crashdump.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 <sys/stat.h> #include <unistd.h> #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 |