Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 7 | #ifndef _UAPI_COUNTER_H_ |
| 8 | #define _UAPI_COUNTER_H_ |
| 9 | #include <linux/ioctl.h> |
| 10 | #include <linux/types.h> |
| 11 | enum counter_component_type { |
| 12 | COUNTER_COMPONENT_NONE, |
| 13 | COUNTER_COMPONENT_SIGNAL, |
| 14 | COUNTER_COMPONENT_COUNT, |
| 15 | COUNTER_COMPONENT_FUNCTION, |
| 16 | COUNTER_COMPONENT_SYNAPSE_ACTION, |
| 17 | COUNTER_COMPONENT_EXTENSION, |
| 18 | }; |
| 19 | enum counter_scope { |
| 20 | COUNTER_SCOPE_DEVICE, |
| 21 | COUNTER_SCOPE_SIGNAL, |
| 22 | COUNTER_SCOPE_COUNT, |
| 23 | }; |
| 24 | struct counter_component { |
| 25 | __u8 type; |
| 26 | __u8 scope; |
| 27 | __u8 parent; |
| 28 | __u8 id; |
| 29 | }; |
| 30 | enum counter_event_type { |
| 31 | COUNTER_EVENT_OVERFLOW, |
| 32 | COUNTER_EVENT_UNDERFLOW, |
| 33 | COUNTER_EVENT_OVERFLOW_UNDERFLOW, |
| 34 | COUNTER_EVENT_THRESHOLD, |
| 35 | COUNTER_EVENT_INDEX, |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 36 | COUNTER_EVENT_CHANGE_OF_STATE, |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 37 | COUNTER_EVENT_CAPTURE, |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 38 | }; |
| 39 | struct counter_watch { |
| 40 | struct counter_component component; |
| 41 | __u8 event; |
| 42 | __u8 channel; |
| 43 | }; |
| 44 | #define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x00, struct counter_watch) |
| 45 | #define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E, 0x01) |
| 46 | #define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E, 0x02) |
| 47 | struct counter_event { |
| 48 | __aligned_u64 timestamp; |
| 49 | __aligned_u64 value; |
| 50 | struct counter_watch watch; |
| 51 | __u8 status; |
| 52 | }; |
| 53 | enum counter_count_direction { |
| 54 | COUNTER_COUNT_DIRECTION_FORWARD, |
| 55 | COUNTER_COUNT_DIRECTION_BACKWARD, |
| 56 | }; |
| 57 | enum counter_count_mode { |
| 58 | COUNTER_COUNT_MODE_NORMAL, |
| 59 | COUNTER_COUNT_MODE_RANGE_LIMIT, |
| 60 | COUNTER_COUNT_MODE_NON_RECYCLE, |
| 61 | COUNTER_COUNT_MODE_MODULO_N, |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 62 | COUNTER_COUNT_MODE_INTERRUPT_ON_TERMINAL_COUNT, |
| 63 | COUNTER_COUNT_MODE_HARDWARE_RETRIGGERABLE_ONESHOT, |
| 64 | COUNTER_COUNT_MODE_RATE_GENERATOR, |
| 65 | COUNTER_COUNT_MODE_SQUARE_WAVE_MODE, |
| 66 | COUNTER_COUNT_MODE_SOFTWARE_TRIGGERED_STROBE, |
| 67 | COUNTER_COUNT_MODE_HARDWARE_TRIGGERED_STROBE, |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 68 | }; |
| 69 | enum counter_function { |
| 70 | COUNTER_FUNCTION_INCREASE, |
| 71 | COUNTER_FUNCTION_DECREASE, |
| 72 | COUNTER_FUNCTION_PULSE_DIRECTION, |
| 73 | COUNTER_FUNCTION_QUADRATURE_X1_A, |
| 74 | COUNTER_FUNCTION_QUADRATURE_X1_B, |
| 75 | COUNTER_FUNCTION_QUADRATURE_X2_A, |
| 76 | COUNTER_FUNCTION_QUADRATURE_X2_B, |
| 77 | COUNTER_FUNCTION_QUADRATURE_X4, |
| 78 | }; |
| 79 | enum counter_signal_level { |
| 80 | COUNTER_SIGNAL_LEVEL_LOW, |
| 81 | COUNTER_SIGNAL_LEVEL_HIGH, |
| 82 | }; |
| 83 | enum counter_synapse_action { |
| 84 | COUNTER_SYNAPSE_ACTION_NONE, |
| 85 | COUNTER_SYNAPSE_ACTION_RISING_EDGE, |
| 86 | COUNTER_SYNAPSE_ACTION_FALLING_EDGE, |
| 87 | COUNTER_SYNAPSE_ACTION_BOTH_EDGES, |
| 88 | }; |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 89 | enum counter_signal_polarity { |
| 90 | COUNTER_SIGNAL_POLARITY_POSITIVE, |
| 91 | COUNTER_SIGNAL_POLARITY_NEGATIVE, |
| 92 | }; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 93 | #endif |