]> granicus.if.org Git - sysstat/blob - rd_sensors.h
Merge pull request from GHSA-q8r6-g56f-9w7x
[sysstat] / rd_sensors.h
1 /*
2  * rd_sensors.h: Include file used to read sensors statistics
3  * (C) 1999-2022 by Sebastien Godard (sysstat <at> orange.fr)
4  */
5
6 #ifndef _RD_SENSORS_H
7 #define _RD_SENSORS_H
8
9 /*
10  ***************************************************************************
11  * Definitions of structures for sensors statistics
12  ***************************************************************************
13  */
14
15 /*
16  * Structure for fan statistics.
17  */
18 struct stats_pwr_fan {
19         double  rpm                             __attribute__ ((aligned (8)));
20         double  rpm_min                         __attribute__ ((aligned (8)));
21         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
22 };
23
24 #define STATS_PWR_FAN_SIZE     (sizeof(struct stats_pwr_fan))
25 #define STATS_PWR_FAN_ULL       2
26 #define STATS_PWR_FAN_UL        0
27 #define STATS_PWR_FAN_U         0
28
29 /*
30  * Structure for device temperature statistics.
31  */
32 struct stats_pwr_temp {
33         double  temp                            __attribute__ ((aligned (8)));
34         double  temp_min                        __attribute__ ((aligned (8)));
35         double  temp_max                        __attribute__ ((aligned (8)));
36         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
37 };
38
39 #define STATS_PWR_TEMP_SIZE    (sizeof(struct stats_pwr_temp))
40 #define STATS_PWR_TEMP_ULL      3
41 #define STATS_PWR_TEMP_UL       0
42 #define STATS_PWR_TEMP_U        0
43
44 /*
45  * Structure for voltage inputs statistics.
46  */
47 struct stats_pwr_in {
48         double  in                              __attribute__ ((aligned (8)));
49         double  in_min                          __attribute__ ((aligned (8)));
50         double  in_max                          __attribute__ ((aligned (8)));
51         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
52 };
53
54 #define STATS_PWR_IN_SIZE       (sizeof(struct stats_pwr_in))
55 #define STATS_PWR_IN_ULL        3
56 #define STATS_PWR_IN_UL         0
57 #define STATS_PWR_IN_U          0
58
59 /*
60  ***************************************************************************
61  * Prototypes for functions used to read sensors statistics
62  ***************************************************************************
63  */
64
65 __nr_t read_fan
66         (struct stats_pwr_fan *, __nr_t);
67 __nr_t read_temp
68         (struct stats_pwr_temp *, __nr_t);
69 __nr_t read_in
70         (struct stats_pwr_in *, __nr_t);
71
72 /*
73  ***************************************************************************
74  * Prototypes for functions used to count number of items
75  ***************************************************************************
76  */
77
78 __nr_t get_fan_nr
79         (void);
80 __nr_t get_temp_nr
81         (void);
82 __nr_t get_in_nr
83         (void);
84
85 #endif /* _RD_SENSORS_H */