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