From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH 02/19] relocation: fixup cmdtable
Date: Fri, 30 Jul 2010 09:46:16 -0500 [thread overview]
Message-ID: <1280501176.19222.208.camel@petert> (raw)
In-Reply-To: <4C526A6E.7080503@denx.de>
On Fri, 2010-07-30 at 08:00 +0200, Heiko Schocher wrote:
> Hello Peter,
>
> Peter Tyser wrote:
> >> +#if !defined(CONFIG_RELOC_FIXUP_WORKS)
> >> +DECLARE_GLOBAL_DATA_PTR;
> >> +
> >> +void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
> >> +{
> >> + int i;
> >> +
> >> + if (gd->reloc_off == 0)
> >> + return;
> >> +
> >> + for (i = 0; i < size; i++) {
> >> + ulong addr;
> >> +
> >> + addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
> >> + cmdtp->cmd =
> >> + (int (*)(struct cmd_tbl_s *, int, int, char * const []))addr;
> >> + addr = (ulong)(cmdtp->name) + gd->reloc_off;
> >> + cmdtp->name = (char *)addr;
> >> + if (cmdtp->usage) {
> >> + addr = (ulong)(cmdtp->usage) + gd->reloc_off;
> >> + cmdtp->usage = (char *)addr;
> >> + }
> >> +#ifdef CONFIG_SYS_LONGHELP
> >> + if (cmdtp->help) {
> >> + addr = (ulong)(cmdtp->help) + gd->reloc_off;
> >> + cmdtp->help = (char *)addr;
> >> + }
> >> +#endif
> >> + cmdtp++;
> >> + }
> >> +}
> >
> > A number of other arches have this same logic in arch-specific code, eg
> > arch/mips/lib/board.c. Could you also convert them to use the new
> > fixup_cmdtable() in this patch?
>
> Ah, Ok, I can try it. This will then result, that this patch can go
> direct to mainline, right?
Yes, I'd think this patch would be accepted regardless of the other ARM
relocation changes as its a general improvement.
> As I see in the code, this should be possible for the following
> architectures:
>
> avr32
> m68k
> mips
I believe sparc should also be included.
Best,
Peter
next prev parent reply other threads:[~2010-07-30 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-29 10:44 [U-Boot] [RFC][PATCH 02/19] relocation: fixup cmdtable Heiko Schocher
2010-07-29 15:38 ` Peter Tyser
2010-07-30 6:00 ` Heiko Schocher
2010-07-30 14:46 ` Peter Tyser [this message]
2010-08-03 10:15 ` [U-Boot] [RFC][PATCH v2 " Heiko Schocher
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=1280501176.19222.208.camel@petert \
--to=ptyser@xes-inc.com \
--cc=u-boot@lists.denx.de \
/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