MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cpufreq_get_level

Function cpufreq_get_level

freebsd/kern/kern_cpu.c:434–446  ·  view source on GitHub ↗

Returns the index into *levels with the match */

Source from the content-addressed store, hash-verified

432
433/* Returns the index into *levels with the match */
434static int
435cpufreq_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

Callers 1

cf_get_methodFunction · 0.85

Calls 1

cpufreq_get_frequencyFunction · 0.85

Tested by

no test coverage detected