From: Magnus Damm <magnus.damm@gmail.com>
To: kexec@lists.infradead.org
Cc: horms@verge.net.au, Magnus Damm <magnus.damm@gmail.com>
Subject: [PATCH 05/06] sh: Use dynamic zImage load address
Date: Tue, 26 Aug 2008 20:12:25 +0900 [thread overview]
Message-ID: <20080826111225.615.32479.sendpatchset@rx1.opensource.se> (raw)
In-Reply-To: <20080826111150.615.97501.sendpatchset@rx1.opensource.se>
From: Magnus Damm <damm@igel.co.jp>
Dynamically calculate SuperH zImage load address instead of hardcoding.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
kexec/arch/sh/kexec-zImage-sh.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- 0005/kexec/arch/sh/kexec-zImage-sh.c
+++ work/kexec/arch/sh/kexec-zImage-sh.c 2008-08-22 13:04:13.000000000 +0900
@@ -79,7 +79,8 @@ int zImage_sh_load(int argc, char **argv
{
char *command_line;
int opt, k;
- unsigned long empty_zero, area, zero_page_base, zero_page_size;
+ unsigned long empty_zero, zero_page_base, zero_page_size;
+ unsigned long image_base;
char *param;
static const struct option options[] = {
@@ -137,8 +138,12 @@ int zImage_sh_load(int argc, char **argv
add_segment(info, param, zero_page_size,
0x80000000 | zero_page_base, zero_page_size);
- area = empty_zero & 0x1c000000;
- add_segment(info, buf, len, (area | 0x80210000), len);
- info->entry = (void *)(0x80210000 | area);
+ /* load image a bit above the zero page, round up to 64k
+ * the zImage will relocate itself, but only up seems supported.
+ */
+
+ image_base = (empty_zero + (0x10000 - 1)) & ~(0x10000 - 1);
+ add_segment(info, buf, len, image_base, len);
+ info->entry = (void *)image_base;
return 0;
}
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2008-08-26 11:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-26 11:11 [PATCH 00/06] sh: Improved kexec support for SuperH Magnus Damm
2008-08-26 11:11 ` [PATCH 01/06] sh: Add support for sh4al-dsp processors Magnus Damm
2008-08-26 11:12 ` [PATCH 02/06] sh: Get system memory ranges from /proc/iomem Magnus Damm
2008-08-26 11:12 ` [PATCH 03/06] sh: Add virtual addresses support Magnus Damm
2008-08-26 11:12 ` [PATCH 04/06] sh: Autodetect zImage zero page address Magnus Damm
2008-08-26 11:12 ` Magnus Damm [this message]
2008-08-26 11:12 ` [PATCH 06/06] sh: Add vmlinux support Magnus Damm
2008-08-27 2:39 ` Simon Horman
2008-08-27 4:10 ` Magnus Damm
2008-08-27 5:40 ` Simon Horman
2008-08-27 6:55 ` Magnus Damm
2008-08-27 7:35 ` Simon Horman
2008-08-27 7:05 ` [PATCH 00/06] sh: Improved kexec support for SuperH Paul Mundt
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=20080826111225.615.32479.sendpatchset@rx1.opensource.se \
--to=magnus.damm@gmail.com \
--cc=horms@verge.net.au \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.