Subject: Re: mfdcr/mtdcr
To: Jachym Holecek <freza@dspfpga.com>
From: Matt Thomas <matt@3am-software.com>
List: port-powerpc
Date: 05/10/2006 10:48:53
Jachym Holecek wrote:
> # Matt Thomas 2006-05-10:
>> Jachym Holecek wrote:
>>> I'd like to move mfdcr()/mtdcr() macro definitions into a separate file.
>>> Motivation:
>>>
>>>   * Currently, they're defined multiple times in include/ibm4xx/dcr40*.h
>>>
>>>   * For evbppc/virtex, I'd like to be able to access DCR without
>>>     also pulling in irrelevant address definitions (DCR address
>>>     layout is completely up to the HDL designer)
>>>
>>> The diff below (relative to arch/powerpc/include/ibm4xx) creates dcr.h
>>> and makes dcr40*.h use it. Other option would be to move the macros to
>>> ibm4xx/cpu.h (the m{f,t}dcr instructions are 4xx specific).
>>>
>>> Does it sound OK? If so, anyone wants to commit? ;-)
>> They should be static inline, not gcc macros.
> 
> Will this work given that the address parameter _needs_ to be a
> compile-time constant? (it's encoded as immediate operand)

Yes.

-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.