]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/kern_mib.c
xnu-1228.9.59.tar.gz
[apple/xnu.git] / bsd / kern / kern_mib.c
index 0b8f8f02468e51bd418aee91d8afdfd8c45fa860..01ac7e637e1e1664379268f83eb495bb40161361 100644 (file)
@@ -592,7 +592,7 @@ sysctl_mib_init(void)
        if (cpusubtype == CPU_SUBTYPE_POWERPC_970 && 
            cpu_info.l2_cache_size == 1 * 1024 * 1024)
                /* The signature of the dual-core G5 */
-               packages = hinfo.max_cpus / 2;
+               packages = roundup(hinfo.max_cpus, 2) / 2;
        else
                packages = hinfo.max_cpus;
 
@@ -647,9 +647,9 @@ sysctl_mib_init(void)
        cachesize[4] = 0;
 
        /* hw.packages */
-       packages = ml_cpu_cache_sharing(0) /
-                       cpuid_info()->cpuid_cores_per_package;
-       
+       packages = roundup(ml_cpu_cache_sharing(0), cpuid_info()->thread_count)
+                       / cpuid_info()->thread_count;
+
 #else /* end __arm__ */
 # warning we do not support this platform yet
 #endif /* __ppc__ */