From: David Edelsohn <[email-masked]>
Date: Sat, 13 Feb 1999 19:12:15 -0500

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

	If you know the physical location or can control 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).

	Are all of those "sync" instructions necessary in your code?  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

David

[[ 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 [email-masked] ]]