mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Moved support for Linux-specific system call sys_init_module from generic to Linux wrappers. Added wrapper for sys_delete_module system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8266
This commit is contained in:
parent
c279a0ffc9
commit
bd28f145d5
@ -178,7 +178,6 @@ DECL_TEMPLATE(generic, sys_fstatfs); // * L?
|
||||
DECL_TEMPLATE(generic, sys_iopl); // (x86/amd64) L
|
||||
DECL_TEMPLATE(generic, sys_ipc); // (x86) L
|
||||
DECL_TEMPLATE(generic, sys_newuname); // * P
|
||||
DECL_TEMPLATE(generic, sys_init_module); // * L?
|
||||
DECL_TEMPLATE(generic, sys_pread64); // * (Unix98?)
|
||||
DECL_TEMPLATE(generic, sys_pwrite64); // * (Unix98?)
|
||||
DECL_TEMPLATE(generic, sys_sigaltstack); // (x86) (XPG4-UNIX)
|
||||
|
||||
@ -230,6 +230,10 @@ DECL_TEMPLATE(linux, sys_rt_sigsuspend);
|
||||
// Linux-specific?
|
||||
DECL_TEMPLATE(linux, sys_sync_file_range);
|
||||
|
||||
// Linux specific (kernel modules)
|
||||
DECL_TEMPLATE(linux, sys_init_module);
|
||||
DECL_TEMPLATE(linux, sys_delete_module);
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
Wrappers for sockets and ipc-ery. These are split into standalone
|
||||
procedures because x86-linux hides them inside multiplexors
|
||||
|
||||
@ -1256,8 +1256,8 @@ const SyscallTableEntry ML_(syscall_table)[] = {
|
||||
LINX_(__NR_ioperm, sys_ioperm), // 173
|
||||
GENX_(__NR_create_module, sys_ni_syscall), // 174
|
||||
|
||||
GENX_(__NR_init_module, sys_init_module), // 175
|
||||
// (__NR_delete_module, sys_delete_module), // 176
|
||||
LINX_(__NR_init_module, sys_init_module), // 175
|
||||
LINX_(__NR_delete_module, sys_delete_module), // 176
|
||||
// (__NR_get_kernel_syms, sys_ni_syscall), // 177
|
||||
// (__NR_query_module, sys_ni_syscall), // 178
|
||||
//LINX_(__NR_quotactl, sys_quotactl), // 179
|
||||
|
||||
@ -2342,17 +2342,6 @@ PRE(sys_flock)
|
||||
PRE_REG_READ2(long, "flock", unsigned int, fd, unsigned int, operation);
|
||||
}
|
||||
|
||||
/* This surely isn't remotely generic -- move to linux-specifics? */
|
||||
PRE(sys_init_module)
|
||||
{
|
||||
*flags |= SfMayBlock;
|
||||
PRINT("sys_init_module ( %p, %llu, %p )", ARG1, (ULong)ARG2, ARG3 );
|
||||
PRE_REG_READ3(long, "init_module",
|
||||
void *, umod, unsigned long, len, const char *, uargs);
|
||||
PRE_MEM_READ( "init_module(umod)", ARG1, ARG2 );
|
||||
PRE_MEM_RASCIIZ( "init_module(uargs)", ARG3 );
|
||||
}
|
||||
|
||||
// Pre_read a char** argument.
|
||||
static void pre_argv_envp(Addr a, ThreadId tid, Char* s1, Char* s2)
|
||||
{
|
||||
|
||||
@ -3012,6 +3012,30 @@ PRE(sys_ioprio_set)
|
||||
PRE_REG_READ3(int, "ioprio_set", int, which, int, who, int, ioprio);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
_module wrappers
|
||||
------------------------------------------------------------------ */
|
||||
|
||||
PRE(sys_init_module)
|
||||
{
|
||||
*flags |= SfMayBlock;
|
||||
PRINT("sys_init_module ( %p, %llu, %p(\"%s\") )",
|
||||
ARG1, (ULong)ARG2, ARG3, ARG3);
|
||||
PRE_REG_READ3(long, "init_module",
|
||||
void *, umod, unsigned long, len, const char *, uargs);
|
||||
PRE_MEM_READ( "init_module(umod)", ARG1, ARG2 );
|
||||
PRE_MEM_RASCIIZ( "init_module(uargs)", ARG3 );
|
||||
}
|
||||
|
||||
PRE(sys_delete_module)
|
||||
{
|
||||
*flags |= SfMayBlock;
|
||||
PRINT("sys_delete_module ( %p(\"%s\"), 0x%x )", ARG1,ARG1, ARG2);
|
||||
PRE_REG_READ2(long, "delete_module",
|
||||
const char *, name_user, unsigned int, flags);
|
||||
PRE_MEM_RASCIIZ("delete_module(name_user)", ARG1);
|
||||
}
|
||||
|
||||
#undef PRE
|
||||
#undef POST
|
||||
|
||||
|
||||
@ -1623,8 +1623,8 @@ const SyscallTableEntry ML_(syscall_table)[] = {
|
||||
GENXY(__NR_mprotect, sys_mprotect), // 125
|
||||
LINXY(__NR_sigprocmask, sys_sigprocmask), // 126
|
||||
GENX_(__NR_create_module, sys_ni_syscall), // 127
|
||||
//.. GENX_(__NR_init_module, sys_init_module), // 128
|
||||
//.. // (__NR_delete_module, sys_delete_module), // 129 (*/Linux)?
|
||||
LINX_(__NR_init_module, sys_init_module), // 128
|
||||
LINX_(__NR_delete_module, sys_delete_module), // 129
|
||||
//..
|
||||
//.. // Nb: get_kernel_syms() was removed 2.4-->2.6
|
||||
//.. GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130
|
||||
|
||||
@ -1293,8 +1293,8 @@ const SyscallTableEntry ML_(syscall_table)[] = {
|
||||
GENXY(__NR_mprotect, sys_mprotect), // 125
|
||||
// _____(__NR_sigprocmask, sys_sigprocmask), // 126
|
||||
GENX_(__NR_create_module, sys_ni_syscall), // 127
|
||||
// _____(__NR_init_module, sys_init_module), // 128
|
||||
// _____(__NR_delete_module, sys_delete_module), // 129
|
||||
LINX_(__NR_init_module, sys_init_module), // 128
|
||||
LINX_(__NR_delete_module, sys_delete_module), // 129
|
||||
|
||||
// _____(__NR_get_kernel_syms, sys_get_kernel_syms), // 130
|
||||
// _____(__NR_quotactl, sys_quotactl), // 131
|
||||
|
||||
@ -1993,8 +1993,8 @@ const SyscallTableEntry ML_(syscall_table)[] = {
|
||||
LINXY(__NR_sigprocmask, sys_sigprocmask), // 126
|
||||
//zz // Nb: create_module() was removed 2.4-->2.6
|
||||
GENX_(__NR_create_module, sys_ni_syscall), // 127
|
||||
GENX_(__NR_init_module, sys_init_module), // 128
|
||||
//zz // (__NR_delete_module, sys_delete_module), // 129 (*/Linux)?
|
||||
LINX_(__NR_init_module, sys_init_module), // 128
|
||||
LINX_(__NR_delete_module, sys_delete_module), // 129
|
||||
//zz
|
||||
//zz // Nb: get_kernel_syms() was removed 2.4-->2.6
|
||||
GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user