📄 fpparchlib.c
字号:
* \"\&`i960':* \" - registers `fp0' - `fp3'* \"* \&`MIPS':* - register `fpcsr'* - registers `fp0' - `fp31'** \&`SH-4':* - registers `fpcsr' and `fpul'* - registers `fr0' - `fr15'* - registers `xf0' - `xf15'** \&`x86':* 108 byte old context with fsave and frstor instruction* - control word, status word, tag word, * - instruction pointer,* - instruction pointer selector,* - last FP instruction op code,* - data pointer,* - data pointer selector,* - registers `st/mm0' - `st/mm7' (10 bytes * 8)* 512 byte new context with fxsave and fxrstor instruction* - control word, status word, tag word, * - last FP instruction op code,* - instruction pointer,* - instruction pointer selector,* - data pointer,* - data pointer selector,* - registers `st/mm0' - `st/mm7' (10 bytes * 8)* - registers `xmm0' - `xmm7' (16 bytes * 8)** \&`ARM':* - currently, on this architecture, this routine does nothing.** \&`SimSolaris':* - register `fsr'* - registers `f0' - `f31'** \&`SimNT':* - this routine does nothing on Windows simulator. Floating point* registers are saved by Windows.** RETURNS: N/A** SEE ALSO: fppRestore()*/void fppSave ( FP_CONTEXT * pFpContext /* where to save context */ ) { ... }/********************************************************************************* fppRestore - restore the floating-point coprocessor context** 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.)** \"\&`SPARC':* \" - registers `fsr' and `fpq'* \" - registers `f0' - `f31'* \"* \"\&`i960':* \" - registers `fp0' - `fp3'* \"* \&`MIPS':* - register `fpcsr'* - registers `fp0' - `fp31'** \&`SH-4':* - registers `fpcsr' and `fpul'* - registers `fr0' - `fr15'* - registers `xf0' - `xf15'** \&`x86':* 108 byte old context with fsave and frstor instruction* - control word, status word, tag word, * - instruction pointer,* - instruction pointer selector,* - last FP instruction op code,* - data pointer,* - data pointer selector,* - registers `st/mm0' - `st/mm7' (10 bytes * 8)* 512 byte new context with fxsave and fxrstor instruction* - control word, status word, tag word, * - last FP instruction op code,* - instruction pointer,* - instruction pointer selector,* - data pointer,* - data pointer selector,* - registers `st/mm0' - `st/mm7' (10 bytes * 8)* - registers `xmm0' - `xmm7' (16 bytes * 8)** \&`ARM':* - currently, on this architecture, this routine does nothing.** \&`SimSolaris':* - register `fsr'* - registers `f0' - `f31'** \&`SimNT':* - this routine does nothing on Windows simulator. ** RETURNS: N/A** SEE ALSO: fppSave()*/void fppRestore ( FP_CONTEXT * pFpContext /* where to restore context from */ ) { ... }/********************************************************************************* fppProbe - probe for the presence of a floating-point coprocessor** This routine determines whether there is a* floating-point coprocessor in the system.** The implementation of this routine is architecture-dependent:** .IP "`MC680x0', `x86', `SH-4':"* 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.** \".IP `i960':* \"This routine merely indicates whether VxWorks was compiled with* \"the flag `-DCPU=I960KB'.* \"* .IP `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.** .IP `ARM':* This routine currently returns ERROR to indicate no floating-point * coprocessor support.* * .IP "`SimNT', `SimSolaris':"* This routine currently returns OK.** INTERNAL* The STAR board will always have an on-board floating-point unit.* What about others?** RETURNS:* OK, or ERROR if there is no floating-point coprocessor.*/STATUS fppProbe (void) { ... }/********************************************************************************* fppTaskRegsGet - get the floating-point registers from a task TCB** 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: fppTaskRegsSet()*/STATUS fppTaskRegsGet ( int task, /* task to get info about */ FPREG_SET * pFpRegSet /* ptr to floating-point register set */ ) { ... }/********************************************************************************* fppTaskRegsSet - set the floating-point registers of a task** 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: fppTaskRegsGet()*/STATUS fppTaskRegsSet ( int task, /* task to set registers for */ FPREG_SET * pFpRegSet /* ptr to floating-point register set */ ) { ... }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -