linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <bh40@calva.net>
To: David Edelsohn <dje@watson.ibm.com>, linuxppc-dev@lists.linuxppc.org
Subject: bootstrap stuffs
Date: Sun, 14 Feb 1999 15:02:35 +0100	[thread overview]
Message-ID: <19990214150235.030449@smtp.calvacom.fr> (raw)


On Sat, Feb 13, 1999, David Edelsohn <dje@watson.ibm.com> wrote:

Thanks for your reply !

>	Just to make sure, you are not asking how to create XCOFF
>TOC-based code using GCC?

Not really, I already have CodeWarrior and MrC for that ;-)

>	If you know the physical location or can cotrol the physical
>location at which the code will be loaded, you simply can instruct the
>linker to link the executable based at that location.  Otherwise, you
>might need additional -fpic position independent code option.  If you need
>data and cannot set the GPR specifying the GOT address yourself, you can
>use the GCC SVR4 eABI PPC suppport to calculate it on entry as it does for
>embedded systems.  Note that branches generated by GCC already are
>position-independent displacements (not "ba" branch absolute instruction).

I don't know the physical location. The experiments I did yesterday with
various options showed me that the generated branches are bl's except in
some case (the linker-generated branches between .o files were sometimes
ba, but I probably missed an ld option).

So if I understand correctly, I must use -fpic to generate position
independant code. I beleive I must also indicate that this is static code
(no dynamic link). The GOT is a TOC-like register that's it ? I could
probably put a correct value in it if I knew how to find it from the
loader. Do you know which options I should use for CFLAGS and LDFLAGS to
get the result you mentioned ? (GOT calculated on entry).


>	Are all of those "sync" instructions necessary in your code?

Just paranoid. They were added around the interrupt switching to make
sure to sync an eventual second processor and everything else before
switching the MMU off. I beleive that for disabling the MMU, andi. is
probably more efficient than my ori/andc pair, could you just explain my
why you added &0xffff at it ?

>You are not touching memory.  The instructions already are serializing.  I
>think that you should be able to do something like:
>
>enable:
>        mfmsr   r0
>        ori     r0,r0,MSR_EE
>        mtmsr   r0
>
>disable:
>        mfmsr   r0
>        andi.   r0,r0,(~MSR_EE)&0xffff
>        mtmsr   r0
>


-- 
           E-Mail: <mailto:bh40@calva.net>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>




[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

             reply	other threads:[~1999-02-14 14:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-14 14:02 Benjamin Herrenschmidt [this message]
1999-02-14 17:03 ` bootstrap stuffs David Edelsohn
1999-02-14 18:58   ` Benjamin Herrenschmidt
1999-02-15 17:57     ` David Edelsohn
1999-02-15 18:20       ` Benjamin Herrenschmidt
1999-02-16  0:02       ` Paul Mackerras
1999-02-16 11:24         ` Gabriel Paubert
1999-02-16 11:44       ` Gabriel Paubert
1999-02-16 16:43         ` Geert Uytterhoeven
1999-02-16 17:39           ` Gabriel Paubert
1999-02-16 18:11             ` Benjamin Herrenschmidt
1999-02-17  6:23               ` Cort Dougan
     [not found] <19990216134514.022163@mail.mipsys.com>
1999-02-16 13:18 ` Gabriel Paubert

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=19990214150235.030449@smtp.calvacom.fr \
    --to=bh40@calva.net \
    --cc=dje@watson.ibm.com \
    --cc=linuxppc-dev@lists.linuxppc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).