]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Moved support for Linux-specific system call sys_init_module from generic to Linux...
authorBart Van Assche <bvanassche@acm.org>
Sat, 21 Jun 2008 16:28:24 +0000 (16:28 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 21 Jun 2008 16:28:24 +0000 (16:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8266

coregrind/m_syswrap/priv_syswrap-generic.h
coregrind/m_syswrap/priv_syswrap-linux.h
coregrind/m_syswrap/syswrap-amd64-linux.c
coregrind/m_syswrap/syswrap-generic.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-ppc64-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c

index c78d908d9c336f32fade9df146aba0596973adf4..8a9493c579874e04e1d9f9e2e22a1a75c1163504 100644 (file)
@@ -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)
index c11c955c1ead49b8aff6e817d04e1c489ea18afb..85f2c38d7269b56b9bc9809770b734d981d658c8 100644 (file)
@@ -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
index ba90b342832e755a051aad42c499fd670eadb49f..40920ddc211207420c9d9320725ec70110790f36 100644 (file)
@@ -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 
index 487c5c202dd3f3aa9c0c986a3e1f593856453c43..4a57613db6f510cb2505981f974f1fa70542d7c0 100644 (file)
@@ -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)
 {
index 239590b3ef176c3ffcdb4482c3b91e116c915287..ed57e762d139a1056b741c139ab31269cc2939e8 100644 (file)
@@ -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
 
index 2159038567136d7ea46ffd523266a4277094dcf4..0e4f02194da7c81d0d12b9bc58f83f9bd03c6ebc 100644 (file)
@@ -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
index 230eb9e8471433c5c4f07d379cd06209b07d8335..3a505e6a065c48d6ee12a8987477296399c8e46d 100644 (file)
@@ -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
index f698da62f7707c4802444df3312cdb4184b94d89..1334576667013a443646370b1ff41abe4381f2af 100644 (file)
@@ -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