Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Oct 2011 02:28:33 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r226779 - user/adrian/if_ath_tx/sys/kern
Message-ID:  <201110260228.p9Q2SXPK027951@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Oct 26 02:28:33 2011
New Revision: 226779
URL: http://svn.freebsd.org/changeset/base/226779

Log:
  Fix some bad merging.

Modified:
  user/adrian/if_ath_tx/sys/kern/kern_fork.c
  user/adrian/if_ath_tx/sys/kern/kern_rctl.c
  user/adrian/if_ath_tx/sys/kern/subr_kdb.c
  user/adrian/if_ath_tx/sys/kern/subr_syscall.c
  user/adrian/if_ath_tx/sys/kern/sys_procdesc.c

Modified: user/adrian/if_ath_tx/sys/kern/kern_fork.c
==============================================================================
--- user/adrian/if_ath_tx/sys/kern/kern_fork.c	Wed Oct 26 02:26:42 2011	(r226778)
+++ user/adrian/if_ath_tx/sys/kern/kern_fork.c	Wed Oct 26 02:28:33 2011	(r226779)
@@ -819,25 +819,6 @@ fork1(struct thread *td, int flags, int 
 	}
 #endif
 
-#ifdef PROCDESC
-	/*
-	 * If required, create a process descriptor in the parent first; we
-	 * will abandon it if something goes wrong. We don't finit() until
-	 * later.
-	 */
-	if (flags & RFPROCDESC) {
-		error = falloc(td, &fp_procdesc, procdescp, 0);
-		if (error != 0) {
-#ifdef RACCT
-			PROC_LOCK(p1);
-			racct_sub(p1, RACCT_NPROC, 1);
-			PROC_UNLOCK(p1);
-#endif
-			return (error);
-		}
-	}
-#endif
-
 	mem_charged = 0;
 	vm2 = NULL;
 	if (pages == 0)

Modified: user/adrian/if_ath_tx/sys/kern/kern_rctl.c
==============================================================================
--- user/adrian/if_ath_tx/sys/kern/kern_rctl.c	Wed Oct 26 02:26:42 2011	(r226778)
+++ user/adrian/if_ath_tx/sys/kern/kern_rctl.c	Wed Oct 26 02:28:33 2011	(r226779)
@@ -379,17 +379,6 @@ rctl_enforce(struct proc *p, int resourc
 			     rule->rr_action));
 
 			/*
-			 * We're supposed to send a signal, but the process
-			 * is not fully initialized yet, probably because we
-			 * got called from fork1().  For now just deny the
-			 * allocation instead.
-			 */
-			if (p->p_state != PRS_NORMAL) {
-				should_deny = 1;
-				continue;
-			}
-
-			/*
 			 * We're using the fact that RCTL_ACTION_SIG* values
 			 * are equal to their counterparts from sys/signal.h.
 			 */

Modified: user/adrian/if_ath_tx/sys/kern/subr_kdb.c
==============================================================================
--- user/adrian/if_ath_tx/sys/kern/subr_kdb.c	Wed Oct 26 02:26:42 2011	(r226778)
+++ user/adrian/if_ath_tx/sys/kern/subr_kdb.c	Wed Oct 26 02:28:33 2011	(r226779)
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_kdb.h"
 #include "opt_stack.h"
-#include "opt_watchdog.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -42,9 +41,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/smp.h>
 #include <sys/stack.h>
 #include <sys/sysctl.h>
-#ifdef SW_WATCHDOG
-#include <sys/watchdog.h>
-#endif
 
 #include <machine/kdb.h>
 #include <machine/pcb.h>
@@ -596,9 +592,6 @@ kdb_trap(int type, int code, struct trap
 	cpuset_t other_cpus;
 #endif
 	struct kdb_dbbe *be;
-#ifdef SW_WATCHDOG
-	u_int wdoglvt;
-#endif
 	register_t intr;
 	int handled;
 
@@ -612,10 +605,6 @@ kdb_trap(int type, int code, struct trap
 
 	intr = intr_disable();
 
-#ifdef SW_WATCHDOG
-	wdoglvt = wdog_kern_last_timeout();
-	wdog_kern_pat(WD_TO_NEVER);
-#endif
 #ifdef SMP
 	other_cpus = all_cpus;
 	CPU_CLR(PCPU_GET(cpuid), &other_cpus);
@@ -647,9 +636,6 @@ kdb_trap(int type, int code, struct trap
 #ifdef SMP
 	restart_cpus(stopped_cpus);
 #endif
-#ifdef SW_WATCHDOG
-	wdog_kern_pat(wdoglvt);
-#endif
 
 	intr_restore(intr);
 

Modified: user/adrian/if_ath_tx/sys/kern/subr_syscall.c
==============================================================================
--- user/adrian/if_ath_tx/sys/kern/subr_syscall.c	Wed Oct 26 02:26:42 2011	(r226778)
+++ user/adrian/if_ath_tx/sys/kern/subr_syscall.c	Wed Oct 26 02:28:33 2011	(r226779)
@@ -204,9 +204,17 @@ syscallret(struct thread *td, int error,
 	 * is not the case, this code will need to be revisited.
 	 */
 	STOPEVENT(p, S_SCX, sa->code);
-	PTRACESTOP_SC(p, td, S_PT_SCX);
 	if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) {
 		PROC_LOCK(p);
+		/*
+		 * If tracing the execed process, trap to the debugger
+		 * so that breakpoints can be set before the program
+		 * executes.  If debugger requested tracing of syscall
+		 * returns, do it now too.
+		 */
+		if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 ||
+		    (p->p_stops & S_PT_SCX) != 0))
+			ptracestop(td, SIGTRAP);
 		td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK);
 		PROC_UNLOCK(p);
 	}

Modified: user/adrian/if_ath_tx/sys/kern/sys_procdesc.c
==============================================================================
--- user/adrian/if_ath_tx/sys/kern/sys_procdesc.c	Wed Oct 26 02:26:42 2011	(r226778)
+++ user/adrian/if_ath_tx/sys/kern/sys_procdesc.c	Wed Oct 26 02:28:33 2011	(r226779)
@@ -206,7 +206,7 @@ out:
  * System call to return the pid of a process given its process descriptor.
  */
 int
-pdgetpid(struct thread *td, struct pdgetpid_args *uap)
+sys_pdgetpid(struct thread *td, struct pdgetpid_args *uap)
 {
 	pid_t pid;
 	int error;
@@ -387,7 +387,7 @@ procdesc_close(struct file *fp, struct t
 		p->p_sigparent = SIGCHLD;
 		proc_reparent(p, initproc);
 		if ((pd->pd_flags & PD_DAEMON) == 0)
-			psignal(p, SIGKILL);
+			kern_psignal(p, SIGKILL);
 		PROC_UNLOCK(p);
 		sx_xunlock(&proctree_lock);
 	}
@@ -515,7 +515,7 @@ procdesc_chown(struct file *fp, uid_t ui
 #else /* !PROCDESC */
 
 int
-pdgetpid(struct thread *td, struct pdgetpid_args *uap)
+sys_pdgetpid(struct thread *td, struct pdgetpid_args *uap)
 {
 
 	return (ENOSYS);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110260228.p9Q2SXPK027951>