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

Function init_winchip

freebsd/i386/i386/initcpu.c:397–420  ·  view source on GitHub ↗

* IDT WinChip C6/2/2A/2B/3 * * http://www.centtech.com/winchip_bios_writers_guide_v4_0.pdf */

Source from the content-addressed store, hash-verified

395 * http://www.centtech.com/winchip_bios_writers_guide_v4_0.pdf
396 */
397static void
398init_winchip(void)
399{
400 u_int regs[4];
401 uint64_t fcr;
402
403 fcr = rdmsr(0x0107);
404
405 /*
406 * Set ECX8, DSMC, DTLOCK/EDCTLB, EMMX, and ERETSTK and clear DPDC.
407 */
408 fcr |= (1 << 1) | (1 << 7) | (1 << 8) | (1 << 9) | (1 << 16);
409 fcr &= ~(1ULL << 11);
410
411 /*
412 * Additionally, set EBRPRED, E2MMX and EAMD3D for WinChip 2 and 3.
413 */
414 if (CPUID_TO_MODEL(cpu_id) >= 8)
415 fcr |= (1 << 12) | (1 << 19) | (1 << 20);
416
417 wrmsr(0x0107, fcr);
418 do_cpuid(1, regs);
419 cpu_feature = regs[3];
420}
421#endif
422
423#ifdef I686_CPU

Callers 1

initializecpuFunction · 0.85

Calls 3

rdmsrFunction · 0.50
wrmsrFunction · 0.50
do_cpuidFunction · 0.50

Tested by

no test coverage detected