Cross gcc Mailing List Archive

[Prev][Next][Index][Thread]

volital registers



This is what I have now

#define SCSR (*(unsigned short *)0xfffC0C)
#define SCDR (*(unsigned short *)0xfffC0E)

This works OK until the the I do this

	while (SCSR & 0X0100)  
		;
	SCDR = c ;
The optimizer (-O2 ) thinks SCSR is a constant 
after the first pass
and sits in a loop between L2 and L3.

	btst #6,16776205	/* SCSR */
	jbne .L3
	clr.w %d0
.L2:
	tst.w %d0
	jbeq .L2
.L3:

How do specify pointer to a volital area in memory?

OR

I would like to have the CPU's internal I/O show up 
in the linker map
so that if someone tries to map something else in 
the same location the
linker will give a warning or error.


Is there a simple way to get the symbols into the 
memory map? 
Has it been done?
I tried the following and it did't seem to work

        .globl  SIMCR
        .globl  SCDR
        .globl  TPUMCR

.org    0Xfffa00
.lcomm  SIMCR,2
.lcomm  SCDR,1
        ...
.org    0Xfffb00
.lcomm  TPUMCR,1
        ...
The first register (SIMCR) had the correct value 
but the rest
 of the registers were all over the place.

Follow-Ups:

Home | Subject Index | Thread Index