linux32_machdep.c (169458) | linux32_machdep.c (170307) |
---|---|
1/*- 2 * Copyright (c) 2004 Tim J. Robbins 3 * Copyright (c) 2002 Doug Rabson 4 * Copyright (c) 2000 Marcel Moolenaar 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 15 unchanged lines hidden (view full) --- 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Tim J. Robbins 3 * Copyright (c) 2002 Doug Rabson 4 * Copyright (c) 2000 Marcel Moolenaar 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 15 unchanged lines hidden (view full) --- 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_machdep.c 169458 2007-05-11 01:25:51Z kan $"); | 32__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_machdep.c 170307 2007-06-05 00:00:57Z jeff $"); |
33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> 37#include <sys/file.h> 38#include <sys/fcntl.h> 39#include <sys/clock.h> 40#include <sys/imgact.h> --- 440 unchanged lines hidden (view full) --- 481 if (error) 482 return (error); 483 484 td2 = FIRST_THREAD_IN_PROC(p2); 485 486 /* 487 * Make this runnable after we are finished with it. 488 */ | 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> 37#include <sys/file.h> 38#include <sys/fcntl.h> 39#include <sys/clock.h> 40#include <sys/imgact.h> --- 440 unchanged lines hidden (view full) --- 481 if (error) 482 return (error); 483 484 td2 = FIRST_THREAD_IN_PROC(p2); 485 486 /* 487 * Make this runnable after we are finished with it. 488 */ |
489 mtx_lock_spin(&sched_lock); | 489 thread_lock(td2); |
490 TD_SET_CAN_RUN(td2); 491 sched_add(td2, SRQ_BORING); | 490 TD_SET_CAN_RUN(td2); 491 sched_add(td2, SRQ_BORING); |
492 mtx_unlock_spin(&sched_lock); | 492 thread_unlock(td2); |
493 494 return (0); 495} 496 497int 498linux_vfork(struct thread *td, struct linux_vfork_args *args) 499{ 500 int error; --- 23 unchanged lines hidden (view full) --- 524 p2->p_flag |= P_PPWAIT; 525 PROC_UNLOCK(p2); 526 527 td2 = FIRST_THREAD_IN_PROC(p2); 528 529 /* 530 * Make this runnable after we are finished with it. 531 */ | 493 494 return (0); 495} 496 497int 498linux_vfork(struct thread *td, struct linux_vfork_args *args) 499{ 500 int error; --- 23 unchanged lines hidden (view full) --- 524 p2->p_flag |= P_PPWAIT; 525 PROC_UNLOCK(p2); 526 527 td2 = FIRST_THREAD_IN_PROC(p2); 528 529 /* 530 * Make this runnable after we are finished with it. 531 */ |
532 mtx_lock_spin(&sched_lock); | 532 thread_lock(td2); |
533 TD_SET_CAN_RUN(td2); 534 sched_add(td2, SRQ_BORING); | 533 TD_SET_CAN_RUN(td2); 534 sched_add(td2, SRQ_BORING); |
535 mtx_unlock_spin(&sched_lock); | 535 thread_unlock(td2); |
536 537 /* wait for the children to exit, ie. emulate vfork */ 538 PROC_LOCK(p2); 539 while (p2->p_flag & P_PPWAIT) 540 msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); 541 PROC_UNLOCK(p2); 542 543 return (0); --- 166 unchanged lines hidden (view full) --- 710 PROC_LOCK(p2); 711 p2->p_flag |= P_PPWAIT; 712 PROC_UNLOCK(p2); 713 } 714 715 /* 716 * Make this runnable after we are finished with it. 717 */ | 536 537 /* wait for the children to exit, ie. emulate vfork */ 538 PROC_LOCK(p2); 539 while (p2->p_flag & P_PPWAIT) 540 msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); 541 PROC_UNLOCK(p2); 542 543 return (0); --- 166 unchanged lines hidden (view full) --- 710 PROC_LOCK(p2); 711 p2->p_flag |= P_PPWAIT; 712 PROC_UNLOCK(p2); 713 } 714 715 /* 716 * Make this runnable after we are finished with it. 717 */ |
718 mtx_lock_spin(&sched_lock); | 718 thread_lock(td2); |
719 TD_SET_CAN_RUN(td2); 720 sched_add(td2, SRQ_BORING); | 719 TD_SET_CAN_RUN(td2); 720 sched_add(td2, SRQ_BORING); |
721 mtx_unlock_spin(&sched_lock); | 721 thread_unlock(td2); |
722 723 td->td_retval[0] = p2->p_pid; 724 td->td_retval[1] = 0; 725 726 if (args->flags & LINUX_CLONE_VFORK) { 727 /* wait for the children to exit, ie. emulate vfork */ 728 PROC_LOCK(p2); 729 while (p2->p_flag & P_PPWAIT) --- 634 unchanged lines hidden --- | 722 723 td->td_retval[0] = p2->p_pid; 724 td->td_retval[1] = 0; 725 726 if (args->flags & LINUX_CLONE_VFORK) { 727 /* wait for the children to exit, ie. emulate vfork */ 728 PROC_LOCK(p2); 729 while (p2->p_flag & P_PPWAIT) --- 634 unchanged lines hidden --- |