blob: f986365efc142e773601f1e6b1cde83308f06bb1 [file] [log] [blame]
Christopher Ferrisa4792612022-01-10 13:51:15 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_COUNTER_H_
20#define _UAPI_COUNTER_H_
21#include <linux/ioctl.h>
22#include <linux/types.h>
23enum counter_component_type {
24 COUNTER_COMPONENT_NONE,
25 COUNTER_COMPONENT_SIGNAL,
26 COUNTER_COMPONENT_COUNT,
27 COUNTER_COMPONENT_FUNCTION,
28 COUNTER_COMPONENT_SYNAPSE_ACTION,
29 COUNTER_COMPONENT_EXTENSION,
30};
31enum counter_scope {
32 COUNTER_SCOPE_DEVICE,
33 COUNTER_SCOPE_SIGNAL,
34 COUNTER_SCOPE_COUNT,
35};
36struct counter_component {
37 __u8 type;
38 __u8 scope;
39 __u8 parent;
40 __u8 id;
41};
42enum counter_event_type {
43 COUNTER_EVENT_OVERFLOW,
44 COUNTER_EVENT_UNDERFLOW,
45 COUNTER_EVENT_OVERFLOW_UNDERFLOW,
46 COUNTER_EVENT_THRESHOLD,
47 COUNTER_EVENT_INDEX,
Christopher Ferris10a76e62022-06-08 13:31:52 -070048 COUNTER_EVENT_CHANGE_OF_STATE,
Christopher Ferris6cd53a52022-12-12 23:39:16 +000049 COUNTER_EVENT_CAPTURE,
Christopher Ferrisa4792612022-01-10 13:51:15 -080050};
51struct counter_watch {
52 struct counter_component component;
53 __u8 event;
54 __u8 channel;
55};
56#define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x00, struct counter_watch)
57#define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E, 0x01)
58#define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E, 0x02)
59struct counter_event {
60 __aligned_u64 timestamp;
61 __aligned_u64 value;
62 struct counter_watch watch;
63 __u8 status;
64};
65enum counter_count_direction {
66 COUNTER_COUNT_DIRECTION_FORWARD,
67 COUNTER_COUNT_DIRECTION_BACKWARD,
68};
69enum counter_count_mode {
70 COUNTER_COUNT_MODE_NORMAL,
71 COUNTER_COUNT_MODE_RANGE_LIMIT,
72 COUNTER_COUNT_MODE_NON_RECYCLE,
73 COUNTER_COUNT_MODE_MODULO_N,
74};
75enum counter_function {
76 COUNTER_FUNCTION_INCREASE,
77 COUNTER_FUNCTION_DECREASE,
78 COUNTER_FUNCTION_PULSE_DIRECTION,
79 COUNTER_FUNCTION_QUADRATURE_X1_A,
80 COUNTER_FUNCTION_QUADRATURE_X1_B,
81 COUNTER_FUNCTION_QUADRATURE_X2_A,
82 COUNTER_FUNCTION_QUADRATURE_X2_B,
83 COUNTER_FUNCTION_QUADRATURE_X4,
84};
85enum counter_signal_level {
86 COUNTER_SIGNAL_LEVEL_LOW,
87 COUNTER_SIGNAL_LEVEL_HIGH,
88};
89enum counter_synapse_action {
90 COUNTER_SYNAPSE_ACTION_NONE,
91 COUNTER_SYNAPSE_ACTION_RISING_EDGE,
92 COUNTER_SYNAPSE_ACTION_FALLING_EDGE,
93 COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
94};
Christopher Ferris6cd53a52022-12-12 23:39:16 +000095enum counter_signal_polarity {
96 COUNTER_SIGNAL_POLARITY_POSITIVE,
97 COUNTER_SIGNAL_POLARITY_NEGATIVE,
98};
Christopher Ferrisa4792612022-01-10 13:51:15 -080099#endif