Rework syscall structure lookups.
Avoid always using an O(n^2) loop over known syscall structures with strcmp() on each system call. Instead, use a per-ABI cache indexed by the system call number. The first 1024 system calls (which should cover all of the normal system calls in currently-supported ABIs) use a flat array indexed by the system call number to find system call structure. For other system calls, a linked list of structures storing an integer to structure mapping is stored in the ABI. The linked list isn't very smart, but it should only be used by buggy applications invoking unknown system calls. This also fixes handling of unknown system calls which currently trigger a NULL pointer dereference. Reviewed by: kib MFC after: 2 weeks
This commit is contained in:
parent
a1eff92bc8
commit
1175b23f77
@ -80,7 +80,9 @@ static struct procabi aarch64_cloudabi64 = {
|
|||||||
"CloudABI ELF64",
|
"CloudABI ELF64",
|
||||||
SYSDECODE_ABI_CLOUDABI64,
|
SYSDECODE_ABI_CLOUDABI64,
|
||||||
aarch64_cloudabi64_fetch_args,
|
aarch64_cloudabi64_fetch_args,
|
||||||
aarch64_cloudabi64_fetch_retval
|
aarch64_cloudabi64_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(aarch64_cloudabi64.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(aarch64_cloudabi64);
|
PROCABI(aarch64_cloudabi64);
|
||||||
|
@ -102,7 +102,9 @@ static struct procabi aarch64_freebsd = {
|
|||||||
"FreeBSD ELF64",
|
"FreeBSD ELF64",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
aarch64_fetch_args,
|
aarch64_fetch_args,
|
||||||
aarch64_fetch_retval
|
aarch64_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(aarch64_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(aarch64_freebsd);
|
PROCABI(aarch64_freebsd);
|
||||||
|
@ -89,7 +89,9 @@ static struct procabi amd64_cloudabi64 = {
|
|||||||
"CloudABI ELF64",
|
"CloudABI ELF64",
|
||||||
SYSDECODE_ABI_CLOUDABI64,
|
SYSDECODE_ABI_CLOUDABI64,
|
||||||
amd64_cloudabi64_fetch_args,
|
amd64_cloudabi64_fetch_args,
|
||||||
amd64_cloudabi64_fetch_retval
|
amd64_cloudabi64_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(amd64_cloudabi64.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(amd64_cloudabi64);
|
PROCABI(amd64_cloudabi64);
|
||||||
|
@ -124,7 +124,9 @@ static struct procabi amd64_freebsd = {
|
|||||||
"FreeBSD ELF64",
|
"FreeBSD ELF64",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
amd64_fetch_args,
|
amd64_fetch_args,
|
||||||
amd64_fetch_retval
|
amd64_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(amd64_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(amd64_freebsd);
|
PROCABI(amd64_freebsd);
|
||||||
|
@ -120,7 +120,9 @@ static struct procabi amd64_freebsd32 = {
|
|||||||
"FreeBSD ELF32",
|
"FreeBSD ELF32",
|
||||||
SYSDECODE_ABI_FREEBSD32,
|
SYSDECODE_ABI_FREEBSD32,
|
||||||
amd64_freebsd32_fetch_args,
|
amd64_freebsd32_fetch_args,
|
||||||
amd64_freebsd32_fetch_retval
|
amd64_freebsd32_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(amd64_freebsd32);
|
PROCABI(amd64_freebsd32);
|
||||||
@ -129,7 +131,9 @@ static struct procabi amd64_freebsd32_aout = {
|
|||||||
"FreeBSD a.out",
|
"FreeBSD a.out",
|
||||||
SYSDECODE_ABI_FREEBSD32,
|
SYSDECODE_ABI_FREEBSD32,
|
||||||
amd64_freebsd32_fetch_args,
|
amd64_freebsd32_fetch_args,
|
||||||
amd64_freebsd32_fetch_retval
|
amd64_freebsd32_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(amd64_freebsd32_aout);
|
PROCABI(amd64_freebsd32_aout);
|
||||||
|
@ -99,7 +99,9 @@ static struct procabi amd64_linux = {
|
|||||||
"Linux ELF64",
|
"Linux ELF64",
|
||||||
SYSDECODE_ABI_LINUX,
|
SYSDECODE_ABI_LINUX,
|
||||||
amd64_linux_fetch_args,
|
amd64_linux_fetch_args,
|
||||||
amd64_linux_fetch_retval
|
amd64_linux_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(amd64_linux.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(amd64_linux);
|
PROCABI(amd64_linux);
|
||||||
|
@ -109,7 +109,9 @@ static struct procabi amd64_linux32 = {
|
|||||||
"Linux ELF32",
|
"Linux ELF32",
|
||||||
SYSDECODE_ABI_LINUX32,
|
SYSDECODE_ABI_LINUX32,
|
||||||
amd64_linux32_fetch_args,
|
amd64_linux32_fetch_args,
|
||||||
amd64_linux32_fetch_retval
|
amd64_linux32_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(amd64_linux32.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(amd64_linux32);
|
PROCABI(amd64_linux32);
|
||||||
|
@ -131,7 +131,9 @@ static struct procabi arm_freebsd = {
|
|||||||
"FreeBSD ELF32",
|
"FreeBSD ELF32",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
arm_fetch_args,
|
arm_fetch_args,
|
||||||
arm_fetch_retval
|
arm_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(arm_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(arm_freebsd);
|
PROCABI(arm_freebsd);
|
||||||
|
@ -113,7 +113,9 @@ static struct procabi i386_freebsd = {
|
|||||||
"FreeBSD ELF32",
|
"FreeBSD ELF32",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
i386_fetch_args,
|
i386_fetch_args,
|
||||||
i386_fetch_retval
|
i386_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(i386_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(i386_freebsd);
|
PROCABI(i386_freebsd);
|
||||||
@ -122,7 +124,9 @@ static struct procabi i386_freebsd_aout = {
|
|||||||
"FreeBSD a.out",
|
"FreeBSD a.out",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
i386_fetch_args,
|
i386_fetch_args,
|
||||||
i386_fetch_retval
|
i386_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(i386_freebsd_aout.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(i386_freebsd_aout);
|
PROCABI(i386_freebsd_aout);
|
||||||
|
@ -106,7 +106,9 @@ static struct procabi i386_linux = {
|
|||||||
"Linux ELF",
|
"Linux ELF",
|
||||||
SYSDECODE_ABI_LINUX,
|
SYSDECODE_ABI_LINUX,
|
||||||
i386_linux_fetch_args,
|
i386_linux_fetch_args,
|
||||||
i386_linux_fetch_retval
|
i386_linux_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(i386_linux.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(i386_linux);
|
PROCABI(i386_linux);
|
||||||
|
@ -134,7 +134,9 @@ static struct procabi mips_freebsd = {
|
|||||||
#endif
|
#endif
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
mips_fetch_args,
|
mips_fetch_args,
|
||||||
mips_fetch_retval
|
mips_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(mips_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(mips_freebsd);
|
PROCABI(mips_freebsd);
|
||||||
|
@ -115,7 +115,9 @@ static struct procabi powerpc_freebsd = {
|
|||||||
"FreeBSD ELF32",
|
"FreeBSD ELF32",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
powerpc_fetch_args,
|
powerpc_fetch_args,
|
||||||
powerpc_fetch_retval
|
powerpc_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(powerpc_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(powerpc_freebsd);
|
PROCABI(powerpc_freebsd);
|
||||||
|
@ -111,7 +111,9 @@ static struct procabi powerpc64_freebsd = {
|
|||||||
"FreeBSD ELF64",
|
"FreeBSD ELF64",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
powerpc64_fetch_args,
|
powerpc64_fetch_args,
|
||||||
powerpc64_fetch_retval
|
powerpc64_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(powerpc64_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(powerpc64_freebsd);
|
PROCABI(powerpc64_freebsd);
|
||||||
|
@ -120,7 +120,9 @@ static struct procabi powerpc64_freebsd32 = {
|
|||||||
"FreeBSD ELF32",
|
"FreeBSD ELF32",
|
||||||
SYSDECODE_ABI_FREEBSD32,
|
SYSDECODE_ABI_FREEBSD32,
|
||||||
powerpc64_freebsd32_fetch_args,
|
powerpc64_freebsd32_fetch_args,
|
||||||
powerpc64_freebsd32_fetch_retval
|
powerpc64_freebsd32_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(powerpc64_freebsd32.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(powerpc64_freebsd32);
|
PROCABI(powerpc64_freebsd32);
|
||||||
|
@ -344,7 +344,7 @@ alloc_syscall(struct threadinfo *t, struct ptrace_lwpinfo *pl)
|
|||||||
|
|
||||||
assert(t->in_syscall == 0);
|
assert(t->in_syscall == 0);
|
||||||
assert(t->cs.number == 0);
|
assert(t->cs.number == 0);
|
||||||
assert(t->cs.name == NULL);
|
assert(t->cs.sc == NULL);
|
||||||
assert(t->cs.nargs == 0);
|
assert(t->cs.nargs == 0);
|
||||||
for (i = 0; i < nitems(t->cs.s_args); i++)
|
for (i = 0; i < nitems(t->cs.s_args); i++)
|
||||||
assert(t->cs.s_args[i] == NULL);
|
assert(t->cs.s_args[i] == NULL);
|
||||||
@ -378,12 +378,11 @@ enter_syscall(struct trussinfo *info, struct threadinfo *t,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
t->cs.name = sysdecode_syscallname(t->proc->abi->abi, t->cs.number);
|
sc = get_syscall(t, t->cs.number, narg);
|
||||||
if (t->cs.name == NULL)
|
if (sc->unknown)
|
||||||
fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
|
fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
|
||||||
t->proc->abi->type, t->cs.number);
|
t->proc->abi->type, t->cs.number);
|
||||||
|
|
||||||
sc = get_syscall(t->cs.name, narg);
|
|
||||||
t->cs.nargs = sc->nargs;
|
t->cs.nargs = sc->nargs;
|
||||||
assert(sc->nargs <= nitems(t->cs.s_args));
|
assert(sc->nargs <= nitems(t->cs.s_args));
|
||||||
|
|
||||||
@ -396,25 +395,22 @@ enter_syscall(struct trussinfo *info, struct threadinfo *t,
|
|||||||
* now. This doesn't currently support arguments that are
|
* now. This doesn't currently support arguments that are
|
||||||
* passed in *and* out, however.
|
* passed in *and* out, however.
|
||||||
*/
|
*/
|
||||||
if (t->cs.name != NULL) {
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
fprintf(stderr, "syscall %s(", t->cs.name);
|
fprintf(stderr, "syscall %s(", sc->name);
|
||||||
#endif
|
#endif
|
||||||
for (i = 0; i < t->cs.nargs; i++) {
|
for (i = 0; i < t->cs.nargs; i++) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
fprintf(stderr, "0x%lx%s", sc ?
|
fprintf(stderr, "0x%lx%s", t->cs.args[sc->args[i].offset],
|
||||||
t->cs.args[sc->args[i].offset] : t->cs.args[i],
|
i < (t->cs.nargs - 1) ? "," : "");
|
||||||
i < (t->cs.nargs - 1) ? "," : "");
|
|
||||||
#endif
|
#endif
|
||||||
if (!(sc->args[i].type & OUT)) {
|
if (!(sc->args[i].type & OUT)) {
|
||||||
t->cs.s_args[i] = print_arg(&sc->args[i],
|
t->cs.s_args[i] = print_arg(&sc->args[i],
|
||||||
t->cs.args, 0, info);
|
t->cs.args, 0, info);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#if DEBUG
|
|
||||||
fprintf(stderr, ")\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#if DEBUG
|
||||||
|
fprintf(stderr, ")\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
clock_gettime(CLOCK_REALTIME, &t->before);
|
clock_gettime(CLOCK_REALTIME, &t->before);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,9 @@ static struct procabi sparc64_freebsd = {
|
|||||||
"FreeBSD ELF64",
|
"FreeBSD ELF64",
|
||||||
SYSDECODE_ABI_FREEBSD,
|
SYSDECODE_ABI_FREEBSD,
|
||||||
sparc64_fetch_args,
|
sparc64_fetch_args,
|
||||||
sparc64_fetch_retval
|
sparc64_fetch_retval,
|
||||||
|
STAILQ_HEAD_INITIALIZER(sparc64_freebsd.extra_syscalls),
|
||||||
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCABI(sparc64_freebsd);
|
PROCABI(sparc64_freebsd);
|
||||||
|
@ -72,9 +72,10 @@ struct syscall {
|
|||||||
struct timespec time; /* Time spent for this call */
|
struct timespec time; /* Time spent for this call */
|
||||||
int ncalls; /* Number of calls */
|
int ncalls; /* Number of calls */
|
||||||
int nerror; /* Number of calls that returned with error */
|
int nerror; /* Number of calls that returned with error */
|
||||||
|
bool unknown; /* Unknown system call */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct syscall *get_syscall(const char *, int nargs);
|
struct syscall *get_syscall(struct threadinfo *, u_int, u_int);
|
||||||
char *print_arg(struct syscall_args *, unsigned long*, long *, struct trussinfo *);
|
char *print_arg(struct syscall_args *, unsigned long*, long *, struct trussinfo *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -819,21 +820,66 @@ init_syscalls(void)
|
|||||||
for (sc = decoded_syscalls; sc->name != NULL; sc++)
|
for (sc = decoded_syscalls; sc->name != NULL; sc++)
|
||||||
STAILQ_INSERT_HEAD(&syscalls, sc, entries);
|
STAILQ_INSERT_HEAD(&syscalls, sc, entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct syscall *
|
||||||
|
find_syscall(struct procabi *abi, u_int number)
|
||||||
|
{
|
||||||
|
struct extra_syscall *es;
|
||||||
|
|
||||||
|
if (number < nitems(abi->syscalls))
|
||||||
|
return (abi->syscalls[number]);
|
||||||
|
STAILQ_FOREACH(es, &abi->extra_syscalls, entries) {
|
||||||
|
if (es->number == number)
|
||||||
|
return (es->sc);
|
||||||
|
}
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
add_syscall(struct procabi *abi, u_int number, struct syscall *sc)
|
||||||
|
{
|
||||||
|
struct extra_syscall *es;
|
||||||
|
|
||||||
|
if (number < nitems(abi->syscalls)) {
|
||||||
|
assert(abi->syscalls[number] == NULL);
|
||||||
|
abi->syscalls[number] = sc;
|
||||||
|
} else {
|
||||||
|
es = malloc(sizeof(*es));
|
||||||
|
es->sc = sc;
|
||||||
|
es->number = number;
|
||||||
|
STAILQ_INSERT_TAIL(&abi->extra_syscalls, es, entries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If/when the list gets big, it might be desirable to do it
|
* If/when the list gets big, it might be desirable to do it
|
||||||
* as a hash table or binary search.
|
* as a hash table or binary search.
|
||||||
*/
|
*/
|
||||||
struct syscall *
|
struct syscall *
|
||||||
get_syscall(const char *name, int nargs)
|
get_syscall(struct threadinfo *t, u_int number, u_int nargs)
|
||||||
{
|
{
|
||||||
struct syscall *sc;
|
struct syscall *sc;
|
||||||
int i;
|
const char *name;
|
||||||
|
char *new_name;
|
||||||
|
u_int i;
|
||||||
|
|
||||||
if (name == NULL)
|
sc = find_syscall(t->proc->abi, number);
|
||||||
return (NULL);
|
if (sc != NULL)
|
||||||
STAILQ_FOREACH(sc, &syscalls, entries)
|
return (sc);
|
||||||
if (strcmp(name, sc->name) == 0)
|
|
||||||
|
name = sysdecode_syscallname(t->proc->abi->abi, number);
|
||||||
|
if (name == NULL) {
|
||||||
|
asprintf(&new_name, "#%d", number);
|
||||||
|
name = new_name;
|
||||||
|
} else
|
||||||
|
new_name = NULL;
|
||||||
|
STAILQ_FOREACH(sc, &syscalls, entries) {
|
||||||
|
if (strcmp(name, sc->name) == 0) {
|
||||||
|
add_syscall(t->proc->abi, number, sc);
|
||||||
|
free(new_name);
|
||||||
return (sc);
|
return (sc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* It is unknown. Add it into the list. */
|
/* It is unknown. Add it into the list. */
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@ -842,7 +888,9 @@ get_syscall(const char *name, int nargs)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
sc = calloc(1, sizeof(struct syscall));
|
sc = calloc(1, sizeof(struct syscall));
|
||||||
sc->name = strdup(name);
|
sc->name = name;
|
||||||
|
if (new_name != NULL)
|
||||||
|
sc->unknown = true;
|
||||||
sc->ret_type = 1;
|
sc->ret_type = 1;
|
||||||
sc->nargs = nargs;
|
sc->nargs = nargs;
|
||||||
for (i = 0; i < nargs; i++) {
|
for (i = 0; i < nargs; i++) {
|
||||||
@ -851,6 +899,7 @@ get_syscall(const char *name, int nargs)
|
|||||||
sc->args[i].type = LongHex;
|
sc->args[i].type = LongHex;
|
||||||
}
|
}
|
||||||
STAILQ_INSERT_HEAD(&syscalls, sc, entries);
|
STAILQ_INSERT_HEAD(&syscalls, sc, entries);
|
||||||
|
add_syscall(t->proc->abi, number, sc);
|
||||||
|
|
||||||
return (sc);
|
return (sc);
|
||||||
}
|
}
|
||||||
@ -1866,7 +1915,7 @@ print_syscall(struct trussinfo *trussinfo)
|
|||||||
|
|
||||||
t = trussinfo->curthread;
|
t = trussinfo->curthread;
|
||||||
|
|
||||||
name = t->cs.name;
|
name = t->cs.sc->name;
|
||||||
nargs = t->cs.nargs;
|
nargs = t->cs.nargs;
|
||||||
s_args = t->cs.s_args;
|
s_args = t->cs.s_args;
|
||||||
|
|
||||||
|
@ -38,13 +38,29 @@
|
|||||||
#define DISPLAYTIDS 0x00000080
|
#define DISPLAYTIDS 0x00000080
|
||||||
|
|
||||||
struct procinfo;
|
struct procinfo;
|
||||||
|
struct syscall;
|
||||||
struct trussinfo;
|
struct trussinfo;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The lookup of normal system calls are optimized by using a fixed
|
||||||
|
* array for the first 1024 system calls that can be indexed directly.
|
||||||
|
* Unknown system calls with other IDs are stored in a linked list.
|
||||||
|
*/
|
||||||
|
#define SYSCALL_NORMAL_COUNT 1024
|
||||||
|
|
||||||
|
struct extra_syscall {
|
||||||
|
STAILQ_ENTRY(extra_syscall) entries;
|
||||||
|
struct syscall *sc;
|
||||||
|
u_int number;
|
||||||
|
};
|
||||||
|
|
||||||
struct procabi {
|
struct procabi {
|
||||||
const char *type;
|
const char *type;
|
||||||
enum sysdecode_abi abi;
|
enum sysdecode_abi abi;
|
||||||
int (*fetch_args)(struct trussinfo *, u_int);
|
int (*fetch_args)(struct trussinfo *, u_int);
|
||||||
int (*fetch_retval)(struct trussinfo *, long *, int *);
|
int (*fetch_retval)(struct trussinfo *, long *, int *);
|
||||||
|
STAILQ_HEAD(, extra_syscall) extra_syscalls;
|
||||||
|
struct syscall *syscalls[SYSCALL_NORMAL_COUNT];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PROCABI(abi) DATA_SET(procabi, abi)
|
#define PROCABI(abi) DATA_SET(procabi, abi)
|
||||||
@ -64,10 +80,9 @@ struct procabi {
|
|||||||
*/
|
*/
|
||||||
struct current_syscall {
|
struct current_syscall {
|
||||||
struct syscall *sc;
|
struct syscall *sc;
|
||||||
const char *name;
|
unsigned int number;
|
||||||
int number;
|
|
||||||
unsigned long args[10];
|
|
||||||
unsigned int nargs;
|
unsigned int nargs;
|
||||||
|
unsigned long args[10];
|
||||||
char *s_args[10]; /* the printable arguments */
|
char *s_args[10]; /* the printable arguments */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user