Move VKI_SIGVGKILL and VKI_SIGVGRTUSERMAX out of vki-linux.h since they're
not really from the kernel and they're defined in terms of VG_(max_signal),
which is in m_signals.  Renamed them with the VG_ prefix too, since they're
now not part of the kernel interface.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3990 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c
index 291bce5..5bdb8eb 100644
--- a/coregrind/m_libcfile.c
+++ b/coregrind/m_libcfile.c
@@ -32,7 +32,7 @@
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcfile.h"
-#include "pub_core_libcprint.h"
+#include "pub_core_libcprint.h"     // For VG_(sprintf)()
 #include "pub_core_mallocfree.h"
 #include "pub_core_syscall.h"
 #include "vki_unistd.h"
diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c
index 4a2e9a0..15a3665 100644
--- a/coregrind/m_scheduler/scheduler.c
+++ b/coregrind/m_scheduler/scheduler.c
@@ -268,7 +268,7 @@
       if (VG_(clo_trace_signals))
 	 VG_(message)(Vg_DebugMsg, "kill_thread zaps tid %d lwp %d",
 		      tid, VG_(threads)[tid].os_state.lwpid);
-      VG_(tkill)(VG_(threads)[tid].os_state.lwpid, VKI_SIGVGKILL);
+      VG_(tkill)(VG_(threads)[tid].os_state.lwpid, VG_SIGVGKILL);
    }
 }
 
diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c
index 3088edc..dc18cd2 100644
--- a/coregrind/m_signals.c
+++ b/coregrind/m_signals.c
@@ -333,7 +333,7 @@
       default:
          // VKI_SIGVG* are runtime variables, so we can't make them            
          // cases in the switch, so we handle them in the 'default' case.
-	 if (sig == VKI_SIGVGKILL)
+	 if (sig == VG_SIGVGKILL)
 	    skss_handler = sigvgkill_handler;
 	 else {
 	    if (scss_handler == VKI_SIG_IGN)
@@ -577,7 +577,7 @@
    if (signo < 1 || signo > VG_(max_signal)) goto bad_signo;
 
    /* don't let them use our signals */
-   if ( (signo > VKI_SIGVGRTUSERMAX)
+   if ( (signo > VG_SIGVGRTUSERMAX)
 	&& new_act
 	&& !(new_act->ksa_handler == VKI_SIG_DFL 
              || new_act->ksa_handler == VKI_SIG_IGN) )
@@ -1436,7 +1436,7 @@
       VG_(message)(Vg_DebugMsg,"delivering signal %d (%s):%d to thread %d", 
 		   sigNo, signame(sigNo), info->si_code, tid );
 
-   if (sigNo == VKI_SIGVGKILL) {
+   if (sigNo == VG_SIGVGKILL) {
       /* If this is a SIGVGKILL, we're expecting it to interrupt any
 	 blocked syscall.  It doesn't matter whether the VCPU state is
 	 set to restart or not, because we don't expect it will
@@ -1963,7 +1963,7 @@
    if (VG_(clo_trace_signals))
       VG_(message)(Vg_DebugMsg, "sigvgkill for lwp %d tid %d", VG_(gettid)(), tid);
 
-   vg_assert(signo == VKI_SIGVGKILL);
+   vg_assert(signo == VG_SIGVGKILL);
    vg_assert(si->si_signo == signo);
    vg_assert(VG_(threads)[tid].status == VgTs_WaitSys);
 
@@ -2114,9 +2114,9 @@
       VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d", VG_(max_signal));
 
    /* Our private internal signals are treated as ignored */
-   scss.scss_per_sig[VKI_SIGVGKILL].scss_handler = VKI_SIG_IGN;
-   scss.scss_per_sig[VKI_SIGVGKILL].scss_flags   = VKI_SA_SIGINFO;
-   VG_(sigfillset)(&scss.scss_per_sig[VKI_SIGVGKILL].scss_mask);
+   scss.scss_per_sig[VG_SIGVGKILL].scss_handler = VKI_SIG_IGN;
+   scss.scss_per_sig[VG_SIGVGKILL].scss_flags   = VKI_SA_SIGINFO;
+   VG_(sigfillset)(&scss.scss_per_sig[VG_SIGVGKILL].scss_mask);
 
    /* Copy the process' signal mask into the root thread. */
    vg_assert(VG_(threads)[1].status == VgTs_Init);
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
index b869002..f3c258a 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -96,7 +96,7 @@
 Bool VG_(client_signal_OK)(Int sigNo)
 {
    /* signal 0 is OK for kill */
-   Bool ret = sigNo >= 0 && sigNo <= VKI_SIGVGRTUSERMAX;
+   Bool ret = sigNo >= 0 && sigNo <= VG_SIGVGRTUSERMAX;
 
    //VG_(printf)("client_signal_OK(%d) -> %d\n", sigNo, ret);
 
diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c
index 3cea5c2..dc8c586 100644
--- a/coregrind/m_syswrap/syswrap-main.c
+++ b/coregrind/m_syswrap/syswrap-main.c
@@ -41,7 +41,7 @@
 #include "pub_core_stacktrace.h"    // For VG_(get_and_pp_StackTrace)()
 #include "pub_core_tooliface.h"
 #include "pub_core_options.h"
-#include "pub_core_signals.h"       // For VG_(max_signal), VG_(poll_signals)
+#include "pub_core_signals.h"       // For VG_SIGVGKILL, VG_(poll_signals)
 #include "pub_core_syscall.h"
 #include "pub_core_syswrap.h"
 
@@ -506,7 +506,7 @@
 {
    VG_(sigdelset)(mask, VKI_SIGKILL);
    VG_(sigdelset)(mask, VKI_SIGSTOP);
-   VG_(sigdelset)(mask, VKI_SIGVGKILL); /* never block */
+   VG_(sigdelset)(mask, VG_SIGVGKILL); /* never block */
 }
 
 typedef
diff --git a/coregrind/pub_core_signals.h b/coregrind/pub_core_signals.h
index 2b2fe55..e968253 100644
--- a/coregrind/pub_core_signals.h
+++ b/coregrind/pub_core_signals.h
@@ -40,6 +40,10 @@
 /* Highest signal the kernel will let us use */
 extern Int VG_(max_signal);
 
+/* Use high signals because native pthreads wants to use low */
+#define VG_SIGVGKILL       (VG_(max_signal)-0)
+#define VG_SIGVGRTUSERMAX  (VG_(max_signal)-1)
+
 extern void VG_(sigstartup_actions) ( void );
 
 /* Poll a thread's set of pending signals, and update the Thread's
diff --git a/include/vki-linux.h b/include/vki-linux.h
index 7cc087f..504570b 100644
--- a/include/vki-linux.h
+++ b/include/vki-linux.h
@@ -350,14 +350,6 @@
 };
 
 //----------------------------------------------------------------------
-// From nowhere: constants internal to Valgrind
-//----------------------------------------------------------------------
-
-/* Use high signals because native pthreads wants to use low */
-#define VKI_SIGVGKILL       (VG_(max_signal)-0) // [[internal: kill]]
-#define VKI_SIGVGRTUSERMAX  (VG_(max_signal)-1) // [[internal: last user-usable RT signal]]
-
-//----------------------------------------------------------------------
 // From linux-2.6.8.1/include/asm-generic/siginfo.h
 //----------------------------------------------------------------------