This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: HAL_DCACHE_xxx macros in mpc8xx HAL


On Wed, Dec 11, 2002 at 07:19:00AM -0700, Gary Thomas wrote:
> This seems reasonable to me, although I would prefer the style of
> the macro we have:
>   * The computations of "base_addr", etc, are explicit (not in the for)
>   * Use names which start with "_" to lessen namespace pollution.
> 

is this acceptable?

#define HAL_DCACHE_FLUSH( _base_ , _size_ )                                  \
    CYG_MACRO_START                                                          \
    register int _base_addr = (~(HAL_DCACHE_LINE_SIZE - 1)) & (int)(_base_); \
    register int _end_addr = (int)(_base_) + (_size_);                       \
    for ( ; _base_addr < _end_addr ; _base_addr += HAL_DCACHE_LINE_SIZE )    \
    {                                                                        \
        asm volatile ("dcbf 0,%0;sync;" : : "r" (_base_addr));               \
    }                                                                        \
    CYG_MACRO_END

-- 


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The information contained in this e-mail and its attachments is confidential 
and may be privileged or protected from disclosure.If you are not the intended 
recipient or have received it in error,please notify the sender and delete it 
without delay. Any unauthorized copy, disclosure, distribution or use in any 
way of the information contained in it or its attachments is strictly
prohibited. Completeness of the message can not be ensured as it has been 
transmitted over public networks.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]