Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/soc/actmon.h
1476 views
1
/*
2
* Activity Monitor driver for Tegra X1
3
*
4
* Copyright (c) 2021 CTCaer
5
*
6
* This program is free software; you can redistribute it and/or modify it
7
* under the terms and conditions of the GNU General Public License,
8
* version 2, as published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
* more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef __ACTMON_H_
20
#define __ACTMON_H_
21
22
#include <utils/types.h>
23
24
typedef enum _actmon_dev_t
25
{
26
ACTMON_DEV_CPU,
27
ACTMON_DEV_BPMP,
28
ACTMON_DEV_AHB,
29
ACTMON_DEV_APB,
30
ACTMON_DEV_CPU_FREQ,
31
ACTMON_DEV_MC_ALL,
32
ACTMON_DEV_MC_CPU,
33
34
ACTMON_DEV_NUM,
35
} actmon_dev_t;
36
37
typedef enum _actmon_hist_src_t
38
{
39
ACTMON_HIST_SRC_NONE = 0,
40
ACTMON_HIST_SRC_AHB = 1,
41
ACTMON_HIST_SRC_APB = 2,
42
ACTMON_HIST_SRC_BPMP = 3,
43
ACTMON_HIST_SRC_CPU = 4,
44
ACTMON_HIST_SRC_MC_ALL = 5,
45
ACTMON_HIST_SRC_MC_CPU = 6,
46
ACTMON_HIST_SRC_CPU_FREQ = 7,
47
ACTMON_HIST_SRC_NA = 8,
48
ACTMON_HIST_SRC_APB_MMIO = 9,
49
} actmon_hist_src_t;
50
51
void actmon_hist_enable(actmon_hist_src_t src);
52
void actmon_hist_disable();
53
void actmon_hist_get(u32 *histogram);
54
void actmon_dev_enable(actmon_dev_t dev);
55
void actmon_dev_disable(actmon_dev_t dev);
56
u32 actmon_dev_get_load(actmon_dev_t dev);
57
u32 actmon_dev_get_load_avg(actmon_dev_t dev);
58
void atmon_dev_all_disable();
59
void actmon_init();
60
void actmon_end();
61
62
#endif
63