svn commit: r346695 - in head/sys: kern sys

John Baldwin jhb at FreeBSD.org
Thu Apr 25 18:42:09 UTC 2019


Author: jhb
Date: Thu Apr 25 18:42:07 2019
New Revision: 346695
URL: https://svnweb.freebsd.org/changeset/base/346695

Log:
  Remove p_code from struct proc.
  
  Contrary to the comments, it was never used by core dumps or
  debuggers.  Instead, it used to hold the signal code of a pending
  signal, but that was replaced by the 'ksi_code' member of ksiginfo_t
  when signal information was reworked in 7.0.
  
  Reviewed by:	kib
  Differential Revision:	https://reviews.freebsd.org/D20047

Modified:
  head/sys/kern/kern_sig.c
  head/sys/kern/kern_thread.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Thu Apr 25 18:41:05 2019	(r346694)
+++ head/sys/kern/kern_sig.c	Thu Apr 25 18:42:07 2019	(r346695)
@@ -1996,7 +1996,6 @@ trapsignal(struct thread *td, ksiginfo_t *ksi)
 			ps->ps_sigact[_SIG_IDX(sig)] = SIG_DFL;
 		}
 		mtx_unlock(&ps->ps_mtx);
-		p->p_code = code;	/* XXX for core dump/debugger */
 		p->p_sig = sig;		/* XXX to verify code */
 		tdsendsignal(p, td, sig, ksi);
 	}
@@ -3062,7 +3061,6 @@ postsig(int sig)
 			returnmask = td->td_sigmask;
 
 		if (p->p_sig == sig) {
-			p->p_code = 0;
 			p->p_sig = 0;
 		}
 		(*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask);

Modified: head/sys/kern/kern_thread.c
==============================================================================
--- head/sys/kern/kern_thread.c	Thu Apr 25 18:41:05 2019	(r346694)
+++ head/sys/kern/kern_thread.c	Thu Apr 25 18:42:07 2019	(r346695)
@@ -90,11 +90,11 @@ _Static_assert(offsetof(struct proc, p_flag) == 0xb0,
     "struct proc KBI p_flag");
 _Static_assert(offsetof(struct proc, p_pid) == 0xbc,
     "struct proc KBI p_pid");
-_Static_assert(offsetof(struct proc, p_filemon) == 0x3d0,
+_Static_assert(offsetof(struct proc, p_filemon) == 0x3c8,
     "struct proc KBI p_filemon");
-_Static_assert(offsetof(struct proc, p_comm) == 0x3e8,
+_Static_assert(offsetof(struct proc, p_comm) == 0x3e0,
     "struct proc KBI p_comm");
-_Static_assert(offsetof(struct proc, p_emuldata) == 0x4c8,
+_Static_assert(offsetof(struct proc, p_emuldata) == 0x4c0,
     "struct proc KBI p_emuldata");
 #endif
 #ifdef __i386__
@@ -110,11 +110,11 @@ _Static_assert(offsetof(struct proc, p_flag) == 0x68,
     "struct proc KBI p_flag");
 _Static_assert(offsetof(struct proc, p_pid) == 0x74,
     "struct proc KBI p_pid");
-_Static_assert(offsetof(struct proc, p_filemon) == 0x27c,
+_Static_assert(offsetof(struct proc, p_filemon) == 0x278,
     "struct proc KBI p_filemon");
-_Static_assert(offsetof(struct proc, p_comm) == 0x290,
+_Static_assert(offsetof(struct proc, p_comm) == 0x28c,
     "struct proc KBI p_comm");
-_Static_assert(offsetof(struct proc, p_emuldata) == 0x31c,
+_Static_assert(offsetof(struct proc, p_emuldata) == 0x318,
     "struct proc KBI p_emuldata");
 #endif
 

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Thu Apr 25 18:41:05 2019	(r346694)
+++ head/sys/sys/proc.h	Thu Apr 25 18:42:07 2019	(r346695)
@@ -617,7 +617,6 @@ struct proc {
 	struct sigiolst	p_sigiolst;	/* (c) List of sigio sources. */
 	int		p_sigparent;	/* (c) Signal to parent on exit. */
 	int		p_sig;		/* (n) For core dump/debugger XXX. */
-	u_long		p_code;		/* (n) For core dump/debugger XXX. */
 	u_int		p_stops;	/* (c) Stop event bitmask. */
 	u_int		p_stype;	/* (c) Stop event type. */
 	char		p_step;		/* (c) Process is stopped. */


More information about the svn-src-head mailing list