~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/counter.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/counter.h (Architecture m68k) and /include/uapi/linux/counter.h (Architecture ppc)


  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux      1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /*                                                  2 /*
  3  * Userspace ABI for Counter character devices      3  * Userspace ABI for Counter character devices
  4  * Copyright (C) 2020 William Breathitt Gray        4  * Copyright (C) 2020 William Breathitt Gray
  5  */                                                 5  */
  6 #ifndef _UAPI_COUNTER_H_                            6 #ifndef _UAPI_COUNTER_H_
  7 #define _UAPI_COUNTER_H_                            7 #define _UAPI_COUNTER_H_
  8                                                     8 
  9 #include <linux/ioctl.h>                            9 #include <linux/ioctl.h>
 10 #include <linux/types.h>                           10 #include <linux/types.h>
 11                                                    11 
 12 /* Component type definitions */                   12 /* Component type definitions */
 13 enum counter_component_type {                      13 enum counter_component_type {
 14         COUNTER_COMPONENT_NONE,                    14         COUNTER_COMPONENT_NONE,
 15         COUNTER_COMPONENT_SIGNAL,                  15         COUNTER_COMPONENT_SIGNAL,
 16         COUNTER_COMPONENT_COUNT,                   16         COUNTER_COMPONENT_COUNT,
 17         COUNTER_COMPONENT_FUNCTION,                17         COUNTER_COMPONENT_FUNCTION,
 18         COUNTER_COMPONENT_SYNAPSE_ACTION,          18         COUNTER_COMPONENT_SYNAPSE_ACTION,
 19         COUNTER_COMPONENT_EXTENSION,               19         COUNTER_COMPONENT_EXTENSION,
 20 };                                                 20 };
 21                                                    21 
 22 /* Component scope definitions */                  22 /* Component scope definitions */
 23 enum counter_scope {                               23 enum counter_scope {
 24         COUNTER_SCOPE_DEVICE,                      24         COUNTER_SCOPE_DEVICE,
 25         COUNTER_SCOPE_SIGNAL,                      25         COUNTER_SCOPE_SIGNAL,
 26         COUNTER_SCOPE_COUNT,                       26         COUNTER_SCOPE_COUNT,
 27 };                                                 27 };
 28                                                    28 
 29 /**                                                29 /**
 30  * struct counter_component - Counter componen     30  * struct counter_component - Counter component identification
 31  * @type: component type (one of enum counter_     31  * @type: component type (one of enum counter_component_type)
 32  * @scope: component scope (one of enum counte     32  * @scope: component scope (one of enum counter_scope)
 33  * @parent: parent ID (matching the ID suffix      33  * @parent: parent ID (matching the ID suffix of the respective parent sysfs
 34  *          path as described by the ABI docum     34  *          path as described by the ABI documentation file
 35  *          Documentation/ABI/testing/sysfs-bu     35  *          Documentation/ABI/testing/sysfs-bus-counter)
 36  * @id: component ID (matching the ID provided     36  * @id: component ID (matching the ID provided by the respective *_component_id
 37  *      sysfs attribute of the desired compone     37  *      sysfs attribute of the desired component)
 38  *                                                 38  *
 39  * For example, if the Count 2 ceiling extensi     39  * For example, if the Count 2 ceiling extension of Counter device 4 is desired,
 40  * set type equal to COUNTER_COMPONENT_EXTENSI     40  * set type equal to COUNTER_COMPONENT_EXTENSION, scope equal to
 41  * COUNTER_SCOPE_COUNT, parent equal to 2, and     41  * COUNTER_SCOPE_COUNT, parent equal to 2, and id equal to the value provided by
 42  * the respective /sys/bus/counter/devices/cou     42  * the respective /sys/bus/counter/devices/counter4/count2/ceiling_component_id
 43  * sysfs attribute.                                43  * sysfs attribute.
 44  */                                                44  */
 45 struct counter_component {                         45 struct counter_component {
 46         __u8 type;                                 46         __u8 type;
 47         __u8 scope;                                47         __u8 scope;
 48         __u8 parent;                               48         __u8 parent;
 49         __u8 id;                                   49         __u8 id;
 50 };                                                 50 };
 51                                                    51 
 52 /* Event type definitions */                       52 /* Event type definitions */
 53 enum counter_event_type {                          53 enum counter_event_type {
 54         /* Count value increased past ceiling      54         /* Count value increased past ceiling */
 55         COUNTER_EVENT_OVERFLOW,                    55         COUNTER_EVENT_OVERFLOW,
 56         /* Count value decreased past floor */     56         /* Count value decreased past floor */
 57         COUNTER_EVENT_UNDERFLOW,                   57         COUNTER_EVENT_UNDERFLOW,
 58         /* Count value increased past ceiling,     58         /* Count value increased past ceiling, or decreased past floor */
 59         COUNTER_EVENT_OVERFLOW_UNDERFLOW,          59         COUNTER_EVENT_OVERFLOW_UNDERFLOW,
 60         /* Count value reached threshold */        60         /* Count value reached threshold */
 61         COUNTER_EVENT_THRESHOLD,                   61         COUNTER_EVENT_THRESHOLD,
 62         /* Index signal detected */                62         /* Index signal detected */
 63         COUNTER_EVENT_INDEX,                       63         COUNTER_EVENT_INDEX,
 64         /* State of counter is changed */          64         /* State of counter is changed */
 65         COUNTER_EVENT_CHANGE_OF_STATE,             65         COUNTER_EVENT_CHANGE_OF_STATE,
 66         /* Count value captured */                 66         /* Count value captured */
 67         COUNTER_EVENT_CAPTURE,                     67         COUNTER_EVENT_CAPTURE,
 68 };                                                 68 };
 69                                                    69 
 70 /**                                                70 /**
 71  * struct counter_watch - Counter component wa     71  * struct counter_watch - Counter component watch configuration
 72  * @component: component to watch when event t     72  * @component: component to watch when event triggers
 73  * @event: event that triggers (one of enum co     73  * @event: event that triggers (one of enum counter_event_type)
 74  * @channel: event channel (typically 0 unless     74  * @channel: event channel (typically 0 unless the device supports concurrent
 75  *           events of the same type)              75  *           events of the same type)
 76  */                                                76  */
 77 struct counter_watch {                             77 struct counter_watch {
 78         struct counter_component component;        78         struct counter_component component;
 79         __u8 event;                                79         __u8 event;
 80         __u8 channel;                              80         __u8 channel;
 81 };                                                 81 };
 82                                                    82 
 83 /*                                                 83 /*
 84  * Queues a Counter watch for the specified ev     84  * Queues a Counter watch for the specified event.
 85  *                                                 85  *
 86  * The queued watches will not be applied unti     86  * The queued watches will not be applied until COUNTER_ENABLE_EVENTS_IOCTL is
 87  * called.                                         87  * called.
 88  */                                                88  */
 89 #define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x0     89 #define COUNTER_ADD_WATCH_IOCTL _IOW(0x3E, 0x00, struct counter_watch)
 90 /*                                                 90 /*
 91  * Enables monitoring the events specified by      91  * Enables monitoring the events specified by the Counter watches that were
 92  * queued by COUNTER_ADD_WATCH_IOCTL.              92  * queued by COUNTER_ADD_WATCH_IOCTL.
 93  *                                                 93  *
 94  * If events are already enabled, the new set      94  * If events are already enabled, the new set of watches replaces the old one.
 95  * Calling this ioctl also has the effect of c     95  * Calling this ioctl also has the effect of clearing the queue of watches added
 96  * by COUNTER_ADD_WATCH_IOCTL.                     96  * by COUNTER_ADD_WATCH_IOCTL.
 97  */                                                97  */
 98 #define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E,      98 #define COUNTER_ENABLE_EVENTS_IOCTL _IO(0x3E, 0x01)
 99 /*                                                 99 /*
100  * Stops monitoring the previously enabled eve    100  * Stops monitoring the previously enabled events.
101  */                                               101  */
102 #define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E,    102 #define COUNTER_DISABLE_EVENTS_IOCTL _IO(0x3E, 0x02)
103                                                   103 
104 /**                                               104 /**
105  * struct counter_event - Counter event data      105  * struct counter_event - Counter event data
106  * @timestamp: best estimate of time of event     106  * @timestamp: best estimate of time of event occurrence, in nanoseconds
107  * @value: component value                        107  * @value: component value
108  * @watch: component watch configuration          108  * @watch: component watch configuration
109  * @status: return status (system error number    109  * @status: return status (system error number)
110  */                                               110  */
111 struct counter_event {                            111 struct counter_event {
112         __aligned_u64 timestamp;                  112         __aligned_u64 timestamp;
113         __aligned_u64 value;                      113         __aligned_u64 value;
114         struct counter_watch watch;               114         struct counter_watch watch;
115         __u8 status;                              115         __u8 status;
116 };                                                116 };
117                                                   117 
118 /* Count direction values */                      118 /* Count direction values */
119 enum counter_count_direction {                    119 enum counter_count_direction {
120         COUNTER_COUNT_DIRECTION_FORWARD,          120         COUNTER_COUNT_DIRECTION_FORWARD,
121         COUNTER_COUNT_DIRECTION_BACKWARD,         121         COUNTER_COUNT_DIRECTION_BACKWARD,
122 };                                                122 };
123                                                   123 
124 /* Count mode values */                           124 /* Count mode values */
125 enum counter_count_mode {                         125 enum counter_count_mode {
126         COUNTER_COUNT_MODE_NORMAL,                126         COUNTER_COUNT_MODE_NORMAL,
127         COUNTER_COUNT_MODE_RANGE_LIMIT,           127         COUNTER_COUNT_MODE_RANGE_LIMIT,
128         COUNTER_COUNT_MODE_NON_RECYCLE,           128         COUNTER_COUNT_MODE_NON_RECYCLE,
129         COUNTER_COUNT_MODE_MODULO_N,              129         COUNTER_COUNT_MODE_MODULO_N,
130         COUNTER_COUNT_MODE_INTERRUPT_ON_TERMIN    130         COUNTER_COUNT_MODE_INTERRUPT_ON_TERMINAL_COUNT,
131         COUNTER_COUNT_MODE_HARDWARE_RETRIGGERA    131         COUNTER_COUNT_MODE_HARDWARE_RETRIGGERABLE_ONESHOT,
132         COUNTER_COUNT_MODE_RATE_GENERATOR,        132         COUNTER_COUNT_MODE_RATE_GENERATOR,
133         COUNTER_COUNT_MODE_SQUARE_WAVE_MODE,      133         COUNTER_COUNT_MODE_SQUARE_WAVE_MODE,
134         COUNTER_COUNT_MODE_SOFTWARE_TRIGGERED_    134         COUNTER_COUNT_MODE_SOFTWARE_TRIGGERED_STROBE,
135         COUNTER_COUNT_MODE_HARDWARE_TRIGGERED_    135         COUNTER_COUNT_MODE_HARDWARE_TRIGGERED_STROBE,
136 };                                                136 };
137                                                   137 
138 /* Count function values */                       138 /* Count function values */
139 enum counter_function {                           139 enum counter_function {
140         COUNTER_FUNCTION_INCREASE,                140         COUNTER_FUNCTION_INCREASE,
141         COUNTER_FUNCTION_DECREASE,                141         COUNTER_FUNCTION_DECREASE,
142         COUNTER_FUNCTION_PULSE_DIRECTION,         142         COUNTER_FUNCTION_PULSE_DIRECTION,
143         COUNTER_FUNCTION_QUADRATURE_X1_A,         143         COUNTER_FUNCTION_QUADRATURE_X1_A,
144         COUNTER_FUNCTION_QUADRATURE_X1_B,         144         COUNTER_FUNCTION_QUADRATURE_X1_B,
145         COUNTER_FUNCTION_QUADRATURE_X2_A,         145         COUNTER_FUNCTION_QUADRATURE_X2_A,
146         COUNTER_FUNCTION_QUADRATURE_X2_B,         146         COUNTER_FUNCTION_QUADRATURE_X2_B,
147         COUNTER_FUNCTION_QUADRATURE_X4,           147         COUNTER_FUNCTION_QUADRATURE_X4,
148 };                                                148 };
149                                                   149 
150 /* Signal values */                               150 /* Signal values */
151 enum counter_signal_level {                       151 enum counter_signal_level {
152         COUNTER_SIGNAL_LEVEL_LOW,                 152         COUNTER_SIGNAL_LEVEL_LOW,
153         COUNTER_SIGNAL_LEVEL_HIGH,                153         COUNTER_SIGNAL_LEVEL_HIGH,
154 };                                                154 };
155                                                   155 
156 /* Action mode values */                          156 /* Action mode values */
157 enum counter_synapse_action {                     157 enum counter_synapse_action {
158         COUNTER_SYNAPSE_ACTION_NONE,              158         COUNTER_SYNAPSE_ACTION_NONE,
159         COUNTER_SYNAPSE_ACTION_RISING_EDGE,       159         COUNTER_SYNAPSE_ACTION_RISING_EDGE,
160         COUNTER_SYNAPSE_ACTION_FALLING_EDGE,      160         COUNTER_SYNAPSE_ACTION_FALLING_EDGE,
161         COUNTER_SYNAPSE_ACTION_BOTH_EDGES,        161         COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
162 };                                                162 };
163                                                   163 
164 /* Signal polarity values */                      164 /* Signal polarity values */
165 enum counter_signal_polarity {                    165 enum counter_signal_polarity {
166         COUNTER_SIGNAL_POLARITY_POSITIVE,         166         COUNTER_SIGNAL_POLARITY_POSITIVE,
167         COUNTER_SIGNAL_POLARITY_NEGATIVE,         167         COUNTER_SIGNAL_POLARITY_NEGATIVE,
168 };                                                168 };
169                                                   169 
170 #endif /* _UAPI_COUNTER_H_ */                     170 #endif /* _UAPI_COUNTER_H_ */
171                                                   171 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php