This is the mail archive of the ecos-discuss@sourceware.org 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: Some simple questitions


On Mon, Sep 04, 2006 at 07:22:46AM +0000, bob.koninckx@o-3s.com wrote:
> >2. Can I have direct access to processor's registers from my user
> >application? Linux has "mmap()" function for that purpose.
> 
> eCos does not make the distinction between user and kernel space. Since everything runs in the same address space, you can do something like
> 
> volatile cyg_uint32 * some_register = 0x12345678;
> 
> Or use the HAL_WRITE and HAL_READ macros.

Using the HAL macros is the correcet way to do it. It ensures all the
volatiles are in the right place and any compiler reordering barriers
which are needed do get inserted.

      Andrew

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


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