Deleted Added
full compact
linux32_machdep.c (166731) linux32_machdep.c (166944)
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 166731 2007-02-15 01:20:43Z jkim $");
32__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_machdep.c 166944 2007-02-24 16:49:25Z netchild $");
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>

--- 522 unchanged lines hidden (view full) ---

563
564 if (args->flags & CLONE_VM)
565 ff |= RFMEM;
566 if (args->flags & CLONE_SIGHAND)
567 ff |= RFSIGSHARE;
568 /*
569 * XXX: in linux sharing of fs info (chroot/cwd/umask)
570 * and open files is independant. in fbsd its in one
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>

--- 522 unchanged lines hidden (view full) ---

563
564 if (args->flags & CLONE_VM)
565 ff |= RFMEM;
566 if (args->flags & CLONE_SIGHAND)
567 ff |= RFSIGSHARE;
568 /*
569 * XXX: in linux sharing of fs info (chroot/cwd/umask)
570 * and open files is independant. in fbsd its in one
571 * structure but in reality it doesnt make any problems
572 * because both this flags are set at once usually.
571 * structure but in reality it doesn't cause any problems
572 * because both of these flags are usually set together.
573 */
574 if (!(args->flags & (CLONE_FILES | CLONE_FS)))
575 ff |= RFFDG;
576
577 /*
578 * Attempt to detect when linux_clone(2) is used for creating
579 * kernel threads. Unfortunately despite the existence of the
580 * CLONE_THREAD flag, version of linuxthreads package used in
581 * most popular distros as of beginning of 2005 doesn't make
573 */
574 if (!(args->flags & (CLONE_FILES | CLONE_FS)))
575 ff |= RFFDG;
576
577 /*
578 * Attempt to detect when linux_clone(2) is used for creating
579 * kernel threads. Unfortunately despite the existence of the
580 * CLONE_THREAD flag, version of linuxthreads package used in
581 * most popular distros as of beginning of 2005 doesn't make
582 * any use of it. Therefore, this detection relay fully on
582 * any use of it. Therefore, this detection relies on
583 * empirical observation that linuxthreads sets certain
584 * combination of flags, so that we can make more or less
585 * precise detection and notify the FreeBSD kernel that several
586 * processes are in fact part of the same threading group, so
587 * that special treatment is necessary for signal delivery
588 * between those processes and fd locking.
589 */
590 if ((args->flags & 0xffffff00) == THREADING_FLAGS)

--- 237 unchanged lines hidden (view full) ---

828 * limit to stack size of STACK_SIZE. Its just not
829 * enforced explicitly in linux. But, here we impose
830 * a limit of (STACK_SIZE - GUARD_SIZE) on the stack
831 * region, since we can do this with our mmap.
832 *
833 * Our mmap with MAP_STACK takes addr as the maximum
834 * downsize limit on BOS, and as len the max size of
835 * the region. It them maps the top SGROWSIZ bytes,
583 * empirical observation that linuxthreads sets certain
584 * combination of flags, so that we can make more or less
585 * precise detection and notify the FreeBSD kernel that several
586 * processes are in fact part of the same threading group, so
587 * that special treatment is necessary for signal delivery
588 * between those processes and fd locking.
589 */
590 if ((args->flags & 0xffffff00) == THREADING_FLAGS)

--- 237 unchanged lines hidden (view full) ---

828 * limit to stack size of STACK_SIZE. Its just not
829 * enforced explicitly in linux. But, here we impose
830 * a limit of (STACK_SIZE - GUARD_SIZE) on the stack
831 * region, since we can do this with our mmap.
832 *
833 * Our mmap with MAP_STACK takes addr as the maximum
834 * downsize limit on BOS, and as len the max size of
835 * the region. It them maps the top SGROWSIZ bytes,
836 * and autgrows the region down, up to the limit
836 * and auto grows the region down, up to the limit
837 * in addr.
838 *
839 * If we don't use the MAP_STACK option, the effect
840 * of this code is to allocate a stack region of a
841 * fixed size of (STACK_SIZE - GUARD_SIZE).
842 */
843
844 if ((caddr_t)PTRIN(linux_args->addr) + linux_args->len >

--- 345 unchanged lines hidden ---
837 * in addr.
838 *
839 * If we don't use the MAP_STACK option, the effect
840 * of this code is to allocate a stack region of a
841 * fixed size of (STACK_SIZE - GUARD_SIZE).
842 */
843
844 if ((caddr_t)PTRIN(linux_args->addr) + linux_args->len >

--- 345 unchanged lines hidden ---