Path: blob/main/sys/tools/syscalls/examples/cpp/test_systrace_args.c
39530 views
/*1* System call argument to DTrace register array conversion.2*3* This file is part of the DTrace syscall provider.4*5* DO NOT EDIT-- this file is automatically @generated.6*/78static void9systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)10{11int64_t *iarg = (int64_t *)uarg;12int a = 0;13switch (sysnum) {14#ifdef PLATFORM_FOO15/* syscall1 */16case 1: {17struct syscall1_args *p = params;18iarg[a++] = p->arg1; /* int */19*n_args = 1;20break;21}22#else23#endif24#ifdef PLATFORM_FOO25#else26/* syscall2 */27case 2: {28*n_args = 0;29break;30}31#endif32default:33*n_args = 0;34break;35};36}37static void38systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)39{40const char *p = NULL;41switch (sysnum) {42#ifdef PLATFORM_FOO43/* syscall1 */44case 1:45switch (ndx) {46case 0:47p = "int";48break;49default:50break;51};52break;53#else54#endif55#ifdef PLATFORM_FOO56#else57/* syscall2 */58case 2:59break;60#endif61default:62break;63};64if (p != NULL)65strlcpy(desc, p, descsz);66}67static void68systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)69{70const char *p = NULL;71switch (sysnum) {72#ifdef PLATFORM_FOO73/* syscall1 */74case 1:75if (ndx == 0 || ndx == 1)76p = "int";77break;78#else79#endif80#ifdef PLATFORM_FOO81#else82/* syscall2 */83case 2:84#endif85default:86break;87};88if (p != NULL)89strlcpy(desc, p, descsz);90}919293