aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_syscall.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2015-10-22 09:33:34 +0000
committerEd Schouten <ed@FreeBSD.org>2015-10-22 09:33:34 +0000
commitaff5735784df44945af1de1cf35b5df0779bb097 (patch)
tree8d088ef4526d83dbcb1235ccc1a30a87606ea4b2 /sys/kern/subr_syscall.c
parentb78ef4bd86f5fbc328996350735aa6586cd1bc35 (diff)
downloadsrc-aff5735784df44945af1de1cf35b5df0779bb097.tar.gz
src-aff5735784df44945af1de1cf35b5df0779bb097.zip
Add a way to distinguish between forking and thread creation in schedtail.
For CloudABI we need to initialize the registers of new threads differently based on whether the thread got created through a fork or through simple thread creation. Add a flag, TDP_FORKING, that is set by do_fork() and cleared by fork_exit(). This can be tested against in schedtail. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3973
Notes
Notes: svn path=/head/; revision=289748
Diffstat (limited to 'sys/kern/subr_syscall.c')
-rw-r--r--sys/kern/subr_syscall.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
index 71f3d5998367..c0763262f74b 100644
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -176,6 +176,9 @@ syscallret(struct thread *td, int error, struct syscall_args *sa)
struct proc *p, *p2;
int traced;
+ KASSERT((td->td_pflags & TDP_FORKING) == 0,
+ ("fork() did not clear TDP_FORKING upon completion"));
+
p = td->td_proc;
/*