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

See the CrossGCC FAQ for lots more information.


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: Optimiser and memory mapped I/O



>> I've never actually used "volatile" before, so perhaps it was about
   time to start...

We tend to make a typedef like this:

   typedef volatile unsigned char  ASIC_REG_U8;
   typedef volatile unsigned short ASIC_REG_U16;
   typedef volatile unsigned long  ASIC_REG_U32;

We us them like this:
     
     *((ASIC_REG_U8 *)(0x1234)) = 0x12;
or:
     extern ASIC_REG_U8 uart_status_register;

-Duane.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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