Optimiser and memory mapped I/O

Peter Barada pbarada@mail.wm.sps.mot.com
Thu Sep 25 17:03:00 GMT 2003


>which it would be if 0xfe8001 and 0xfe8003 were normal memory locations. 
>The problem is, they aren't; they are I/O maps. Write to 0xfe8001 is 
>used for register select, and 0xfe8003 gets the actual value of the 
>register. Any ways around this (besides not optimising at all)?

Use 'volatile':

  *(volatile char *)0xfe8001= 0x4;       /* call msg at level4 */
  *(volatile char *)0xfe8003= 0x6;       /* generate vector, edge interrupt */

  *(volatile char *)0xfe8001= 0x6;       /* timer interrupt level 6 */
  *(volatile char *)0xfe8003= 0x0;       /* level interrupt */

  *(volatile char *)0xfe8001= 0x2;       /* parallel interrupt level 2 */
  *(volatile char *)0xfe8003= 0x2;       /* edge interrupt */

  *(volatile char *)0xfe8005= 0x18;      /* vectors $18, $19, .. $1F */

  *(volatile char *)0xfe8007= 0xff;      /* enable all interupts */

-- 
Peter Barada                             Peter.Barada@motorola.com
Wizard                                   781-852-2768 (direct)
WaveMark Solutions(A Motorola Company)   781-270-0193 (fax)

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



More information about the crossgcc mailing list