| 200 | } |
| 201 | |
| 202 | void |
| 203 | vfp_restore_state(void) |
| 204 | { |
| 205 | struct pcb *curpcb; |
| 206 | u_int cpu; |
| 207 | |
| 208 | critical_enter(); |
| 209 | |
| 210 | cpu = PCPU_GET(cpuid); |
| 211 | curpcb = curthread->td_pcb; |
| 212 | curpcb->pcb_fpflags |= PCB_FP_STARTED; |
| 213 | |
| 214 | vfp_enable(); |
| 215 | |
| 216 | /* |
| 217 | * If the previous thread on this cpu to use the VFP was not the |
| 218 | * current thread, or the current thread last used it on a different |
| 219 | * cpu we need to restore the old state. |
| 220 | */ |
| 221 | if (PCPU_GET(fpcurthread) != curthread || cpu != curpcb->pcb_vfpcpu) { |
| 222 | vfp_restore(curthread->td_pcb->pcb_fpusaved); |
| 223 | PCPU_SET(fpcurthread, curthread); |
| 224 | curpcb->pcb_vfpcpu = cpu; |
| 225 | } |
| 226 | |
| 227 | critical_exit(); |
| 228 | } |
| 229 | |
| 230 | void |
| 231 | vfp_init(void) |
no test coverage detected