ColdFire CVS Build Error - PR 803

Brett Swimley brett.swimley at aedbozeman.com
Sat Jun 11 13:20:23 UTC 2005


I like this approach.  I agree with Pavel about the problems introduced 
with the fix as it stands..  Several BSPs don't call m68k_set_vbr() at 
this time, but they probably should.

Brett

Chris Johns wrote:

> Pavel Pisa wrote:
>
>>
>> I would suggest to separate _VBR static array meaning from VBR register
>> shadow and correct m68k_get_vbr.
>>
>
> What about moving the Coldfire support out of macros in the header 
> files into specific Coldfire support routines ?
>
> For example, in the header file:
>
> #elif ( M68K_COLDFIRE_ARCH == 1 )
> #define m68k_get_vbr( _vbr ) _vbr = _CPU_coldfire_get_vbr ()
> #define m68k_set_vbr( vbr )  _CPU_coldfire_set_vbr (vbr)
> #else
>
> then:
>
> /*
>  * Cannot be an odd address.
>  */
> static uint32_t cf_vbr = 0xbeefbeef;
>
> uint32_t
> _CPU_coldfire_get_vbr ()
> {
>   /*
>    * Catch a user/bsp/application not setting the VBR.
>    */
>   if (cf_vbr == 0xbeefbeef)
>     rtems_internal_error (...);
>   return cf_vbr;
> }
>
> void
> _CPU_coldfire_set_vbr (uint32_t vbr)
> {
>   if (vbr & ~((1 << 20) - 1))
>     rtems_internal_error (....);
>   rtems_mask_ints (...);
>   cf_vbr = vbr;
>   asm volatile ( "movec   %0,%%vbr " : : "r" (cf_vbr));
>   rtems_unmask_ints (...);
> }
>
> This change will require all Coldfire BSP's make the call to 
> 'm68k_set_vbr' to stop the internal error occurring.
>
> The advantage of this approach is any newer Coldfire's that change the 
> VBR register constraints can be handled outside the header file.
>
>




More information about the users mailing list