Changeset 94093 in vbox for trunk/src/VBox/Runtime/r3/darwin
- Timestamp:
- Mar 4, 2022 10:50:45 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150339
- Location:
- trunk/src/VBox/Runtime/r3/darwin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/darwin/RTMpGetDescription-generic.cpp
r94091 r94093 60 60 #if defined(RT_ARCH_ARM64) 61 61 char szArmCpuPath[64]; 62 RTStrPrintf(szArmCpuPath, sizeof(szArmCpuPath), "IODeviceTree:/cpus/cpu% u", idCpu);62 RTStrPrintf(szArmCpuPath, sizeof(szArmCpuPath), "IODeviceTree:/cpus/cpu%x", idCpu); /** @todo Hex? M1 Max only has 10 cores... */ 63 63 io_registry_entry_t hIoRegEntry = IORegistryEntryFromPath(kIOMasterPortDefault, szArmCpuPath); 64 64 if (hIoRegEntry != MACH_PORT_NULL) -
trunk/src/VBox/Runtime/r3/darwin/mp-darwin.cpp
r94087 r94093 351 351 */ 352 352 353 #if 1 /* simpler way to get at it inspired by powermetrics, this is also used 354 in the arm version of RTMpGetDescription. */ 355 /* Assume names on the form "cpu<N>" are only for CPUs. */ 356 char szCpuPath[64]; 357 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 358 RTStrPrintf(szCpuPath, sizeof(szCpuPath), "IODeviceTree:/cpus/CPU%X", idCpu); 359 # else 360 RTStrPrintf(szCpuPath, sizeof(szCpuPath), "IODeviceTree:/cpus/cpu%x", idCpu); /** @todo Hex? M1 Max only has 10 cores... */ 361 # endif 362 io_registry_entry_t hIoRegEntry = IORegistryEntryFromPath(kIOMasterPortDefault, szCpuPath); 363 if (hIoRegEntry != MACH_PORT_NULL) 364 { 365 uint32_t uCpuFrequency = rtMpDarwinGetMaxFrequencyFromIOService(hIoRegEntry); 366 IOObjectRelease(hIoRegEntry); 367 if (uCpuFrequency) 368 return uCpuFrequency; 369 } 370 371 #else 353 372 /* Assume names on the form "cpu<N>" are only for CPUs. */ 354 373 char szCpuName[32]; … … 367 386 } 368 387 369 # if 1 /* Just in case... */388 # if 1 /* Just in case... */ 370 389 /* Create a matching dictionary for searching for CPU services in the IOKit. */ 371 # if defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)390 # if defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32) 372 391 hMatchingDict = IOServiceMatching("AppleARMCPU"); 373 # elif defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)392 # elif defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 374 393 hMatchingDict = IOServiceMatching("AppleACPICPU"); 375 # else376 # error "Port me!"377 # endif394 # else 395 # error "Port me!" 396 # endif 378 397 AssertReturn(hMatchingDict, 0); 379 398 … … 399 418 } 400 419 IOObjectRelease(hCpuServices); 420 # endif 401 421 #endif 402 403 422 AssertFailed(); 404 423 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.