| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 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, | 
| Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 48 | COUNTER_EVENT_CHANGE_OF_STATE, | 
| Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 49 | COUNTER_EVENT_CAPTURE, | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 50 | }; | 
|  | 51 | struct 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) | 
|  | 59 | struct counter_event { | 
|  | 60 | __aligned_u64 timestamp; | 
|  | 61 | __aligned_u64 value; | 
|  | 62 | struct counter_watch watch; | 
|  | 63 | __u8 status; | 
|  | 64 | }; | 
|  | 65 | enum counter_count_direction { | 
|  | 66 | COUNTER_COUNT_DIRECTION_FORWARD, | 
|  | 67 | COUNTER_COUNT_DIRECTION_BACKWARD, | 
|  | 68 | }; | 
|  | 69 | enum 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 | }; | 
|  | 75 | enum 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 | }; | 
|  | 85 | enum counter_signal_level { | 
|  | 86 | COUNTER_SIGNAL_LEVEL_LOW, | 
|  | 87 | COUNTER_SIGNAL_LEVEL_HIGH, | 
|  | 88 | }; | 
|  | 89 | enum 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 Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 95 | enum counter_signal_polarity { | 
|  | 96 | COUNTER_SIGNAL_POLARITY_POSITIVE, | 
|  | 97 | COUNTER_SIGNAL_POLARITY_NEGATIVE, | 
|  | 98 | }; | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 99 | #endif |