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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
|
/* auto-generated by gen_syscalls.py, don't edit */
#ifndef Z_INCLUDE_SYSCALLS_COUNTER_H
#define Z_INCLUDE_SYSCALLS_COUNTER_H
#include <zephyr/tracing/tracing_syscall.h>
#ifndef _ASMLANGUAGE
#include <stdarg.h>
#include <syscall_list.h>
#include <zephyr/syscall.h>
#include <zephyr/linker/sections.h>
#ifdef __cplusplus
extern "C" {
#endif
extern bool z_impl_counter_is_counting_up(const struct device * dev);
__pinned_func
static inline bool counter_is_counting_up(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (bool) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_IS_COUNTING_UP);
}
#endif
compiler_barrier();
return z_impl_counter_is_counting_up(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_is_counting_up(dev) ({ bool syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_IS_COUNTING_UP, counter_is_counting_up, dev); syscall__retval = counter_is_counting_up(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_IS_COUNTING_UP, counter_is_counting_up, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern uint8_t z_impl_counter_get_num_of_channels(const struct device * dev);
__pinned_func
static inline uint8_t counter_get_num_of_channels(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (uint8_t) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_GET_NUM_OF_CHANNELS);
}
#endif
compiler_barrier();
return z_impl_counter_get_num_of_channels(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_num_of_channels(dev) ({ uint8_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_NUM_OF_CHANNELS, counter_get_num_of_channels, dev); syscall__retval = counter_get_num_of_channels(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_NUM_OF_CHANNELS, counter_get_num_of_channels, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern uint32_t z_impl_counter_get_frequency(const struct device * dev);
__pinned_func
static inline uint32_t counter_get_frequency(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (uint32_t) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_GET_FREQUENCY);
}
#endif
compiler_barrier();
return z_impl_counter_get_frequency(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_frequency(dev) ({ uint32_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_FREQUENCY, counter_get_frequency, dev); syscall__retval = counter_get_frequency(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_FREQUENCY, counter_get_frequency, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern uint32_t z_impl_counter_us_to_ticks(const struct device * dev, uint64_t us);
__pinned_func
static inline uint32_t counter_us_to_ticks(const struct device * dev, uint64_t us)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { struct { uintptr_t lo, hi; } split; uint64_t val; } parm1 = { .val = us };
return (uint32_t) arch_syscall_invoke3(parm0.x, parm1.split.lo, parm1.split.hi, K_SYSCALL_COUNTER_US_TO_TICKS);
}
#endif
compiler_barrier();
return z_impl_counter_us_to_ticks(dev, us);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_us_to_ticks(dev, us) ({ uint32_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_US_TO_TICKS, counter_us_to_ticks, dev, us); syscall__retval = counter_us_to_ticks(dev, us); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_US_TO_TICKS, counter_us_to_ticks, dev, us, syscall__retval); syscall__retval; })
#endif
#endif
extern uint64_t z_impl_counter_ticks_to_us(const struct device * dev, uint32_t ticks);
__pinned_func
static inline uint64_t counter_ticks_to_us(const struct device * dev, uint32_t ticks)
{
#ifdef CONFIG_USERSPACE
uint64_t ret64;
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint32_t val; } parm1 = { .val = ticks };
(void) arch_syscall_invoke3(parm0.x, parm1.x, (uintptr_t)&ret64, K_SYSCALL_COUNTER_TICKS_TO_US);
return (uint64_t) ret64;
}
#endif
compiler_barrier();
return z_impl_counter_ticks_to_us(dev, ticks);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_ticks_to_us(dev, ticks) ({ uint64_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_TICKS_TO_US, counter_ticks_to_us, dev, ticks); syscall__retval = counter_ticks_to_us(dev, ticks); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_TICKS_TO_US, counter_ticks_to_us, dev, ticks, syscall__retval); syscall__retval; })
#endif
#endif
extern uint32_t z_impl_counter_get_max_top_value(const struct device * dev);
__pinned_func
static inline uint32_t counter_get_max_top_value(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (uint32_t) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_GET_MAX_TOP_VALUE);
}
#endif
compiler_barrier();
return z_impl_counter_get_max_top_value(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_max_top_value(dev) ({ uint32_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_MAX_TOP_VALUE, counter_get_max_top_value, dev); syscall__retval = counter_get_max_top_value(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_MAX_TOP_VALUE, counter_get_max_top_value, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_start(const struct device * dev);
__pinned_func
static inline int counter_start(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (int) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_START);
}
#endif
compiler_barrier();
return z_impl_counter_start(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_start(dev) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_START, counter_start, dev); syscall__retval = counter_start(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_START, counter_start, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_stop(const struct device * dev);
__pinned_func
static inline int counter_stop(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (int) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_STOP);
}
#endif
compiler_barrier();
return z_impl_counter_stop(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_stop(dev) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_STOP, counter_stop, dev); syscall__retval = counter_stop(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_STOP, counter_stop, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_get_value(const struct device * dev, uint32_t * ticks);
__pinned_func
static inline int counter_get_value(const struct device * dev, uint32_t * ticks)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint32_t * val; } parm1 = { .val = ticks };
return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_COUNTER_GET_VALUE);
}
#endif
compiler_barrier();
return z_impl_counter_get_value(dev, ticks);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_value(dev, ticks) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_VALUE, counter_get_value, dev, ticks); syscall__retval = counter_get_value(dev, ticks); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_VALUE, counter_get_value, dev, ticks, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_get_value_64(const struct device * dev, uint64_t * ticks);
__pinned_func
static inline int counter_get_value_64(const struct device * dev, uint64_t * ticks)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint64_t * val; } parm1 = { .val = ticks };
return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_COUNTER_GET_VALUE_64);
}
#endif
compiler_barrier();
return z_impl_counter_get_value_64(dev, ticks);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_value_64(dev, ticks) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_VALUE_64, counter_get_value_64, dev, ticks); syscall__retval = counter_get_value_64(dev, ticks); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_VALUE_64, counter_get_value_64, dev, ticks, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_set_channel_alarm(const struct device * dev, uint8_t chan_id, const struct counter_alarm_cfg * alarm_cfg);
__pinned_func
static inline int counter_set_channel_alarm(const struct device * dev, uint8_t chan_id, const struct counter_alarm_cfg * alarm_cfg)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint8_t val; } parm1 = { .val = chan_id };
union { uintptr_t x; const struct counter_alarm_cfg * val; } parm2 = { .val = alarm_cfg };
return (int) arch_syscall_invoke3(parm0.x, parm1.x, parm2.x, K_SYSCALL_COUNTER_SET_CHANNEL_ALARM);
}
#endif
compiler_barrier();
return z_impl_counter_set_channel_alarm(dev, chan_id, alarm_cfg);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_set_channel_alarm(dev, chan_id, alarm_cfg) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_SET_CHANNEL_ALARM, counter_set_channel_alarm, dev, chan_id, alarm_cfg); syscall__retval = counter_set_channel_alarm(dev, chan_id, alarm_cfg); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_SET_CHANNEL_ALARM, counter_set_channel_alarm, dev, chan_id, alarm_cfg, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_cancel_channel_alarm(const struct device * dev, uint8_t chan_id);
__pinned_func
static inline int counter_cancel_channel_alarm(const struct device * dev, uint8_t chan_id)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint8_t val; } parm1 = { .val = chan_id };
return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_COUNTER_CANCEL_CHANNEL_ALARM);
}
#endif
compiler_barrier();
return z_impl_counter_cancel_channel_alarm(dev, chan_id);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_cancel_channel_alarm(dev, chan_id) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_CANCEL_CHANNEL_ALARM, counter_cancel_channel_alarm, dev, chan_id); syscall__retval = counter_cancel_channel_alarm(dev, chan_id); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_CANCEL_CHANNEL_ALARM, counter_cancel_channel_alarm, dev, chan_id, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_set_top_value(const struct device * dev, const struct counter_top_cfg * cfg);
__pinned_func
static inline int counter_set_top_value(const struct device * dev, const struct counter_top_cfg * cfg)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; const struct counter_top_cfg * val; } parm1 = { .val = cfg };
return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_COUNTER_SET_TOP_VALUE);
}
#endif
compiler_barrier();
return z_impl_counter_set_top_value(dev, cfg);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_set_top_value(dev, cfg) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_SET_TOP_VALUE, counter_set_top_value, dev, cfg); syscall__retval = counter_set_top_value(dev, cfg); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_SET_TOP_VALUE, counter_set_top_value, dev, cfg, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_get_pending_int(const struct device * dev);
__pinned_func
static inline int counter_get_pending_int(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (int) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_GET_PENDING_INT);
}
#endif
compiler_barrier();
return z_impl_counter_get_pending_int(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_pending_int(dev) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_PENDING_INT, counter_get_pending_int, dev); syscall__retval = counter_get_pending_int(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_PENDING_INT, counter_get_pending_int, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern uint32_t z_impl_counter_get_top_value(const struct device * dev);
__pinned_func
static inline uint32_t counter_get_top_value(const struct device * dev)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
return (uint32_t) arch_syscall_invoke1(parm0.x, K_SYSCALL_COUNTER_GET_TOP_VALUE);
}
#endif
compiler_barrier();
return z_impl_counter_get_top_value(dev);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_top_value(dev) ({ uint32_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_TOP_VALUE, counter_get_top_value, dev); syscall__retval = counter_get_top_value(dev); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_TOP_VALUE, counter_get_top_value, dev, syscall__retval); syscall__retval; })
#endif
#endif
extern int z_impl_counter_set_guard_period(const struct device * dev, uint32_t ticks, uint32_t flags);
__pinned_func
static inline int counter_set_guard_period(const struct device * dev, uint32_t ticks, uint32_t flags)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint32_t val; } parm1 = { .val = ticks };
union { uintptr_t x; uint32_t val; } parm2 = { .val = flags };
return (int) arch_syscall_invoke3(parm0.x, parm1.x, parm2.x, K_SYSCALL_COUNTER_SET_GUARD_PERIOD);
}
#endif
compiler_barrier();
return z_impl_counter_set_guard_period(dev, ticks, flags);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_set_guard_period(dev, ticks, flags) ({ int syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_SET_GUARD_PERIOD, counter_set_guard_period, dev, ticks, flags); syscall__retval = counter_set_guard_period(dev, ticks, flags); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_SET_GUARD_PERIOD, counter_set_guard_period, dev, ticks, flags, syscall__retval); syscall__retval; })
#endif
#endif
extern uint32_t z_impl_counter_get_guard_period(const struct device * dev, uint32_t flags);
__pinned_func
static inline uint32_t counter_get_guard_period(const struct device * dev, uint32_t flags)
{
#ifdef CONFIG_USERSPACE
if (z_syscall_trap()) {
union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
union { uintptr_t x; uint32_t val; } parm1 = { .val = flags };
return (uint32_t) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_COUNTER_GET_GUARD_PERIOD);
}
#endif
compiler_barrier();
return z_impl_counter_get_guard_period(dev, flags);
}
#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING
#define counter_get_guard_period(dev, flags) ({ uint32_t syscall__retval; sys_port_trace_syscall_enter(K_SYSCALL_COUNTER_GET_GUARD_PERIOD, counter_get_guard_period, dev, flags); syscall__retval = counter_get_guard_period(dev, flags); sys_port_trace_syscall_exit(K_SYSCALL_COUNTER_GET_GUARD_PERIOD, counter_get_guard_period, dev, flags, syscall__retval); syscall__retval; })
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif /* include guard */
|