From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
To: kexec@lists.infradead.org
Subject: [PATCH 2/6] mips: use arch_options for both 32 and 64 bit variants
Date: Fri, 2 Dec 2016 10:49:07 +0100 [thread overview]
Message-ID: <1480672151-18503-3-git-send-email-marcin.nowakowski@imgtec.com> (raw)
In-Reply-To: <1480672151-18503-1-git-send-email-marcin.nowakowski@imgtec.com>
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>
---
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
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2016-12-02 9:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 9:49 [PATCH 0/6] Kexec fixes and updates for MIPS platforms Marcin Nowakowski
2016-12-02 9:49 ` [PATCH 1/6] mips: remove incorrect arch_usage string Marcin Nowakowski
2016-12-02 9:49 ` Marcin Nowakowski [this message]
2016-12-02 9:49 ` [PATCH 3/6] mips: move arch option parsing from elf loader to common arch code Marcin Nowakowski
2016-12-02 9:49 ` [PATCH 4/6] mips: crashdump: add little-endian support Marcin Nowakowski
2016-12-02 9:49 ` [PATCH 5/6] mips: add dtb loading support Marcin Nowakowski
2016-12-02 9:49 ` [PATCH 6/6] mips: add option to load initrd from a specified file Marcin Nowakowski
2016-12-09 7:57 ` [PATCH 0/6] Kexec fixes and updates for MIPS platforms Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480672151-18503-3-git-send-email-marcin.nowakowski@imgtec.com \
--to=marcin.nowakowski@imgtec.com \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox