public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix relocation problem with "new" get_dev() function
Date: Tue, 20 Feb 2007 13:31:23 +0100	[thread overview]
Message-ID: <200702201331.23496.sr@denx.de> (raw)

This patch enables the "new" get_dev() function for block devices
introduced by Grant Likely to be used on systems that still suffer
from the relocation problems (manual relocation neede because of
problems with linker script).

Hopefully we can resolve this relocation issue soon for all platform
so we don't need this additional code anymore.

Signed-off-by: Stefan Roese <sr@denx.de>

---
commit 751bb57107d78978ae08e697c3deba816f5be091
tree 07d9ef94782dadb04203d8f46dd08da5d08a2aa7
parent d93e2212f962668b3dce091ff5edc33f2347fe37
author Stefan Roese <sr@denx.de> Tue, 20 Feb 2007 13:21:57 +0100
committer Stefan Roese <sr@denx.de> Tue, 20 Feb 2007 13:21:57 +0100

 disk/part.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index f1026c5..37bba77 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -64,13 +64,25 @@ static const struct block_drvr block_drvr[] = {
 	{ },
 };
 
+#ifndef CFG_FIXUP_RELOCATION
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 block_dev_desc_t *get_dev(char* ifname, int dev)
 {
 	const struct block_drvr *drvr = block_drvr;
 
 	while (drvr->name) {
+#ifndef CFG_FIXUP_RELOCATION
+		block_dev_desc_t* (*reloc_get_dev)(int dev);
+
+		reloc_get_dev = drvr->get_dev + gd->reloc_off;
+		if (strncmp(ifname, drvr->name, strlen(drvr->name)) == 0)
+			return reloc_get_dev(dev);
+#else
 		if (strncmp(ifname, drvr->name, strlen(drvr->name)) == 0)
 			return drvr->get_dev(dev);
+#endif
 		drvr++;
 	}
 	return NULL;

             reply	other threads:[~2007-02-20 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-20 12:31 Stefan Roese [this message]
2007-02-21 17:01 ` [U-Boot-Users] [PATCH] Fix relocation problem with "new" get_dev() function Grant Likely
2007-02-21 20:07   ` Stefan Roese
2007-02-21 20:20     ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2007-02-22  7:45 [U-Boot-Users] [PATCH] Fix relocation problem with "new"get_dev() function TXEMA LOPEZ

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=200702201331.23496.sr@denx.de \
    --to=sr@denx.de \
    --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