ColdFire CVS Build Error with 4.0.0
Pavel Pisa
ppisa4lists at pikron.com
Wed Jun 1 23:25:39 UTC 2005
>>fails with a gcc error:
>>
>>'_VBR' has an incomplete type'
>>
>>The pertinent code from /cpukit/score/cpu/m68k/rtems/score/m68k.h is
>>shown below. The asterisked line appears to be where the problem occurs.
>>
>>#elif ( M68K_COLDFIRE_ARCH == 1 )
>>extern uint32_t _VBR[];
>>#define m68k_get_vbr( _vbr ) _vbr = _VBR
>>
>>#define m68k_set_vbr( vbr ) \
>> do { \
>> asm volatile ( "movec %0,%%vbr " : : "r" (vbr)); \
>>*** _VBR = (void *)vbr; \
>> } while(0)
>>
>>CVS indicates that _VBR was changed fairly recently from
>>void* _VBR;
>>to
>>uint32_t _VBR[];
Hello Joel and others,
I do not know, if this is of some value, but recent
Linux-2.6 kernels use next macros
#define SET_VBR(x) \
__asm__ __volatile__ (" movec %0,%/vbr" : : "r" (x));
#define GET_VBR(x) \
__asm__ __volatile__ (" movec %/vbr, %0" : "=g" (x) : );
I use '%/' combination in one of my system-less projects
for ages and it works well. So may it be, that it is preffered
GAS coding.
But I see other fundamental problem, you are trying to
set address of static array or setup full contents of
such array with open length. So this has to fail.
This
--------------------------------
uint32_t _VBR;
_VBR = vbr;
--------------------------------
or that
--------------------------------
uint32_t *_VBR;
_VBR = (uint32_t*)vbr;
--------------------------------
or even this
--------------------------------
extern uint32_t _VBR[];
#define m68k_set_vbr( vbr_ignored ) \
do { \
asm volatile ( "movec %0,%%vbr " : : "r" (_VBR)); \
} while(0)
...
/*in some .c file*/
uint32_t _VBR[256];
--------------------------------
Is corrects. It seems that it is similar conception change
of address to static array which has broken MX1 ARM setup
before some time.
Best wishes
Pavel Pisa
More information about the users
mailing list