M68k/ColdFire: FPU context initialization

Thomas Doerfler Thomas.Doerfler at embedded-brains.de
Mon Nov 5 18:25:13 UTC 2007


thank you.

Joel Sherrill schrieb:
> If the thread is not an FP task, you would prefer to disable the FPU.
> If it is FP enabled, then all that you have to initialize is usually
> the control registers.

Ok, agreed, but in cpu_asm.S, in the assembly code to
_CPU_Context_restore_fp, even the initialization of the FPU control
registers is skipped, when the "NULL-frame" flag is zero.

This means, that the FPU control register would remain in the state of
the last task that executed. IMHO this might lead to unexpected values
in the control register: If one task sets the control register to very
special rounding modes etc, then it might inherit this to a newly
created task.

> Is the Coldfire FPU similar to the 68881 or is it more RISC like?
> Do you have the same type of fsave/restore instructions?

It implements a subset of the 68881 instructions, has only 64 bit per FP
register (instead of the old 80 bit model in 68881 and friends). It has
an fsave/frestore (which generates a smaller context).

Additionally the CF v4e has an EMAC unit, with about 7 registers, and we
want to add them to the FPU context. They also have a similar
status/control register and we are currently thinking on where to
initialize it properly.


>> Any hint appreciated,
>> Thomas Dörfler.

embedded brains GmbH
Thomas Doerfler           Obere Lagerstr. 30
D-82178 Puchheim          Germany
Tel. : +49-89-18 90 80 79-2
Fax  : +49-89-18 90 80 79-9
email: Thomas.Doerfler at embedded-brains.de
PGP public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the users mailing list