This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Some simple questitions
- From: Andrew Lunn <andrew at lunn dot ch>
- To: bob dot koninckx at o-3s dot com
- Cc: Dmitry Varakin <dvarakin at gmail dot com>, ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 4 Sep 2006 10:17:58 +0200
- Subject: Re: [ECOS] Some simple questitions
- References: <W5396921528264021157354566@webmail24>
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