VxWorks Reference Manual : Libraries

fppArchLib

NAME

fppArchLib - architecture-dependent floating-point coprocessor support

ROUTINES

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

DESCRIPTION

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.

INITIALIZATION

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.

NOTE ARM

This architecture does not currently support floating-point coprocessors.

INCLUDE FILES

fppLib.h

SEE ALSO

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


Libraries : Routines

fppSave( )

NAME

fppSave( ) - save the floating-point coprocessor context

SYNOPSIS

void fppSave
    (
    FP_CONTEXT * pFpContext /* where to save context */
    )

DESCRIPTION

This routine saves the floating-point coprocessor context. The context saved is:

MC680x0:
      - registers fpcrfpsr, and fpiar
      - registers f0 - f7
      - internal state frame (if NULL, the other registers are not saved.)

SPARC

      - registers fsr and fpq
      - registers f0 - f31

i960:
      - registers fp0 - fp3

MIPS

      - register fpcsr
      - registers fp0 - fp31

i386/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)

ARM

      - currently, on this architecture, this routine does nothing.

RETURNS

N/A

SEE ALSO

fppArchLib, fppRestore( )


Libraries : Routines

fppRestore( )

NAME

fppRestore( ) - restore the floating-point coprocessor context

SYNOPSIS

void fppRestore
    (
    FP_CONTEXT * pFpContext /* where to restore context from */
    )

DESCRIPTION

This routine restores the floating-point coprocessor context. The context restored is:

MC680x0:
      - registers fpcrfpsr, and fpiar
      - registers f0 - f7
      - internal state frame (if NULL, the other registers are not saved.)

SPARC

      - registers fsr and fpq
      - registers f0 - f31

i960:
      - registers fp0 - fp3

MIPS

      - register fpcsr
      - registers fp0 - fp31

i386/i486:
      - control word, status word, tag word, IP offset, CS selector,
        data operand offset, and operand selector
      - registers st0 - st7

ARM

      - currently, on this architecture, this routine does nothing.

RETURNS

N/A

SEE ALSO

fppArchLib, fppSave( )


Libraries : Routines

fppProbe( )

NAME

fppProbe( ) - probe for the presence of a floating-point coprocessor

SYNOPSIS


STATUS fppProbe (void)

DESCRIPTION

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.

MIPS

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.

ARM

This routine currently returns ERROR to indicate no floating-point coprocessor support.

RETURNS

OK, or ERROR if there is no floating-point coprocessor.

SEE ALSO

fppArchLib


Libraries : Routines

fppTaskRegsGet( )

NAME

fppTaskRegsGet( ) - get the floating-point registers from a task TCB

SYNOPSIS

STATUS fppTaskRegsGet
    (
    int         task,     /* task to get info about */
    FPREG_SET * pFpRegSet /* ptr to floating-point register set */
    )

DESCRIPTION

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.

NOTE

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).

RETURNS

OK, or ERROR if there is no floating-point support or there is an invalid state.

SEE ALSO

fppArchLib, fppTaskRegsSet( )


Libraries : Routines

fppTaskRegsSet( )

NAME

fppTaskRegsSet( ) - set the floating-point registers of a task

SYNOPSIS

STATUS fppTaskRegsSet
    (
    int         task,     /* task to set registers for */
    FPREG_SET * pFpRegSet /* ptr to floating-point register set */
    )

DESCRIPTION

This routine loads the specified values into the TCB of a specified task. The register values are copied from the array at pFpRegSet.

RETURNS

OK, or ERROR if there is no floating-point support or there is an invalid state.

SEE ALSO

fppArchLib, fppTaskRegsGet( )