public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] hi, I could not understand the memsize.c, somebody help  me?
Date: Tue, 30 Jun 2009 15:50:35 +0200	[thread overview]
Message-ID: <m2d48lzv84.fsf@ohwell.denx.de> (raw)
In-Reply-To: <2ae8403e0906291953u5aeed2b1h32a983d4fc22dda6@mail.gmail.com> (iamaplayer@gmail.com's message of "Tue, 30 Jun 2009 10:53:21 +0800")

Hi,

> Thanks for your patient explanation, I acquired a lot.

Glad if it helped.

> I just find in linux, arch/mips/bcm47xx/prom.c, there is a segment code just
> like what I suggest above.
> And move the code to my old box which bootloader is redboot, it works well. (Of
> course I also tryed memsize.c)so...

Wow, you're right.  To be honest, I do not understand the code, nor do I
know why it should work.

Already in the first pointer arithmetic "mem" is obviously interpreted
as sizeof(unsigned long) bytes and not in bytes as the constants
suggest.  Moreover they reference memory based on the address of a
function and compare it to something dereferenced immediately
afterwards - not taking "sticky values" on the bus into account.  I
don't even know why the dereferences should be similar at all as no
known values are there - at least I don't see that.

Not understanding how or why this code should work, I would not dare to
reuse it.

> I'm lucky to have my new box which bootloader is u-boot =D

Yes you are :)

Cheers
  Detlev

-- 
I talk to planets baby
                                       -- Dave Wyndorf (Monstermagnet)
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

  reply	other threads:[~2009-06-30 13:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25  3:14 [U-Boot] hi, I could not understand the memsize.c, somebody help me? IaMaPlAyEr
2009-06-25 12:56 ` Detlev Zundel
2009-06-29  8:54   ` IaMaPlAyEr
2009-06-29 11:54     ` Detlev Zundel
2009-06-30  2:53       ` IaMaPlAyEr
2009-06-30 13:50         ` Detlev Zundel [this message]
2009-07-24  6:11 ` Wolfgang Denk
2009-07-24 14:31   ` Aggrwal Poonam-B10812
2009-07-24 15:13     ` Detlev Zundel
2009-07-24 15:21     ` Kenneth Johansson

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=m2d48lzv84.fsf@ohwell.denx.de \
    --to=dzu@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