Returns the index into *levels with the match */
| 432 | |
| 433 | /* Returns the index into *levels with the match */ |
| 434 | static int |
| 435 | cpufreq_get_level(device_t dev, struct cf_level *levels, int count) |
| 436 | { |
| 437 | int i, freq; |
| 438 | |
| 439 | if ((freq = cpufreq_get_frequency(dev)) < 0) |
| 440 | return (-1); |
| 441 | for (i = 0; i < count; i++) |
| 442 | if (freq == levels[i].total_set.freq) |
| 443 | return (i); |
| 444 | |
| 445 | return (-1); |
| 446 | } |
| 447 | |
| 448 | /* |
| 449 | * Used by the cpufreq core, this function will populate *level with the current |
no test coverage detected