From: Nicholas Nethercote Date: Mon, 22 Nov 2004 19:57:39 +0000 (+0000) Subject: Remove useless parameters to TL_(pre_syscall)() and TL_(post_syscall)(). X-Git-Tag: svn/VALGRIND_3_0_0~1254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=400cfc0311503faad989331a4326086f845857e0;p=thirdparty%2Fvalgrind.git Remove useless parameters to TL_(pre_syscall)() and TL_(post_syscall)(). Also remove Memcheck's and Addrcheck's use of syscall_wrappers, since they didn't do anything useful. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3064 --- diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index df104cdc70..ff5a07441a 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -1265,7 +1265,6 @@ void TL_(pre_clo_init)(void) VG_(needs_libc_freeres) (); VG_(needs_command_line_options)(); VG_(needs_client_requests) (); - VG_(needs_syscall_wrapper) (); VG_(needs_sanity_checks) (); VG_(needs_shadow_memory) (); diff --git a/coregrind/core.h b/coregrind/core.h index 31dab7ed0b..5c1fa98efa 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -756,9 +756,6 @@ typedef struct ProxyLWP ProxyLWP; void** joiner_thread_return; ThreadId joiner_jee_tid; - /* If VgTs_WaitSys, this is the result of the pre-syscall check */ - void *sys_pre_res; - /* If VgTs_WaitSys, this is the syscall we're currently running */ Int syscallno; diff --git a/coregrind/toolfuncs.def b/coregrind/toolfuncs.def index e6945afc05..359eb520b5 100644 --- a/coregrind/toolfuncs.def +++ b/coregrind/toolfuncs.def @@ -136,8 +136,8 @@ Bool, handle_client_request, ThreadId tid, UWord* arg_block, UWord* ret ## If either of the pre_ functions malloc() something to return, the ## corresponding post_ function had better free() it! -void *, pre_syscall, ThreadId tid, UInt syscallno, Bool is_blocking -void, post_syscall, ThreadId tid, UInt syscallno, void* pre_result, Int res, Bool is_blocking +void, pre_syscall, ThreadId tid, UInt syscallno +void, post_syscall, ThreadId tid, UInt syscallno, Int res ## --------------------------------------------------------------------- diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index f5d74751a4..8a2f1bdcd1 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -388,7 +388,6 @@ void mostly_clear_thread_record ( ThreadId tid ) VG_(threads)[tid].syscallno = -1; VG_(threads)[tid].sys_flags = 0; - VG_(threads)[tid].sys_pre_res = NULL; VG_(threads)[tid].proxy = NULL; diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index 36ab5956a8..a45e783e3d 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -5794,7 +5794,7 @@ Bool VG_(pre_syscall) ( ThreadId tid ) /* Do any pre-syscall actions */ if (VG_(needs).syscall_wrapper) { VGP_PUSHCC(VgpToolSysWrap); - tst->sys_pre_res = TL_(pre_syscall)(tid, syscallno, mayBlock); + TL_(pre_syscall)(tid, syscallno); VGP_POPCC(VgpToolSysWrap); } @@ -5868,7 +5868,6 @@ void VG_(post_syscall) ( ThreadId tid, Bool restart ) const struct SyscallTableEntry *sys; Bool isSpecial = False; Bool restarted = False; - void *pre_res; VGP_PUSHCC(VgpCoreSysWrap); @@ -5879,7 +5878,6 @@ void VG_(post_syscall) ( ThreadId tid, Bool restart ) SET_SYSCALL_RETVAL(tst->tid, res); syscallno = tst->syscallno; - pre_res = tst->sys_pre_res; vg_assert(syscallno != -1); /* must be a current syscall */ @@ -5927,7 +5925,7 @@ void VG_(post_syscall) ( ThreadId tid, Bool restart ) */ if (VG_(needs).syscall_wrapper) { VGP_PUSHCC(VgpToolSysWrap); - TL_(post_syscall)(tid, syscallno, pre_res, res, /*isBlocking*/True); // did block + TL_(post_syscall)(tid, syscallno, res); VGP_POPCC(VgpToolSysWrap); } } diff --git a/memcheck/mac_needs.c b/memcheck/mac_needs.c index d6d431d917..561bb87f49 100644 --- a/memcheck/mac_needs.c +++ b/memcheck/mac_needs.c @@ -937,31 +937,6 @@ Bool MAC_(handle_common_client_requests)(ThreadId tid, UWord* arg, UWord* ret ) } } -/*------------------------------------------------------------*/ -/*--- Syscall wrappers ---*/ -/*------------------------------------------------------------*/ - -void* TL_(pre_syscall) ( ThreadId tid, UInt syscallno, Bool isBlocking ) -{ - Int sane = TL_(cheap_sanity_check)(); - return (void*)sane; -} - -void TL_(post_syscall) ( ThreadId tid, UInt syscallno, - void* pre_result, Int res, Bool isBlocking ) -{ - Int sane_before_call = (Int)pre_result; - Bool sane_after_call = TL_(cheap_sanity_check)(); - - if ((Int)sane_before_call && (!sane_after_call)) { - VG_(message)(Vg_DebugMsg, "post-syscall: "); - VG_(message)(Vg_DebugMsg, - "probable sanity check failure for syscall number %d\n", - syscallno ); - VG_(tool_panic)("aborting due to the above ... bye!"); - } -} - /*--------------------------------------------------------------------*/ /*--- end mac_needs.c ---*/ /*--------------------------------------------------------------------*/ diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index f849875efb..7a3007536e 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -1936,7 +1936,6 @@ void TL_(pre_clo_init)(void) VG_(needs_command_line_options)(); VG_(needs_client_requests) (); VG_(needs_extended_UCode) (); - VG_(needs_syscall_wrapper) (); VG_(needs_sanity_checks) (); VG_(needs_shadow_memory) ();