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

Function print_INTEL_info

freebsd/x86/x86/identcpu.c:1941–1977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1939}
1940
1941static void
1942print_INTEL_info(void)
1943{
1944 u_int regs[4];
1945 u_int rounds, regnum;
1946 u_int nwaycode, nway;
1947
1948 if (cpu_high >= 2) {
1949 rounds = 0;
1950 do {
1951 do_cpuid(0x2, regs);
1952 if (rounds == 0 && (rounds = (regs[0] & 0xff)) == 0)
1953 break; /* we have a buggy CPU */
1954
1955 for (regnum = 0; regnum <= 3; ++regnum) {
1956 if (regs[regnum] & (1<<31))
1957 continue;
1958 if (regnum != 0)
1959 print_INTEL_TLB(regs[regnum] & 0xff);
1960 print_INTEL_TLB((regs[regnum] >> 8) & 0xff);
1961 print_INTEL_TLB((regs[regnum] >> 16) & 0xff);
1962 print_INTEL_TLB((regs[regnum] >> 24) & 0xff);
1963 }
1964 } while (--rounds > 0);
1965 }
1966
1967 if (cpu_exthigh >= 0x80000006) {
1968 do_cpuid(0x80000006, regs);
1969 nwaycode = (regs[2] >> 12) & 0x0f;
1970 if (nwaycode >= 0x02 && nwaycode <= 0x08)
1971 nway = 1 << (nwaycode / 2);
1972 else
1973 nway = 0;
1974 printf("L2 cache: %u kbytes, %u-way associative, %u bytes/line\n",
1975 (regs[2] >> 16) & 0xffff, nway, regs[2] & 0xff);
1976 }
1977}
1978
1979static void
1980print_INTEL_TLB(u_int data)

Callers 1

printcpuinfoFunction · 0.85

Calls 3

print_INTEL_TLBFunction · 0.85
do_cpuidFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected