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, 2002-12-11 at 07:37, Christoph Csebits wrote:
> 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?

Yes.

> 
> #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

-- 
------------------------------------------------------------
Gary Thomas                       |
eCosCentric, Ltd.                 |  
+1 (970) 229-1963                 |  eCos & RedBoot experts
http://www.ecoscentric.com/       |
email: <gthomas@ecoscentric.com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


-- 
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]