OEMRestoreVFPCtrlRegs (Compact 2013)

10/16/2014

This function restores the state of the extra implementation-specific vector floating point (VFP) registers for the current thread.

Syntax

void OEMRestoreVFPCtrlRegs(
  LPDWORD lpExtra,
  int nMaxRegs
);

Parameters

  • lpExtra
    [in] A pointer to a memory location to restore the extra floating point registers. Use this parameter only for implementation-specific VFP registers.
  • nMaxRegs
    [in] The number of extra 32 bit implementation-defined VFP registers that can be restored for a thread's context. This number of registers is currently set to 8.

Return Value

None.

Remarks

This function is specific to ARM architecture with a CPU that supports VFP. The kernel calls OEMRestoreVFPCtrlRegs to restore the control registers. It is not intended for general purpose VFP registers.

The kernel saves and restores VFP registers only when necessary and only to a limited extent. If a thread never uses VFP, the kernel does not save or restore VFP registers for the thread.

If a thread that is using the VFP is pre-empted by another threat, the kernel saves the first thread's VFP registers and turns off the VFP, which saves power. Because VFP is off, the next thread to execute a VFP instruction causes an exception. At that time, the kernel turns the VFP on again and re-executes that VFP instruction.

By default, the VFP is off until the CPU executes a VFP instruction. If an exception is generated because the VFP is turned off, the current thread becomes the owner of the VFP.

If another thread previously owned a VFP, the OEMSaveVFPCtrlRegs function saves the state of the previous owner, and this function restores the state of the new owner.

The kernel restores the VFP standard registers and then calls OEMRestoreVFPCtrlRegs to restore implementation-defined registers.

To make OEMRestoreVFPCtrlRegs accessible to the kernel, assign the OEMGLOBAL function pointer pfnOEMRestoreVFPCtrlRegs in the call to the OEMInit function.

Requirements

Header

Developer Implemented

Library

OEMMain.lib or OEMMain_StaticKITL.lib

See Also

Reference

Optional OAL Functions
OEMSaveVFPCtrlRegs
OEMInit