| 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)) |
|---|