- 時間撮記:
- 2008-7-9 下午06:39:22 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp
r10445 r10446 373 373 if (kHz == -1) 374 374 { 375 if (rtLinuxSysFsExists("devices/system/cpu/cpu%d/cpufreq/cpuinfo_cur_freq", (int)idCpu)) 375 /* The file may be just unreadable - in that case use plan B, i.e. 376 * /proc/cpuinfo to get the data we want. The assumption is that if 377 * cpuinfo_cur_freq doesn't exist then the speed won't change, and 378 * thus cur == max. If it does exist then cpuinfo contains the 379 * current frequency. */ 380 kHz = rtMpLinuxGetFrequency(idCpu) * 1000; 381 } 382 return (kHz + 999) / 1000; 383 } 384 385 386 RTDECL(uint32_t) RTMpGetMaxFrequency(RTCPUID idCpu) 387 { 388 int64_t kHz = rtLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", (int)idCpu); 389 if (kHz == -1) 390 { 391 /* Check if the file isn't there - if it is there, then /proc/cpuinfo 392 * would provide current frequency information, which is wrong. */ 393 if (!rtLinuxSysFsExists("devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", (int)idCpu)) 376 394 kHz = rtMpLinuxGetFrequency(idCpu) * 1000; 377 395 else … … 380 398 return (kHz + 999) / 1000; 381 399 } 382 383 384 RTDECL(uint32_t) RTMpGetMaxFrequency(RTCPUID idCpu)385 {386 int64_t kHz = rtLinuxSysFsReadIntFile(0, "devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", (int)idCpu);387 if (kHz == -1)388 kHz = rtMpLinuxGetFrequency(idCpu) * 1000;389 return (kHz + 999) / 1000;390 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器