• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
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>
23 enum 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 };
31 enum counter_scope {
32   COUNTER_SCOPE_DEVICE,
33   COUNTER_SCOPE_SIGNAL,
34   COUNTER_SCOPE_COUNT,
35 };
36 struct counter_component {
37   __u8 type;
38   __u8 scope;
39   __u8 parent;
40   __u8 id;
41 };
42 enum counter_event_type {
43   COUNTER_EVENT_OVERFLOW,
44   COUNTER_EVENT_UNDERFLOW,
45   COUNTER_EVENT_OVERFLOW_UNDERFLOW,
46   COUNTER_EVENT_THRESHOLD,
47   COUNTER_EVENT_INDEX,
48 };
49 struct counter_watch {
50   struct counter_component component;
51   __u8 event;
52   __u8 channel;
53 };
54 #define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x00, struct counter_watch)
55 #define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E, 0x01)
56 #define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E, 0x02)
57 struct counter_event {
58   __aligned_u64 timestamp;
59   __aligned_u64 value;
60   struct counter_watch watch;
61   __u8 status;
62 };
63 enum counter_count_direction {
64   COUNTER_COUNT_DIRECTION_FORWARD,
65   COUNTER_COUNT_DIRECTION_BACKWARD,
66 };
67 enum counter_count_mode {
68   COUNTER_COUNT_MODE_NORMAL,
69   COUNTER_COUNT_MODE_RANGE_LIMIT,
70   COUNTER_COUNT_MODE_NON_RECYCLE,
71   COUNTER_COUNT_MODE_MODULO_N,
72 };
73 enum counter_function {
74   COUNTER_FUNCTION_INCREASE,
75   COUNTER_FUNCTION_DECREASE,
76   COUNTER_FUNCTION_PULSE_DIRECTION,
77   COUNTER_FUNCTION_QUADRATURE_X1_A,
78   COUNTER_FUNCTION_QUADRATURE_X1_B,
79   COUNTER_FUNCTION_QUADRATURE_X2_A,
80   COUNTER_FUNCTION_QUADRATURE_X2_B,
81   COUNTER_FUNCTION_QUADRATURE_X4,
82 };
83 enum counter_signal_level {
84   COUNTER_SIGNAL_LEVEL_LOW,
85   COUNTER_SIGNAL_LEVEL_HIGH,
86 };
87 enum counter_synapse_action {
88   COUNTER_SYNAPSE_ACTION_NONE,
89   COUNTER_SYNAPSE_ACTION_RISING_EDGE,
90   COUNTER_SYNAPSE_ACTION_FALLING_EDGE,
91   COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
92 };
93 #endif
94