ColdFire CVS Build Error - PR 803
Chris Johns
chrisj at rtems.org
Sat Jun 11 02:27:22 UTC 2005
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.
--
Chris Johns
More information about the users
mailing list