]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/tsc.c
xnu-792.25.20.tar.gz
[apple/xnu.git] / osfmk / i386 / tsc.c
index d299aff344291ee2e92406ba3e8bd66577fe617b..b6741c24d8d8747938a4630e33f754a523cbcb86 100644 (file)
@@ -123,9 +123,7 @@ tsc_init(void)
 {
     uint64_t   busFreq;
     uint64_t   busFCvtInt;
-    uint32_t   cpuModel;
-    uint32_t   cpuFamily;
-    uint32_t   xcpuid[4];
+    uint32_t   cpuFamily  = cpuid_info()->cpuid_family;
 
     /*
      * Get the FSB frequency and conversion factors.
@@ -148,37 +146,16 @@ tsc_init(void)
            (uint32_t)(busFCvtn2t >> 32), (uint32_t)busFCvtn2t,
            (uint32_t)(busFCvtInt >> 32), (uint32_t)busFCvtInt);
 
-    do_cpuid(1, xcpuid);
-    cpuFamily = ( xcpuid[eax] >> 8 ) & 0xf;
-    /*
-     * Get the extended family if necessary.
-     */
-    if (cpuFamily == 0x0f)
-       cpuFamily += (xcpuid[eax] >> 20) & 0x00ff;
-
-    cpuModel = ( xcpuid[eax] >> 4 ) & 0xf;
-    /*
-     * Get the extended model if necessary.
-     */
-    if (cpuFamily == CPUID_FAMILY_686
-       || cpuFamily == CPUID_FAMILY_EXTENDED)
-       cpuModel += ((xcpuid[eax] >> 16) & 0xf) << 4;
-
     /*
      * Get the TSC increment.  The TSC is incremented by this
      * on every bus tick.  Calculate the TSC conversion factors
      * to and from nano-seconds.
      */
     if (cpuFamily == CPUID_FAMILY_686) {
-       if (cpuModel == CPUID_MODEL_CORE || cpuModel == CPUID_MODEL_CORE2) {
        uint64_t        prfsts;
        
        prfsts = rdmsr64(IA32_PERF_STS);
        tscGranularity = (uint32_t)(prfsts >> BusRatioShift) & BusRatioMask;
-       } else {
-           panic("rtclock_init: unknown CPU model: 0x%X\n",
-             cpuModel);
-       }
     } else {
        panic("rtclock_init: unknown CPU family: 0x%X\n",
              cpuFamily);