diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2006-09-21 14:51:44 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-10-06 12:46:16 +0900 |
commit | 103c946e39eb9dd57ccbda20ac12ccb01f883c17 (patch) | |
tree | 439847d98ca015f0675690fd61cb3a16dd1c7216 /kexec/kexec.h | |
parent | f11123aa03a7e8bfee165a56f7f1f6d8baa1d163 (diff) |
kexec-tools: x86_64 read kernel vaddr and size from /proc/kcore
o With relocatable kernel in picture, the kernel text map offset
(__START_KERNEL_map) is no longer constant. It depends on where kernel
is loaded.
o Now /proc/kcore is read to determine the virtual address the kernel
is mapped at and /porc/iomem is read for determining the physical
address where kernel is loaded at. This information is enough to
create to fill virtual address and phy addr info for elf header
mapping kernel text and data.
o Virtual address for kernel text are needed by gdb as well as crash to
retrieve the meaningful data from core file.
o This patch requires "elf note memsz" fix in the kernel. Currently
that fix is in -mm tree. It will still work with older kernels. It will
display the warning messages (/proc/kcore could not be parsed) and hardcode
the kernel virtual address and size.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/kexec.h')
-rw-r--r-- | kexec/kexec.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kexec/kexec.h b/kexec/kexec.h index 57fca7d..1cee900 100644 --- a/kexec/kexec.h +++ b/kexec/kexec.h @@ -116,6 +116,9 @@ struct kexec_info { struct mem_ehdr rhdr; unsigned long backup_start; unsigned long kexec_flags; + unsigned long kern_vaddr_start; + unsigned long kern_paddr_start; + unsigned long kern_size; }; void usage(void); @@ -177,6 +180,7 @@ extern void die(char *fmt, ...); extern void *xmalloc(size_t size); extern void *xrealloc(void *ptr, size_t size); extern char *slurp_file(const char *filename, off_t *r_size); +extern char *slurp_file_len(const char *filename, off_t size); extern char *slurp_decompress_file(const char *filename, off_t *r_size); extern void add_segment(struct kexec_info *info, const void *buf, size_t bufsz, unsigned long base, size_t memsz); |