This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

Re: Direct I/O reads/writes from C programs (volatile)


At 11:45 AM 3/17/99 -0800, you wrote:
>>
>>As far as memory mapped I/O, there have been some recent posts here on that
>>subject, but one possibility is something like this:
>>
>>unsigned char * addr = (unsigned char *) 0x12345678;
>>unsigned char ch;

>It might be a good idea to declare addr as pointing to a volatile to
>avoid undesired compiler optimization.
>
>i.e.:
>volatile unsigned char * addr = (unsigned char *) 0x12345678;

I've been working on getting some start up code written, and I noticed that
adding volatile will force the compiler to use an automatic.  (I was using
register) I ended up coding several sections as in line assembler. (Hadn't
checked the RAM yet, so no stack to create automatics on.)

Wynn

_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.