Back to index

lshw  02.16
Functions
cpufreq.h File Reference
#include "hw.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool scan_cpufreq (hwNode &n)

Function Documentation

bool scan_cpufreq ( hwNode n)

Definition at line 51 of file cpufreq.cc.

{
  char buffer[PATH_MAX];
  unsigned i =0;

  while(hwNode * cpu = node.findChildByBusInfo(cpubusinfo(i)))
  {
    snprintf(buffer, sizeof(buffer), DEVICESCPUFREQ, i);
    if(exists(buffer))
    {
      unsigned long long max, min, cur;
      pushd(buffer);

                                                  // in Hz
      min = 1000*(unsigned long long)get_long("cpuinfo_min_freq");
                                                  // in Hz
      max = 1000*(unsigned long long)get_long("cpuinfo_max_freq");
                                                  // in Hz
      cur = 1000*(unsigned long long)get_long("scaling_cur_freq");
      cpu->addCapability("cpufreq", "CPU Frequency scaling");
      if(cur) cpu->setSize(cur);
      if(max>cpu->getCapacity()) cpu->setCapacity(cur);
      popd();
    }
    i++;
  }

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function: