Added temperature watchdog for CPU on linux using sysfs
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _EXT_SYSFS_CPU_H
|
||||
#define _EXT_SYSFS_CPU_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
static const char SYSFS_HWMON[] = "/sys/class/hwmon";
|
||||
|
||||
static const char SENSOR_CORETEMP[] = "coretemp";
|
||||
static const char SENSOR_K10TEMP[] = "k10temp";
|
||||
static const char SENSOR_K8TEMP[] = "k8temp";
|
||||
static const char SENSOR_ACPITZ[] = "acpitz";
|
||||
|
||||
typedef int HM_ADAPTER_SYSFS_CPU;
|
||||
|
||||
typedef void *SYSFS_CPU_LIB;
|
||||
|
||||
typedef struct hm_sysfs_cpu_lib
|
||||
{
|
||||
// currently not using libudev, because it can only read values, not set them, so using /sys instead
|
||||
|
||||
SYSFS_CPU_LIB lib;
|
||||
|
||||
} hm_sysfs_cpu_lib_t;
|
||||
|
||||
typedef hm_sysfs_cpu_lib_t SYSFS_CPU_PTR;
|
||||
|
||||
bool sysfs_cpu_init (void *hashcat_ctx);
|
||||
void sysfs_cpu_close (void *hashcat_ctx);
|
||||
char *hm_SYSFS_CPU_get_syspath_hwmon ();
|
||||
int hm_SYSFS_CPU_get_temperature_current (void *hashcat_ctx, int *val);
|
||||
|
||||
#endif // _EXT_SYSFS_CPU_H
|
||||
@@ -1599,6 +1599,7 @@ typedef struct backend_ctx
|
||||
bool need_nvml;
|
||||
bool need_nvapi;
|
||||
bool need_sysfs_amdgpu;
|
||||
bool need_sysfs_cpu;
|
||||
bool need_iokit;
|
||||
|
||||
int comptime;
|
||||
@@ -1643,6 +1644,7 @@ typedef enum kernel_workload
|
||||
#include "ext_nvapi.h"
|
||||
#include "ext_nvml.h"
|
||||
#include "ext_sysfs_amdgpu.h"
|
||||
#include "ext_sysfs_cpu.h"
|
||||
#include "ext_iokit.h"
|
||||
|
||||
typedef struct hm_attrs
|
||||
@@ -1651,6 +1653,7 @@ typedef struct hm_attrs
|
||||
HM_ADAPTER_NVML nvml;
|
||||
HM_ADAPTER_NVAPI nvapi;
|
||||
HM_ADAPTER_SYSFS_AMDGPU sysfs_amdgpu;
|
||||
HM_ADAPTER_SYSFS_CPU sysfs_cpu;
|
||||
HM_ADAPTER_IOKIT iokit;
|
||||
|
||||
int od_version;
|
||||
@@ -1676,6 +1679,7 @@ typedef struct hwmon_ctx
|
||||
void *hm_nvml;
|
||||
void *hm_nvapi;
|
||||
void *hm_sysfs_amdgpu;
|
||||
void *hm_sysfs_cpu;
|
||||
void *hm_iokit;
|
||||
|
||||
hm_attrs_t *hm_device;
|
||||
|
||||
Reference in New Issue
Block a user