ColdFire CVS Build Error - PR 803
Pavel Pisa
ppisa4lists at pikron.com
Fri Jun 10 23:59:37 UTC 2005
On Wednesday 01 June 2005 23:47, Brett Swimley wrote:
> I'll look into it and help where I can.
>
> My suspicion on the uC5282 is that it's not using that particular
> macro. I had it compile as well.
>
> Brett
Hello Brett and others,
I do not use ColdFire now, but I like m68k architecture
and that is why I have tried to respond to the problem report
already.
I have glimpsed to PR 803 solution, but I am convinced
that even more damage has slipperred-in.
The _VBR variable is used in the two distinct and incompatible
meanings now.
The _VBR (as understand by more linkcmds and !M68K_HAS_VBR architectures)
is start address of the static array of interrupt vectors.
You have overload that meaning by changing of _VBR declaration
and using of it as the variable holding pointer to the
interrupt table.
----------------------------------------------------------------
extern void* _VBR;
----------------------------------------------------------------
#elif ( M68K_COLDFIRE_ARCH == 1 )
extern void* _VBR;
#define m68k_get_vbr( _vbr ) _vbr = &_VBR
/* !!! ^- Error there !!! */
#define m68k_set_vbr( _vbr ) \
do { \
asm volatile ( "movec %0,%%vbr " : : "r" (_vbr)); \
_VBR = (void *)_vbr; \
} while(0)
#else
----------------------------------------------------------------
You have inconsistency between 68000 meaning and ColdFire
meaning and even internal inconsistency between ColdFire macros.
The ColdFire version of the m68k_set_vbr macro stores vector
table address in the first vector location of _VBR area provided
by linkcmds.
I would suggest to separate _VBR static array meaning from VBR register
shadow and correct m68k_get_vbr.
----------------------------------------------------------------
/* static array allocated for vector table by BSP's linkcmds */
extern uint32_t _VBR[];
/* shadow store for the VBR register readback for ColdFire architecture */
extern void* _VBR_REG_SHADOW;
----------------------------------------------------------------
#elif ( M68K_COLDFIRE_ARCH == 1 )
/*extern ???*/ void* _VBR_REG_SHADOW;
#define m68k_get_vbr( _vbr ) do{ _vbr = _VBR_REG_SHADOW; } while(0)
#define m68k_set_vbr( _vbr ) \
do { \
asm volatile ( "movec %0,%%vbr " : : "r" (_vbr)); \
_VBR_REG_SHADOW = (void *)_vbr; \
} while(0)
#else
----------------------------------------------------------------
There is even one more thing to solve in the code above.
If you preserve "extern" word there, you have to
declare _VBR_REG_SHADOW variable in the some of score/cpu/m68k
*.c files as well.
Best wishes
Pavel Pisa
e-mail: pisa at cmp.felk.cvut.cz
www: http://cmp.felk.cvut.cz/~pisa
work: http://www.pikron.com
More information about the users
mailing list