| 1939 | } |
| 1940 | |
| 1941 | static void |
| 1942 | print_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 | |
| 1979 | static void |
| 1980 | print_INTEL_TLB(u_int data) |
no test coverage detected