Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/tools/syscalls/examples/cpp/test_systrace_args.c
39530 views
1
/*
2
* System call argument to DTrace register array conversion.
3
*
4
* This file is part of the DTrace syscall provider.
5
*
6
* DO NOT EDIT-- this file is automatically @generated.
7
*/
8
9
static void
10
systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
11
{
12
int64_t *iarg = (int64_t *)uarg;
13
int a = 0;
14
switch (sysnum) {
15
#ifdef PLATFORM_FOO
16
/* syscall1 */
17
case 1: {
18
struct syscall1_args *p = params;
19
iarg[a++] = p->arg1; /* int */
20
*n_args = 1;
21
break;
22
}
23
#else
24
#endif
25
#ifdef PLATFORM_FOO
26
#else
27
/* syscall2 */
28
case 2: {
29
*n_args = 0;
30
break;
31
}
32
#endif
33
default:
34
*n_args = 0;
35
break;
36
};
37
}
38
static void
39
systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
40
{
41
const char *p = NULL;
42
switch (sysnum) {
43
#ifdef PLATFORM_FOO
44
/* syscall1 */
45
case 1:
46
switch (ndx) {
47
case 0:
48
p = "int";
49
break;
50
default:
51
break;
52
};
53
break;
54
#else
55
#endif
56
#ifdef PLATFORM_FOO
57
#else
58
/* syscall2 */
59
case 2:
60
break;
61
#endif
62
default:
63
break;
64
};
65
if (p != NULL)
66
strlcpy(desc, p, descsz);
67
}
68
static void
69
systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
70
{
71
const char *p = NULL;
72
switch (sysnum) {
73
#ifdef PLATFORM_FOO
74
/* syscall1 */
75
case 1:
76
if (ndx == 0 || ndx == 1)
77
p = "int";
78
break;
79
#else
80
#endif
81
#ifdef PLATFORM_FOO
82
#else
83
/* syscall2 */
84
case 2:
85
#endif
86
default:
87
break;
88
};
89
if (p != NULL)
90
strlcpy(desc, p, descsz);
91
}
92
93