summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Nowakowski <marcin.nowakowski@imgtec.com>2016-12-02 10:49:07 +0100
committerSimon Horman <horms@verge.net.au>2016-12-09 08:56:11 +0100
commitb5f715e98eac3025273d64685b511a97f817100b (patch)
tree25aa0f9a8c3dae6b90027dd87527dbcfb289ff42
parent641a18e344c6d98e7c9d441f9b6f9bb10a6e1144 (diff)
downloadkexec-tools-b5f715e98eac3025273d64685b511a97f817100b.tar.gz
mips: use arch_options for both 32 and 64 bit variants
At the moment arch_options structure is defined for 64-bit only and is used exclusively in ifdef'ed code. Remove the ifdefs around the uses of the structure and define it for all code variants as it will be used for passing more arch options in the followup commits. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/mips/crashdump-mips.c7
-rw-r--r--kexec/arch/mips/kexec-mips.c8
2 files changed, 7 insertions, 8 deletions
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index dc68cb43..e56b3ef6 100644
--- a/kexec/arch/mips/crashdump-mips.c
+++ b/kexec/arch/mips/crashdump-mips.c
@@ -288,7 +288,6 @@ static int cmdline_add_elfcorehdr(char *cmdline, unsigned long addr)
return 0;
}
-#ifdef __mips64
static struct crash_elf_info elf_info64 = {
class: ELFCLASS64,
data : ELFDATA2MSB,
@@ -296,7 +295,7 @@ static struct crash_elf_info elf_info64 = {
page_offset : PAGE_OFFSET,
lowmem_limit : MAXMEM,
};
-#endif
+
static struct crash_elf_info elf_info32 = {
class: ELFCLASS32,
data : ELFDATA2MSB,
@@ -321,13 +320,11 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
struct crash_elf_info *elf_info = &elf_info32;
unsigned long start_offset = 0x80000000UL;
-#ifdef __mips64
if (arch_options.core_header_type == CORE_TYPE_ELF64) {
elf_info = &elf_info64;
crash_create = crash_create_elf64_headers;
- start_offset = 0xffffffff80000000UL;
+ start_offset = (unsigned long)0xffffffff80000000UL;
}
-#endif
if (get_kernel_paddr(elf_info))
return -1;
diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
index ebc3d9a2..de9019a9 100644
--- a/kexec/arch/mips/kexec-mips.c
+++ b/kexec/arch/mips/kexec-mips.c
@@ -76,11 +76,13 @@ void arch_usage(void)
{
}
-#ifdef __mips64
struct arch_options_t arch_options = {
- .core_header_type = CORE_TYPE_ELF64
-};
+#ifdef __mips64
+ .core_header_type = CORE_TYPE_ELF64,
+#else
+ .core_header_type = CORE_TYPE_ELF32,
#endif
+};
int arch_process_options(int argc, char **argv)
{