#ifndef WH_SYSENT_H_37c76f95_ #define WH_SYSENT_H_37c76f95_ #include #include typedef struct sysent SYSENT; typedef struct scargs SCARGS; /* * A possible syscall. * * The args/rv strings are interpreted by print_syscall_values(), in * sysent.c. The format items: * * d 32-bit value, printed as signed decimal. * p 32-bit pointer, printed as hex. * x 32-bit integer, printed as hex. * b 32-bit value, printed in hex and decimal. * s (Pointer to) a string, printed as a string. * o 32-bit value, printed as unsigned octal. * - The argument is padding and is ignored. * O Special-case hack for open(): if the second arg has * O_CREAT set, this turns into o, otherwise it is not * referenced and prints as "...". * D Two 32-bit values forming a 64-bit value, printed in * 64-bit signed decimal. * m Two 32-bit values, a pointer-and-length describing a * list of 32-bit values (sysctl's MIB args). * (STR) A 32-bit value. STR is a short built-in name * indicating what table should be used to look values * up in. The list is too long to keep up-to-date here; * see print_special() and the functions it calls, in * sysent.c, for details. * * In addition, if the rv string is "V", the syscall returns no useful * value ("void"). */ struct sysent { const char *name; const char *rv; const char *args; } ; #define SYSINIT(name,rv,args) [em_SYS_##name] = { #name, rv, args } /* * A list of syscall values. These were originally used for just * arguments, hence the name. These are still used for arguments, but * are also used for other things, such as return values. * * If sp is zero, there are no more values than setmask/regs hold; if * nonzero, there are more values available in (emulated) RAM. nreg * is the number of regs[] values that are meaningful; values beyond * that are in memory (sp nonzero) or nonexistent (sp zero). */ struct scargs { int nreg; uint32_t regs[6]; uint32_t sp; } ; extern SYSENT sysent[]; extern const int nsysent; extern void print_syscall_values(FILE *, const char *, SCARGS *); extern void print_decoded_ioctl(FILE *, uint32_t); // scarg() is actually from user.c; it's here to be with SCARGS. extern uint32_t scarg(SCARGS *, int); #endif