From ba17e7928756fdede7d158133517fe0942bfc8fb Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 21 Jun 2005 03:52:49 +0000 Subject: [PATCH] Slight reduce m_syswrap's dependence on m_signals by moving VG_(client_signal_OK)(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3982 --- coregrind/m_signals.c | 10 ---------- coregrind/m_syswrap/priv_syswrap-generic.h | 3 +++ coregrind/m_syswrap/syswrap-generic.c | 14 ++++++++++++-- coregrind/m_syswrap/syswrap-linux.c | 1 - coregrind/pub_core_signals.h | 3 --- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c index 7b71f75a6..3088edc7c 100644 --- a/coregrind/m_signals.c +++ b/coregrind/m_signals.c @@ -770,16 +770,6 @@ void VG_(clear_out_queued_signals)( ThreadId tid, vki_sigset_t* saved_mask ) restore_all_host_signals(saved_mask); } -Bool VG_(client_signal_OK)(Int sigNo) -{ - /* signal 0 is OK for kill */ - Bool ret = sigNo >= 0 && sigNo <= VKI_SIGVGRTUSERMAX; - - //VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret); - - return ret; -} - /* --------------------------------------------------------------------- The signal simulation proper. A simplified version of what the Linux kernel does. diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h index b4c7da6ed..e151c1b84 100644 --- a/coregrind/m_syswrap/priv_syswrap-generic.h +++ b/coregrind/m_syswrap/priv_syswrap-generic.h @@ -40,6 +40,9 @@ extern Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, const Char *syscallname); +// Returns True if the signal is OK for the client to use. +extern Bool VG_(client_signal_OK)(Int sigNo); + // Return true if we're allowed to use or create this fd. extern Bool VG_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft); diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 7e0fbbe73..b8690024d 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -42,13 +42,13 @@ #include "pub_core_libcsignal.h" #include "pub_core_main.h" #include "pub_core_mallocfree.h" -#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)() -#include "pub_core_tooliface.h" #include "pub_core_options.h" #include "pub_core_scheduler.h" #include "pub_core_signals.h" +#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)() #include "pub_core_syscall.h" #include "pub_core_syswrap.h" +#include "pub_core_tooliface.h" #include "priv_types_n_macros.h" #include "priv_syswrap-generic.h" @@ -93,6 +93,16 @@ Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, return ret; } +Bool VG_(client_signal_OK)(Int sigNo) +{ + /* signal 0 is OK for kill */ + Bool ret = sigNo >= 0 && sigNo <= VKI_SIGVGRTUSERMAX; + + //VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret); + + return ret; +} + /* --------------------------------------------------------------------- Doing mmap, mremap ------------------------------------------------------------------ */ diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 2a9422479..a50190c34 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -42,7 +42,6 @@ #include "pub_core_tooliface.h" #include "pub_core_options.h" #include "pub_core_scheduler.h" -#include "pub_core_signals.h" // For VG_(client_signal_OK)() #include "pub_core_syscall.h" #include "priv_types_n_macros.h" diff --git a/coregrind/pub_core_signals.h b/coregrind/pub_core_signals.h index 99ccca415..2b2fe550b 100644 --- a/coregrind/pub_core_signals.h +++ b/coregrind/pub_core_signals.h @@ -72,9 +72,6 @@ extern void VG_(synth_sigill) (ThreadId tid, Addr addr); /* Extend the stack to cover addr, if possible */ extern Bool VG_(extend_stack)(Addr addr, UInt maxsize); -/* Returns True if the signal is OK for the client to use */ -extern Bool VG_(client_signal_OK)(Int sigNo); - /* Forces the client's signal handler to SIG_DFL - generally just before using that signal to kill the process. */ extern void VG_(set_default_handler)(Int sig);