blob: 608dc2510d191bd905e9e072ec2830a4c03ef2ef (
plain)
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
|
#include <compel/compel.h>
static struct syscall_exec_desc sc_exec_table_64[] = {
#include "sys-exec-tbl-64.c"
{ }, /* terminator */
};
#ifdef CONFIG_COMPAT
static struct syscall_exec_desc sc_exec_table_32[] = {
#include "sys-exec-tbl-32.c"
{ }, /* terminator */
};
#endif
struct syscall_exec_desc;
static inline struct syscall_exec_desc *
find_syscall_table(char *name, struct syscall_exec_desc *tbl)
{
int i;
for (i = 0; tbl[i].name != NULL; i++)
if (!strcmp(tbl[i].name, name))
return &tbl[i];
return NULL;
}
#define ARCH_HAS_FIND_SYSCALL
/* overwrite default to search in two tables above */
#ifdef CONFIG_COMPAT
struct syscall_exec_desc * find_syscall(char *name, struct parasite_ctl *ctl)
{
if (compel_mode_native(ctl))
return find_syscall_table(name, sc_exec_table_64);
else
return find_syscall_table(name, sc_exec_table_32);
}
#else
struct syscall_exec_desc *
find_syscall(char *name, __always_unused struct parasite_ctl *ctl)
{
return find_syscall_table(name, sc_exec_table_64);
}
#endif
|