VxWorks Reference Manual : Libraries
fppArchLib - architecture-dependent floating-point coprocessor support
fppSave( ) - save the floating-point coprocessor context
fppRestore( ) - restore the floating-point coprocessor context
fppProbe( ) - probe for the presence of a floating-point coprocessor
fppTaskRegsGet( ) - get the floating-point registers from a task TCB
fppTaskRegsSet( ) - set the floating-point registers of a task
This library contains architecture-dependent routines to support the floating-point coprocessor. The routines fppSave( ) and fppRestore( ) save and restore all the task floating-point context information. The routine fppProbe( ) checks for the presence of the floating-point coprocessor. The routines fppTaskRegsSet( ) and fppTaskRegsGet( ) inspect and set coprocessor registers on a per-task basis.
With the exception of fppProbe( ), the higher-level facilities in dbgLib and usrLib should be used instead of these routines. For information about architecture-independent access mechanisms, see the manual entry for fppLib.
To activate floating-point support, fppInit( ) must be called before any tasks using the coprocessor are spawned. This is done by the root task, usrRoot( ), in usrConfig.c. See the manual entry for fppLib.
NOTE I386/I486 On this architecture, VxWorks disables the six FPU exceptions that can send an IRQ to the CPU.
This architecture does not currently support floating-point coprocessors.
fppLib.h
fppArchLib, fppLib, intConnect( ), Motorola MC68881/882 Floating-Point Coprocessor User's Manual, SPARC Architecture Manual, Intel 80960SA/SB Reference Manual, Intel 80960KB Programmer's Reference Manual, Intel 387 DX User's Manual, Gerry Kane and Joe Heinrich: MIPS RISC Architecture Manual
fppSave( ) - save the floating-point coprocessor context
void fppSave ( FP_CONTEXT * pFpContext /* where to save context */ )
This routine saves the floating-point coprocessor context. The context saved is:
MC680x0:
- registers fpcr, fpsr, and fpiar
- registers f0 - f7
- internal state frame (if NULL, the other registers are not saved.)
- registers fsr and fpq
- registers f0 - f31i960:
- registers fp0 - fp3
- register fpcsr
- registers fp0 - fp31i386/i486:
- control word, status word, tag word, IP offset, CS selector,
data operand offset, and operand selector (4 bytes each)
- registers st0 - st7 (8 bytes each)
- currently, on this architecture, this routine does nothing.
N/A
fppArchLib, fppRestore( )
fppRestore( ) - restore the floating-point coprocessor context
void fppRestore ( FP_CONTEXT * pFpContext /* where to restore context from */ )
This routine restores the floating-point coprocessor context. The context restored is:
MC680x0:
- registers fpcr, fpsr, and fpiar
- registers f0 - f7
- internal state frame (if NULL, the other registers are not saved.)
- registers fsr and fpq
- registers f0 - f31i960:
- registers fp0 - fp3
- register fpcsr
- registers fp0 - fp31i386/i486:
- control word, status word, tag word, IP offset, CS selector,
data operand offset, and operand selector
- registers st0 - st7
- currently, on this architecture, this routine does nothing.
N/A
fppArchLib, fppSave( )
fppProbe( ) - probe for the presence of a floating-point coprocessor
STATUS fppProbe (void)
This routine determines whether there is a floating-point coprocessor in the system.
The implementation of this routine is architecture-dependent:
- MC680x0, SPARC, i386/i486:
- This routine sets the illegal coprocessor opcode trap vector and executes a coprocessor instruction. If the instruction causes an exception, fppProbe( ) returns ERROR. Note that this routine saves and restores the illegal coprocessor opcode trap vector that was there prior to this call.
The probe is only performed the first time this routine is called. The result is stored in a static and returned on subsequent calls without actually probing.
- i960:
- This routine merely indicates whether VxWorks was compiled with the flag -DCPU=I960KB.
This routine simply reads the R-Series status register and reports the bit that indicates whether coprocessor 1 is usable. This bit must be correctly initialized in the BSP.
This routine currently returns ERROR to indicate no floating-point coprocessor support.
OK, or ERROR if there is no floating-point coprocessor.
fppTaskRegsGet( ) - get the floating-point registers from a task TCB
STATUS fppTaskRegsGet ( int task, /* task to get info about */ FPREG_SET * pFpRegSet /* ptr to floating-point register set */ )
This routine copies a task's floating-point registers and/or status registers to the locations whose pointers are passed as parameters. The floating-point registers are copied into an array containing all the registers.
This routine only works well if task is not the calling task. If a task tries to discover its own registers, the values will be stale (that is, left over from the last task switch).
OK, or ERROR if there is no floating-point support or there is an invalid state.
fppTaskRegsSet( ) - set the floating-point registers of a task
STATUS fppTaskRegsSet ( int task, /* task to set registers for */ FPREG_SET * pFpRegSet /* ptr to floating-point register set */ )
This routine loads the specified values into the TCB of a specified task. The register values are copied from the array at pFpRegSet.
OK, or ERROR if there is no floating-point support or there is an invalid state.