mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2024-11-25 17:50:17 -06:00
initial commit
This commit is contained in:
parent
4411c29aeb
commit
d8a013dcba
3
meson.build
Normal file
3
meson.build
Normal file
@ -0,0 +1,3 @@
|
||||
project('tuxclocker')
|
||||
|
||||
subdir('src')
|
56
src/include/tc_assignable.h
Normal file
56
src/include/tc_assignable.h
Normal file
@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* Defines the interface for modifying writable properties in controlled hardware.
|
||||
It is a tree structure provided by a module. */
|
||||
|
||||
enum tc_assignable_value_category {TC_ASSIGNABLE_RANGE, TC_ASSIGNABLE_ENUM};
|
||||
|
||||
// Is the range double or integer
|
||||
enum tc_assignable_range_data_type {TC_ASSIGNABLE_RANGE_INT, TC_ASSIGNABLE_RANGE_DOUBLE};
|
||||
|
||||
typedef struct tc_assignable_range_double_t{
|
||||
double min, max;
|
||||
} tc_assignable_range_double_t;
|
||||
|
||||
typedef struct tc_assignable_range_int_t{
|
||||
int64_t min, max;
|
||||
} tc_assignable_range_int_t;
|
||||
|
||||
typedef struct {
|
||||
enum tc_assignable_range_data_type range_data_type;
|
||||
union {
|
||||
tc_assignable_range_double_t double_range;
|
||||
tc_assignable_range_int_t int_range;
|
||||
};
|
||||
} tc_assignable_range_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t property_count;
|
||||
char **properties;
|
||||
} tc_assignable_enum_t;
|
||||
|
||||
|
||||
|
||||
typedef struct tc_assignable_node_t {
|
||||
// Assignable name eg. fan speed
|
||||
char *name;
|
||||
// Unit for assignable
|
||||
char *unit;
|
||||
|
||||
bool assignable;
|
||||
// Callback for assignment
|
||||
int8_t (*assign_callback)();
|
||||
|
||||
// Possible values for tunables are either values from a range or enumerations
|
||||
enum tc_assignable_value_category value_category;
|
||||
union {
|
||||
tc_assignable_enum_t enum_info;
|
||||
tc_assignable_range_t range_info;
|
||||
};
|
||||
|
||||
uint16_t children_count;
|
||||
struct tc_assignable_node_t **children_nodes;
|
||||
} tc_assignable_node_t;
|
7
src/include/tc_module.h
Normal file
7
src/include/tc_module.h
Normal file
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct tc_module_t {
|
||||
|
||||
} tc_module_t;
|
1
src/meson.build
Normal file
1
src/meson.build
Normal file
@ -0,0 +1 @@
|
||||
subdir('modules')
|
1
src/modules/assignable/meson.build
Normal file
1
src/modules/assignable/meson.build
Normal file
@ -0,0 +1 @@
|
||||
shared_library('libnvidia', 'nvidia.c')
|
5
src/modules/assignable/nvidia.c
Normal file
5
src/modules/assignable/nvidia.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "/opt/cuda/include/nvml.h"
|
||||
|
||||
#define MAX_GPUS 32
|
||||
|
||||
static nvmlDevice_t nvml_handles[MAX_GPUS];
|
1
src/modules/meson.build
Normal file
1
src/modules/meson.build
Normal file
@ -0,0 +1 @@
|
||||
subdir('assignable')
|
Loading…
Reference in New Issue
Block a user