summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehardwaredevices.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-08 16:13:09 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-08 16:13:09 -0500
commit81dacc29a4cd8094350939191b7f35037c4439ee (patch)
tree0eae84897d49e616fc2d755e3ef83a31ca4eed22 /tdecore/tdehardwaredevices.h
parent8f76b98ccc30b7d0b574ce50ba602de4f2126cb6 (diff)
downloadtdelibs-81dacc29a4cd8094350939191b7f35037c4439ee.tar.gz
tdelibs-81dacc29a4cd8094350939191b7f35037c4439ee.zip
Add detailed CPU information gathering to the TDE hardware library
Diffstat (limited to 'tdecore/tdehardwaredevices.h')
-rw-r--r--tdecore/tdehardwaredevices.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/tdecore/tdehardwaredevices.h b/tdecore/tdehardwaredevices.h
index d30c125c2..495a6a761 100644
--- a/tdecore/tdehardwaredevices.h
+++ b/tdecore/tdehardwaredevices.h
@@ -636,10 +636,116 @@ class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice
TQStringList m_slaveDevices;
};
+class TDECORE_EXPORT TDECPUDevice : public TDEGenericDevice
+{
+ public:
+ /**
+ * Constructor.
+ * @param Device type
+ */
+ TDECPUDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
+
+ /**
+ * Destructor.
+ */
+ ~TDECPUDevice();
+
+ /**
+ * @return a double with the current CPU frequency in MHz, if available
+ */
+ double &frequency();
+
+ /**
+ * @param a double with the current CPU frequency in MHz, if available
+ */
+ void setFrequency(double fr);
+
+ /**
+ * @return a double with the minimum CPU frequency in MHz, if available
+ */
+ double &minFrequency();
+
+ /**
+ * @param a double with the minimum CPU frequency in MHz, if available
+ */
+ void setMinFrequency(double fr);
+
+ /**
+ * @return a double with the maximum CPU frequency in MHz, if available
+ */
+ double &maxFrequency();
+
+ /**
+ * @param a double with the maximum CPU frequency in MHz, if available
+ */
+ void setMaxFrequency(double fr);
+
+ /**
+ * @return a double with the transition latency in ns, if available
+ */
+ double &transitionLatency();
+
+ /**
+ * @param a double with the transition latency in ns, if available
+ */
+ void setTransitionLatency(double tl);
+
+ /**
+ * @return a TQString with the current CPU governor policy, if available
+ */
+ TQString &governor();
+
+ /**
+ * @param a TQString with the current CPU governor policy, if available
+ */
+ void setGovernor(TQString gr);
+
+ /**
+ * @return a TQString with the current CPU scaling driver, if available
+ */
+ TQString &scalingDriver();
+
+ /**
+ * @param a TQString with the current CPU scaling driver, if available
+ */
+ void setScalingDriver(TQString dr);
+
+ /**
+ * @return a TQStringList with the IDs of all processors that are dependent on the frequency/power settings of this one, if available
+ */
+ TQStringList &dependentProcessors();
+
+ /**
+ * @param a TQStringList with the IDs of all processors that are dependent on the frequency/power settings of this one, if available
+ */
+ void setDependentProcessors(TQStringList dp);
+
+ /**
+ * @return a TQStringList with all valid scaling frequencies in Hz, if available
+ */
+ TQStringList &availableFrequencies();
+
+ /**
+ * @param a TQStringList with all valid scaling frequencies in Hz, if available
+ */
+ void setAvailableFrequencies(TQStringList af);
+
+ private:
+ double m_frequency;
+ double m_minfrequency;
+ double m_maxfrequency;
+ double m_transitionlatency;
+ TQString m_governor;
+ TQString m_scalingdriver;
+ TQStringList m_tiedprocs;
+ TQStringList m_frequencies;
+};
+
typedef TQPtrList<TDEGenericDevice> TDEGenericHardwareList;
typedef TQMap<TQString, TQString> TDEDeviceIDMap;
class TQSocketNotifier;
+class KSimpleDirWatch;
class TDECORE_EXPORT TDEHardwareDevices : public TQObject
{
@@ -750,6 +856,7 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject
private slots:
void processHotPluggedHardware();
void processModifiedMounts();
+ void processModifiedCPUs();
private:
void rescanDeviceInformation(TDEGenericDevice* hwdevice);
@@ -768,11 +875,14 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject
struct udev_monitor *m_udevMonitorStruct;
TDEGenericHardwareList m_deviceList;
int m_procMountsFd;
+ KSimpleDirWatch* m_cpuWatch;
+ TQTimer* m_cpuWatchTimer;
TQSocketNotifier* m_devScanNotifier;
TQSocketNotifier* m_mountScanNotifier;
TQStringList m_mountTable;
+ TQStringList m_cpuInfo;
TDEDeviceIDMap* pci_id_map;
TDEDeviceIDMap* usb_id_map;