diff options
author | Magnus Damm <magnus@valinux.co.jp> | 2006-11-22 00:01:47 +0900 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-11-27 12:25:12 +0900 |
commit | c80198e78ce26783e092645b9ac8587e1374f22f (patch) | |
tree | 5ca85a6bb221c09d6855eb4a6ad4fb04c5e0cc01 /kexec/crashdump.h | |
parent | f8b0123231e9ca2cb124aa290b9df7785ff135e0 (diff) |
kexec-tools: Introduce crashdump-elf.c and crash_create_elf32/64_headers() V2
kexec-tools: Introduce crashdump-elf.c and crash_create_elf32/64_headers() V2
This patch adds the new file crashdump-elf.c that implements a single generic
function which is used to create elf headers. The file gets included twice by
crash.c to create two functions from the same source. These two functions are
named crash_create_elf32_headers() and crash_create_elf64_headers().
The new code differs from prepare_crash_memory_elf32/64_headers() in the sense
that both allocation and setup now are done in the same function.
This patch only adds the new code, following patches make sure the different
architecture-specific files make use of the new code.
This version contains a new comment as suggested by Vivek, together with
that the alignment now is fixed at 1024 regardless of architecture. The cpu
elf note callback code has been slightly reworked to become cleaner. Also,
FUNCTION has been renamed to FUNC.
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.h')
-rw-r--r-- | kexec/crashdump.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/kexec/crashdump.h b/kexec/crashdump.h index dd3c317..4dbecf8 100644 --- a/kexec/crashdump.h +++ b/kexec/crashdump.h @@ -8,4 +8,30 @@ extern int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len); /* Expecting ELF headers to fit in 4K. Increase it if you need more. */ #define KCORE_ELF_HEADERS_SIZE 4096 +/* structure passed to crash_create_elf32/64_headers() */ + +struct crash_elf_info { + unsigned long class; + unsigned long data; + unsigned long machine; + + unsigned long backup_src_start; + unsigned long backup_src_end; + + unsigned long page_offset; + unsigned long lowmem_limit; + + int (*get_note_info)(int cpu, uint64_t *addr, uint64_t *len); +}; + +int crash_create_elf32_headers(struct kexec_info *info, + struct crash_elf_info *elf_info, + struct memory_range *range, int ranges, + void **buf, unsigned long *size); + +int crash_create_elf64_headers(struct kexec_info *info, + struct crash_elf_info *elf_info, + struct memory_range *range, int ranges, + void **buf, unsigned long *size); + #endif /* CRASHDUMP_H */ |