All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Mips: start.S Questions
Date: Fri, 21 Aug 2009 15:42:50 +0200	[thread overview]
Message-ID: <m2fxbl8eqt.fsf@ohwell.denx.de> (raw)
In-Reply-To: <574bb010908210608h3e77eb4fj5f510754eb2333be@mail.gmail.com> (Peter Belm's message of "Fri, 21 Aug 2009 14:08:03 +0100")

Hi Peter,

>     Why should it? ?I presume the CPU starts at _start, so it will "b
>     reset", i.e. branch (jump) to "reset" and be happy. ?Its only if the CPU
>     jumps to one the reserved vectors that it will loop. ?And well, as they
>     are reserved, this is a legal thing to do, no? ?As the purple port
>     works, I'm pretty sure they do not usually get jumped to there ;)
>
>
> I knew I must be missing something, I didn't see that the reset definition
> comes straight under all the other vector calls, so _start just runs through
> all the vectors if for some reason reset returns (twice) and would get trapped
> because of RVECENT(romReserved,2).

It seems to me that you may still be missing the point that a "b reset"
is an unconditional jump, not a call, i.e. we will never return to the
next instruction.  A call would be a "bal reset", i.e. "branch and link"
which puts the address of the next instruction into the $ra register.
One would return with "jr $ra".

As I'm not really into MIPS, please don't ask me why MIPS has branch
*and* jump mnemonics - I don't see how they designate different
concepts.

Cheers
  Detlev

-- 
Q: What is a compact city?
A: It's a city that can be guarded by finitely many near-sighted
   policemen.
--
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-08-21 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21 11:34 [U-Boot] Mips: start.S Questions Peter Belm
2009-08-21 12:40 ` Detlev Zundel
2009-08-21 12:53   ` Peter Belm
2009-08-21 13:02     ` Detlev Zundel
2009-08-21 13:08       ` Peter Belm
2009-08-21 13:42         ` Detlev Zundel [this message]
2009-08-21 13:46           ` Peter Belm
2009-08-21 13:05     ` Chetan Nanda

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=m2fxbl8eqt.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 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.