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

Function fpuinit

freebsd/amd64/amd64/fpu.c:393–426  ·  view source on GitHub ↗

* Initialize the floating point unit. */

Source from the content-addressed store, hash-verified

391 * Initialize the floating point unit.
392 */
393void
394fpuinit(void)
395{
396 register_t saveintr;
397 u_int mxcsr;
398 u_short control;
399
400 if (IS_BSP())
401 fpuinit_bsp1();
402
403 if (use_xsave) {
404 load_cr4(rcr4() | CR4_XSAVE);
405 load_xcr(XCR0, xsave_mask);
406 }
407
408 /*
409 * XCR0 shall be set up before CPU can report the save area size.
410 */
411 if (IS_BSP())
412 fpuinit_bsp2();
413
414 /*
415 * It is too early for critical_enter() to work on AP.
416 */
417 saveintr = intr_disable();
418 stop_emulating();
419 fninit();
420 control = __INITIAL_FPUCW__;
421 fldcw(control);
422 mxcsr = __INITIAL_MXCSR__;
423 ldmxcsr(mxcsr);
424 start_emulating();
425 intr_restore(saveintr);
426}
427
428/*
429 * On the boot CPU we generate a clean state that is used to

Callers 2

hammer_timeFunction · 0.85
init_secondary_tailFunction · 0.85

Calls 7

fpuinit_bsp1Function · 0.85
fpuinit_bsp2Function · 0.85
load_cr4Function · 0.50
rcr4Function · 0.50
load_xcrFunction · 0.50
intr_disableFunction · 0.50
intr_restoreFunction · 0.50

Tested by

no test coverage detected