MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fpstate_drop

Function fpstate_drop

freebsd/i386/i386/machdep.c:3037–3058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3035}
3036
3037static void
3038fpstate_drop(struct thread *td)
3039{
3040
3041 KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu"));
3042 critical_enter();
3043 if (PCPU_GET(fpcurthread) == td)
3044 npxdrop();
3045 /*
3046 * XXX force a full drop of the npx. The above only drops it if we
3047 * owned it. npxgetregs() has the same bug in the !cpu_fxsr case.
3048 *
3049 * XXX I don't much like npxgetregs()'s semantics of doing a full
3050 * drop. Dropping only to the pcb matches fnsave's behaviour.
3051 * We only need to drop to !PCB_INITDONE in sendsig(). But
3052 * sendsig() is the only caller of npxgetregs()... perhaps we just
3053 * have too many layers.
3054 */
3055 curthread->td_pcb->pcb_flags &= ~(PCB_NPXINITDONE |
3056 PCB_NPXUSERINITDONE);
3057 critical_exit();
3058}
3059
3060int
3061fill_dbregs(struct thread *td, struct dbreg *dbregs)

Callers 3

sendsigFunction · 0.70
exec_setregsFunction · 0.70
set_fpcontextFunction · 0.70

Calls 3

npxdropFunction · 0.85
critical_enterFunction · 0.50
critical_exitFunction · 0.50

Tested by

no test coverage detected