[PATCH 2/6] mips: use arch_options for both 32 and 64 bit variants
Marcin Nowakowski
marcin.nowakowski at imgtec.com
Fri Dec 2 01:49:07 PST 2016
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 at imgtec.com>
---
kexec/arch/mips/crashdump-mips.c | 7 ++-----
kexec/arch/mips/kexec-mips.c | 8 +++++---
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index dc68cb4..e56b3ef 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 ebc3d9a..de9019a 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)
{
--
2.7.4
More information about the kexec
mailing list