Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 2003 16:56:10 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 31831 for review
Message-ID:  <200305242356.h4ONuAhQ018523@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31831

Change 31831 by marcel@marcel_nfs on 2003/05/24 16:56:04

	IFC @31826

Affected files ...

.. //depot/projects/ia64/gnu/lib/libstdc++/Makefile#16 integrate
.. //depot/projects/ia64/gnu/usr.bin/cc/cc_int/Makefile#7 integrate
.. //depot/projects/ia64/gnu/usr.bin/cc/cc_int/amd64.patch#1 branch
.. //depot/projects/ia64/lib/libc/amd64/SYS.h#2 integrate
.. //depot/projects/ia64/lib/libc/amd64/sys/brk.S#2 integrate
.. //depot/projects/ia64/lib/libc/amd64/sys/exect.S#2 integrate
.. //depot/projects/ia64/lib/libc/amd64/sys/ptrace.S#2 integrate
.. //depot/projects/ia64/lib/libc/amd64/sys/sbrk.S#2 integrate
.. //depot/projects/ia64/lib/libc/amd64/sys/setlogin.S#2 integrate
.. //depot/projects/ia64/lib/libc/amd64/sys/vfork.S#2 integrate
.. //depot/projects/ia64/lib/libc/posix1e/mac.conf.5#3 integrate
.. //depot/projects/ia64/lib/libc_r/man/pthread_getconcurrency.3#2 integrate
.. //depot/projects/ia64/lib/libpam/modules/pam_chroot/pam_chroot.8#3 integrate
.. //depot/projects/ia64/lib/libpthread/man/pthread_attr_get_np.3#2 integrate
.. //depot/projects/ia64/lib/libpthread/sys/lock.c#4 integrate
.. //depot/projects/ia64/lib/libpthread/sys/lock.h#4 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_cancel.c#6 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_concurrency.c#3 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_cond.c#9 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_create.c#9 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_detach.c#4 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_find_thread.c#4 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_join.c#5 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_kern.c#17 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_nanosleep.c#5 integrate
.. //depot/projects/ia64/lib/libpthread/thread/thr_sig.c#9 integrate
.. //depot/projects/ia64/libexec/Makefile#17 integrate
.. //depot/projects/ia64/libexec/rtld-elf/amd64/reloc.c#2 integrate
.. //depot/projects/ia64/libexec/rtld-elf/amd64/rtld_start.S#2 integrate
.. //depot/projects/ia64/release/doc/en_US.ISO8859-1/hardware/common/dev.sgml#52 integrate
.. //depot/projects/ia64/sbin/bsdlabel/bsdlabel.8#4 integrate
.. //depot/projects/ia64/sbin/mksnap_ffs/mksnap_ffs.8#2 integrate
.. //depot/projects/ia64/share/man/man4/usb.4#9 integrate
.. //depot/projects/ia64/share/man/man9/vnode.9#9 integrate
.. //depot/projects/ia64/sys/amd64/include/asm.h#3 integrate
.. //depot/projects/ia64/sys/dev/cardbus/cardbus_cis.c#14 integrate
.. //depot/projects/ia64/sys/ia64/ia64/exception.s#24 integrate
.. //depot/projects/ia64/sys/ia64/ia64/syscall.s#8 integrate
.. //depot/projects/ia64/sys/ia64/ia64/trap.c#51 integrate
.. //depot/projects/ia64/sys/ia64/include/cpu.h#14 integrate
.. //depot/projects/ia64/sys/ia64/include/cpufunc.h#11 integrate
.. //depot/projects/ia64/usr.sbin/Makefile#38 integrate
.. //depot/projects/ia64/usr.sbin/sysinstall/disks.c#14 integrate
.. //depot/projects/ia64/usr.sbin/sysinstall/dist.c#20 integrate
.. //depot/projects/ia64/usr.sbin/sysinstall/install.c#19 integrate
.. //depot/projects/ia64/usr.sbin/sysinstall/label.c#17 integrate
.. //depot/projects/ia64/usr.sbin/sysinstall/menus.c#30 integrate
.. //depot/projects/ia64/usr.sbin/sysinstall/sysinstall.h#20 integrate

Differences ...

==== //depot/projects/ia64/gnu/lib/libstdc++/Makefile#16 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/lib/libstdc++/Makefile,v 1.42 2003/02/10 06:09:55 kan Exp $
+# $FreeBSD: src/gnu/lib/libstdc++/Makefile,v 1.43 2003/05/24 19:38:18 peter Exp $
 
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
 SRCDIR=	${.CURDIR}/../../../contrib/libstdc++
@@ -8,6 +8,11 @@
        ${SRCDIR}/config/locale/generic ${SRCDIR} ${SRCDIR}/std \
        ${SUPDIR} ${GCCDIR}
 
+.if ${MACHINE_ARCH} == "amd64"
+NOPIC=		broken		# need libgcc.so or libgcc_pic.a
+NOSHARED=	broken
+.endif
+
 #SUBDIR=	doc
 
 LIB=		stdc++

==== //depot/projects/ia64/gnu/usr.bin/cc/cc_int/Makefile#7 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/usr.bin/cc/cc_int/Makefile,v 1.32 2002/09/17 01:48:49 peter Exp $
+# $FreeBSD: src/gnu/usr.bin/cc/cc_int/Makefile,v 1.33 2003/05/24 20:58:47 peter Exp $
 
 .include "../Makefile.inc"
 
@@ -23,8 +23,19 @@
 	toplev.c tree.c unroll.c varasm.c version.c xcoffout.c \
 	alias.c bitmap.c dyn-string.c \
 	gcse.c genrtl.c profile.c regmove.c varray.c \
-	attribs.c cselib.c debug.c rtl-error.c tree-dump.c tree-inline.c \
-	${GCC_CPU}.c
+	attribs.c cselib.c debug.c rtl-error.c tree-dump.c tree-inline.c
+
+.if ${TARGET_ARCH} != "amd64"
+SRCS+=	${GCC_CPU}.c
+.else
+SRCS+=	i386-hacked.c
+CLEANFILES+=	i386-hacked.c
+
+i386-hacked.c:	${GCCDIR}/config/i386/i386.c amd64.patch
+	rm -f i386-hacked.c		# in case p4 readonly copied
+	cp ${GCCDIR}/config/i386/i386.c i386-hacked.c
+	patch -b .orig < ${.CURDIR}/amd64.patch
+.endif
 
 SRCS+=	bb-reorder.c conflict.c ggc-common.c \
 	ggc-page.c ifcvt.c lists.c predict.c regrename.c resource.c sibcall.c \

==== //depot/projects/ia64/lib/libc/amd64/SYS.h#2 (text+ko) ====

@@ -34,19 +34,30 @@
  * SUCH DAMAGE.
  *
  *	@(#)SYS.h	5.5 (Berkeley) 5/7/91
- * $FreeBSD: src/lib/libc/amd64/SYS.h,v 1.25 2003/04/30 18:06:14 peter Exp $
+ * $FreeBSD: src/lib/libc/amd64/SYS.h,v 1.26 2003/05/24 17:35:23 peter Exp $
  */
 
 #include <sys/syscall.h>
 #include <machine/asm.h>
 
-#define	SYSCALL(x)	2: jmp PIC_PLT(HIDENAME(cerror));	\
+#ifdef PIC
+#define	SYSCALL(x)	2: movq PIC_GOT(HIDENAME(cerror)),%rcx;		\
+			jmp *%rcx;					\
+			ENTRY(__CONCAT(__sys_,x));			\
+			.weak CNAME(x);					\
+			.set CNAME(x),CNAME(__CONCAT(__sys_,x));	\
+			.weak CNAME(__CONCAT(_,x));			\
+			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
+			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2b
+#else
+#define	SYSCALL(x)	2: jmp HIDENAME(cerror);			\
 			ENTRY(__CONCAT(__sys_,x));			\
 			.weak CNAME(x);					\
 			.set CNAME(x),CNAME(__CONCAT(__sys_,x));	\
 			.weak CNAME(__CONCAT(_,x));			\
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
 			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2b
+#endif
 
 #define	RSYSCALL(x)	SYSCALL(x); ret
 

==== //depot/projects/ia64/lib/libc/amd64/sys/brk.S#2 (text+ko) ====

@@ -38,7 +38,7 @@
 	.asciz "@(#)brk.s	5.2 (Berkeley) 12/17/90"
 #endif /* SYSLIBC_SCCS and not lint */
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/brk.S,v 1.11 2003/04/30 18:16:33 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/brk.S,v 1.12 2003/05/24 17:35:23 peter Exp $");
 
 #include "SYS.h"
 
@@ -51,17 +51,36 @@
 ENTRY(brk)
 	pushq	%rdi
 	movq	%rdi,%rax
-	cmpq	%rax,PIC_GOT(HIDENAME(minbrk))
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(minbrk)),%rdx
+	cmpq	%rax,(%rdx)
+#else
+	cmpq	%rax,HIDENAME(minbrk)(%rip)
+#endif
 	jbe	ok
-	movq	PIC_GOT(HIDENAME(minbrk)),%rdi
+#ifdef PIC
+	movq	(%rdx),%rdi
+#else
+	movq	HIDENAME(minbrk)(%rip),%rdi
+#endif
 ok:
 	movq	$SYS_break,%rax
 	KERNCALL
 	jb	err
 	movq	0(%rsp),%rax
-	movq	%rax,PIC_GOT(HIDENAME(curbrk))
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(curbrk)),%rdx
+	movq	%rax,(%rdx)
+#else
+	movq	%rax,HIDENAME(curbrk)(%rip)
+#endif
 	movq	$0,%rax
 	popq	%rdi
 	ret
 err:
-	jmp	PIC_PLT(HIDENAME(cerror))
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(cerror)),%rdx
+	jmp	*%rdx
+#else
+	jmp	HIDENAME(cerror)
+#endif

==== //depot/projects/ia64/lib/libc/amd64/sys/exect.S#2 (text+ko) ====

@@ -38,7 +38,7 @@
 	.asciz "@(#)exect.s	5.1 (Berkeley) 4/23/90"
 #endif /* SYSLIBC_SCCS and not lint */
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/exect.S,v 1.10 2003/04/30 18:16:33 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/exect.S,v 1.11 2003/05/24 17:35:23 peter Exp $");
 
 #include "SYS.h"
 #include <machine/psl.h>
@@ -51,4 +51,9 @@
 	pushq	%r8
 	popfq
 	KERNCALL
-	jmp	PIC_PLT(HIDENAME(cerror))	/* exect(file, argv, env); */
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(cerror)),%rdx
+	jmp	*%rdx
+#else
+	jmp	HIDENAME(cerror)
+#endif

==== //depot/projects/ia64/lib/libc/amd64/sys/ptrace.S#2 (text+ko) ====

@@ -38,16 +38,26 @@
 	.asciz "@(#)ptrace.s	5.1 (Berkeley) 4/23/90"
 #endif /* SYSLIBC_SCCS and not lint */
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/ptrace.S,v 1.10 2003/04/30 18:16:33 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/ptrace.S,v 1.11 2003/05/24 17:35:23 peter Exp $");
 
 #include "SYS.h"
 
 ENTRY(ptrace)
 	xorl	%eax,%eax
-        movl    %eax,PIC_GOT(CNAME(errno))
+#ifdef PIC
+	movq	PIC_GOT(CNAME(errno)),%r8
+	movl	%eax,(%r8)
+#else
+	movl	%eax,CNAME(errno)(%rip)
+#endif
 	mov	$SYS_ptrace,%eax
 	KERNCALL
 	jb	err
 	ret
 err:
-	jmp	PIC_PLT(HIDENAME(cerror))
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(cerror)),%rdx
+	jmp	*%rdx
+#else
+	jmp	HIDENAME(cerror)
+#endif

==== //depot/projects/ia64/lib/libc/amd64/sys/sbrk.S#2 (text+ko) ====

@@ -38,7 +38,7 @@
 	.asciz "@(#)sbrk.s	5.1 (Berkeley) 4/23/90"
 #endif /* SYSLIBC_SCCS and not lint */
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/sbrk.S,v 1.12 2003/04/30 18:16:33 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/sbrk.S,v 1.13 2003/05/24 17:35:23 peter Exp $");
 
 #include "SYS.h"
 
@@ -54,19 +54,38 @@
 ENTRY(sbrk)
 	pushq	%rdi
 	movq	%rdi,%rcx
-	movq	PIC_GOT(HIDENAME(curbrk)),%rax
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(curbrk)),%rdx
+	movq	(%rdx),%rax
+#else
+	movq	HIDENAME(curbrk)(%rip),%rax
+#endif
 	testq	%rcx,%rcx
 	jz	back
 	addq	%rax,%rdi
 	mov	$SYS_break,%eax
 	KERNCALL
 	jb	err
-	movq	PIC_GOT(HIDENAME(curbrk)),%rax
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(curbrk)),%rdx
+	movq	(%rdx),%rax
+#else
+	movq	HIDENAME(curbrk)(%rip),%rax
+#endif
 	movq	0(%rsp), %rcx
-	addq	%rcx,PIC_GOT(HIDENAME(curbrk))
+#ifdef PIC
+	addq	%rcx,(%rdx)
+#else
+	addq	%rcx,HIDENAME(curbrk)(%rip)
+#endif
 back:
 	addq	$8, %rsp
 	ret
 err:
 	addq	$8, %rsp
-	jmp	PIC_PLT(HIDENAME(cerror))
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(cerror)),%rdx
+	jmp	*%rdx
+#else
+	jmp	HIDENAME(cerror)
+#endif

==== //depot/projects/ia64/lib/libc/amd64/sys/setlogin.S#2 (text+ko) ====

@@ -38,12 +38,17 @@
 	.asciz "@(#)setlogin.s	5.2 (Berkeley) 4/12/91"
 #endif /* LIBC_SCCS and not lint */
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/setlogin.S,v 1.10 2003/04/30 18:16:33 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/setlogin.S,v 1.11 2003/05/24 17:35:23 peter Exp $");
 
 #include "SYS.h"
 
 .globl	CNAME(_logname_valid)		/* in _getlogin() */
 
 SYSCALL(setlogin)
-	movl	$0,PIC_GOT(CNAME(_logname_valid))
+#ifdef PIC
+	movq	PIC_GOT(CNAME(_logname_valid)),%rdx
+	movl	$0,(%rdx)
+#else
+	movl	$0,CNAME(_logname_valid)(%rip)
+#endif
 	ret				/* setlogin(name) */

==== //depot/projects/ia64/lib/libc/amd64/sys/vfork.S#2 (text+ko) ====

@@ -38,7 +38,7 @@
 	.asciz "@(#)Ovfork.s	5.1 (Berkeley) 4/23/90"
 #endif /* SYSLIBC_SCCS and not lint */
 #include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/vfork.S,v 1.20 2003/04/30 18:13:13 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/amd64/sys/vfork.S,v 1.21 2003/05/24 17:35:23 peter Exp $");
 
 #include "SYS.h"
 
@@ -53,5 +53,10 @@
 	jb	1f
 	jmp	*%rsi
 1:
-	pushq	%rcx
-	jmp     PIC_PLT(HIDENAME(cerror))
+	pushq	%rsi
+#ifdef PIC
+	movq	PIC_GOT(HIDENAME(cerror)),%rdx
+	jmp	*%rdx
+#else
+	jmp     HIDENAME(cerror)
+#endif

==== //depot/projects/ia64/lib/libc/posix1e/mac.conf.5#3 (text+ko) ====

@@ -27,23 +27,22 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc/posix1e/mac.conf.5,v 1.3 2003/04/26 03:32:18 rwatson Exp $
+.\" $FreeBSD: src/lib/libc/posix1e/mac.conf.5,v 1.4 2003/05/24 19:50:43 ru Exp $
 .\"
 .Dd April 19, 2003
 .Dt MAC.CONF 5
 .Os
 .Sh NAME
 .Nm mac.conf
-.Nd Format of the MAC library configuration file
+.Nd format of the MAC library configuration file
 .Sh DESCRIPTION
 The
 .Nm
 file configures the default label elements to be used by policy-agnostic
 applications that operate on MAC labels.
-.Nm
-contains a series of default label sets specified by object class,
+A file contains a series of default label sets specified by object class,
 in addition to blank lines and comments preceded by a
-.Dv #
+.Ql #
 symbol.
 .Pp
 Each declaration consists of a single line with two fields separated
@@ -53,7 +52,7 @@
 library calls prior to an application invocation of a function from
 .Xr mac_get 3 .
 Label element names may optionally begin with a
-.Dv ?
+.Ql \&?
 symbol to indicate that a failure to retrieve the label element for
 an object should be silently ignored, and improves usability if the
 set of MAC policies may change over time.
@@ -86,9 +85,9 @@
 MAC library configuration file.
 .El
 .Sh SEE ALSO
+.Xr mac 3 ,
 .Xr mac_get 3 ,
 .Xr mac_prepare 3 ,
-.Xr mac 3 ,
 .Xr mac 4 ,
 .Xr mac 9
 .Sh HISTORY

==== //depot/projects/ia64/lib/libc_r/man/pthread_getconcurrency.3#2 (text+ko) ====

@@ -22,12 +22,12 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc_r/man/pthread_getconcurrency.3,v 1.1 2003/04/20 01:53:12 jdp Exp $
+.\" $FreeBSD: src/lib/libc_r/man/pthread_getconcurrency.3,v 1.2 2003/05/24 19:50:43 ru Exp $
 .Dd April 11, 2003
 .Dt PTHREAD_GETCONCURRENCY 3
 .Os
 .Sh NAME
-.Nm pthread_getconcurrency,
+.Nm pthread_getconcurrency ,
 .Nm pthread_setconcurrency
 .Nd get or set level of concurrency
 .Sh LIBRARY
@@ -35,7 +35,7 @@
 .Sh SYNOPSIS
 .In pthread.h
 .Ft int
-.Fn pthread_getconcurrency "void"
+.Fn pthread_getconcurrency void
 .Ft int
 .Fn pthread_setconcurrency "int new_level"
 .Sh DESCRIPTION
@@ -43,29 +43,37 @@
 .Fn pthread_getconcurrency
 function allows an application to inform the threads implementation
 of its desired concurrency level,
-.Va new_level .
+.Fa new_level .
 The actual level of concurrency provided by the implementation
-as a result of this function call is unspecified.  If new_level is
-zero, it causes the implementation to maintain the concurrency
+as a result of this function call is unspecified.
+If
+.Fa new_level
+is zero, it causes the implementation to maintain the concurrency
 level at its discretion as if
 .Fn pthread_setconcurrency
-was never called.  The
+was never called.
+The
 .Fn pthread_getconcurrency
 function returns the value set by a previous call to the
 .Fn pthread_setconcurrency
-function.  If the
+function.
+If the
 .Fn pthread_setconcurrency
 function was not previously called, this function returns zero to
 indicate that the implementation is maintaining the concurrency
-level.  When an application calls
-.Fn pthread_setconcurrency
+level.
+When an application calls
+.Fn pthread_setconcurrency ,
 it is informing the implementation of its desired concurrency
-level.  The implementation uses this as a hint, not a requirement.
+level.
+The implementation uses this as a hint, not a requirement.
 .Sh RETURN VALUES
 If successful, the
 .Fn pthread_setconcurrency
-function returns zero.  Otherwise, an error number is returned
-to indicate the error.  The
+function returns zero.
+Otherwise, an error number is returned
+to indicate the error.
+The
 .Fn pthread_getconcurrency
 function always returns the concurrency level set by a previous
 call to
@@ -82,21 +90,21 @@
 .Bl -tag -width Er
 .It Bq Er EINVAL
 The value specified by
-.Va new_level
+.Fa new_level
 is negative.
 .It Bq Er EAGAIN
-The value specific by
-.Va new_level
+The value specified by
+.Fa new_level
 would cause a system resource to be exceeded.
 .El
 .Sh APPLICATION USAGE
 Use of these functions changes the state of the underlying
-concurrency upon which the application depends.  Library
-developers are advised to not use the
+concurrency upon which the application depends.
+Library developers are advised to not use the
 .Fn pthread_getconcurrency
 and
 .Fn pthread_setconcurrency
-functions since their use may conflict with an applications
+functions since their use may conflict with an application's
 use of these functions.
 .Sh STANDARDS
 The
@@ -104,4 +112,4 @@
 and
 .Fn pthread_setconcurrency
 functions conform to
-.St -susv2
+.St -susv2 .

==== //depot/projects/ia64/lib/libpam/modules/pam_chroot/pam_chroot.8#3 (text+ko) ====

@@ -3,7 +3,7 @@
 .\"
 .\" Portions of this software were developed for the FreeBSD Project by
 .\" ThinkSec AS and NAI Labs, the Security Research Division of Network
-.\" Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
+.\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
 .\" ("CBOSS"), as part of the DARPA CHATS research program.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libpam/modules/pam_chroot/pam_chroot.8,v 1.2 2003/04/08 16:52:18 des Exp $
+.\" $FreeBSD: src/lib/libpam/modules/pam_chroot/pam_chroot.8,v 1.3 2003/05/24 19:50:43 ru Exp $
 .\"
 .Dd February 10, 2003
 .Dt PAM_CHROOT 8
@@ -48,11 +48,11 @@
 The chroot service module for PAM chroots users into either a
 predetermined directory or one derived from their home directory.
 If a user's home directory as specified in the
-.Dv passwd
+.Vt passwd
 structure returned by
 .Xr getpwnam 3
 contains the string
-.Dq /./ ,
+.Dq Li /./ ,
 the portion of the directory name to the left of that string is used
 as the chroot directory, and the portion to the right will be the
 current working directory inside the chroot tree.
@@ -63,7 +63,7 @@
 options (see below) are used.
 .Bl -tag -width ".Cm also_root"
 .It Cm also_root
-Do not hold user id 0 exempt from the chroot requirement.
+Do not hold user ID 0 exempt from the chroot requirement.
 .It Cm always
 Report a failure if a chroot directory could not be derived from the
 user's home directory, and the

==== //depot/projects/ia64/lib/libpthread/man/pthread_attr_get_np.3#2 (text+ko) ====

@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libpthread/man/pthread_attr_get_np.3,v 1.1 2003/03/03 22:40:20 phantom Exp $
+.\" $FreeBSD: src/lib/libpthread/man/pthread_attr_get_np.3,v 1.2 2003/05/24 19:50:43 ru Exp $
 .\"
 .Dd January 31, 2003
 .Dt PTHREAD_ATTR_GET_NP 3
@@ -87,8 +87,9 @@
 function returns 0.
 Otherwise, an error number is returned to indicate the error.
 .Sh ERRORS
+The
 .Fn pthread_attr_get_np
-will fail if:
+function will fail if:
 .Bl -tag -width Er
 .It Bq Er EINVAL
 Invalid value for one of given parameters.

==== //depot/projects/ia64/lib/libpthread/sys/lock.c#4 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/sys/lock.c,v 1.4 2003/05/16 19:58:29 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/sys/lock.c,v 1.5 2003/05/24 02:29:25 deischen Exp $
  */
 
 #include <sys/types.h>
@@ -64,7 +64,6 @@
 		lck->l_head->lr_locked = 0;
 		lck->l_head->lr_watcher = NULL;
 		lck->l_head->lr_owner = NULL;
-		lck->l_head->lr_waiting = 0;
 		lck->l_head->lr_active = 1;
 		lck->l_tail = lck->l_head;
 	}
@@ -84,7 +83,6 @@
 		lu->lu_myreq->lr_locked = 1;
 		lu->lu_myreq->lr_watcher = NULL;
 		lu->lu_myreq->lr_owner = lu;
-		lu->lu_myreq->lr_waiting = 0;
 		lu->lu_myreq->lr_active = 0;
 		lu->lu_watchreq = NULL;
 		lu->lu_priority = 0;
@@ -109,6 +107,7 @@
 _lock_acquire(struct lock *lck, struct lockuser *lu, int prio)
 {
 	int i;
+	long lval;
 
 	/**
 	 * XXX - We probably want to remove these checks to optimize
@@ -126,7 +125,6 @@
 		LCK_ASSERT(lu->lu_myreq->lr_locked == 1);
 		LCK_ASSERT(lu->lu_myreq->lr_watcher == NULL);
 		LCK_ASSERT(lu->lu_myreq->lr_owner == lu);
-		LCK_ASSERT(lu->lu_myreq->lr_waiting == 0);
 		LCK_ASSERT(lu->lu_watchreq == NULL);
 
 		lu->lu_priority = prio;
@@ -169,10 +167,13 @@
 				if (lu->lu_watchreq->lr_active == 0)
 					break;
 			}
-			atomic_store_rel_long(&lu->lu_watchreq->lr_waiting, 1);
-			while (lu->lu_watchreq->lr_locked != 0)
+			atomic_swap_long((long *)&lu->lu_watchreq->lr_locked,
+			    2, &lval);
+			if (lval == 0)
+				lu->lu_watchreq->lr_locked = 0;
+			else
 				lck->l_wait(lck, lu);
-			atomic_store_rel_long(&lu->lu_watchreq->lr_waiting, 0);
+
 		}
 	}
 	lu->lu_myreq->lr_active = 1;
@@ -187,6 +188,7 @@
 	struct lockuser *lu_tmp, *lu_h;
 	struct lockreq *myreq;
 	int prio_h;
+	long lval;
 
 	/**
 	 * XXX - We probably want to remove these checks to optimize
@@ -224,7 +226,6 @@
 		lu->lu_myreq->lr_locked = 1;
 		lu->lu_myreq->lr_owner = lu;
 		lu->lu_myreq->lr_watcher = NULL;
-		lu->lu_myreq->lr_waiting = 0;
 		/*
 		 * Traverse the list of lock requests in reverse order
 		 * looking for the user with the highest priority.
@@ -238,17 +239,26 @@
 		}
 		if (lu_h != NULL) {
 			/* Give the lock to the highest priority user. */
-			if ((lu_h->lu_watchreq->lr_waiting != 0) &&
-			    (lck->l_wakeup != NULL))
-				/* Notify the sleeper */
-				lck->l_wakeup(lck, lu_h->lu_myreq->lr_watcher);
+			if (lck->l_wakeup != NULL) {
+				atomic_swap_long(
+				    (long *)&lu_h->lu_watchreq->lr_locked,
+				    0, &lval);
+				if (lval == 2)
+					/* Notify the sleeper */
+					lck->l_wakeup(lck,
+					    lu_h->lu_myreq->lr_watcher);
+			}
 			else
-				atomic_store_rel_long(&lu_h->lu_watchreq->lr_locked, 0);
+				atomic_store_rel_long(
+				    &lu_h->lu_watchreq->lr_locked, 0);
 		} else {
-			if ((myreq->lr_waiting != 0) &&
-			    (lck->l_wakeup != NULL))
-				/* Notify the sleeper */
-				lck->l_wakeup(lck, myreq->lr_watcher);
+			if (lck->l_wakeup != NULL) {
+				atomic_swap_long((long *)&myreq->lr_locked,
+				    0, &lval);
+				if (lval == 2)
+					/* Notify the sleeper */
+					lck->l_wakeup(lck, myreq->lr_watcher);
+			}
 			else
 				/* Give the lock to the previous request. */
 				atomic_store_rel_long(&myreq->lr_locked, 0);
@@ -263,10 +273,12 @@
 		lu->lu_myreq = lu->lu_watchreq;
 		lu->lu_watchreq = NULL;
 		lu->lu_myreq->lr_locked = 1;
-		lu->lu_myreq->lr_waiting = 0;
-		if (myreq->lr_waiting != 0 && lck->l_wakeup) 
-			/* Notify the sleeper */
-			lck->l_wakeup(lck, myreq->lr_watcher);
+		if (lck->l_wakeup) {
+			atomic_swap_long((long *)&myreq->lr_locked, 0, &lval);
+			if (lval == 2)
+				/* Notify the sleeper */
+				lck->l_wakeup(lck, myreq->lr_watcher);
+		}
 		else
 			/* Give the lock to the previous request. */
 			atomic_store_rel_long(&myreq->lr_locked, 0);
@@ -277,7 +289,7 @@
 void
 _lock_grant(struct lock *lck /* unused */, struct lockuser *lu)
 {
-	atomic_store_rel_long(&lu->lu_watchreq->lr_locked, 0);
+	atomic_store_rel_long(&lu->lu_watchreq->lr_locked, 3);
 }
 
 void

==== //depot/projects/ia64/lib/libpthread/sys/lock.h#4 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/sys/lock.h,v 1.4 2003/05/16 19:58:29 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/sys/lock.h,v 1.5 2003/05/24 02:29:25 deischen Exp $
  */
 
 #ifndef _LOCK_H_
@@ -54,7 +54,6 @@
 	volatile long	lr_locked;	/* lock granted = 0, busy otherwise */
 	struct lockuser	*lr_watcher;	/* only used for priority locks */
 	struct lockuser	*lr_owner;	/* only used for priority locks */
-	long		lr_waiting;	/* non-zero when wakeup needed */
 	volatile int	lr_active;	/* non-zero if the lock is last lock for thread */
 };
 
@@ -73,7 +72,7 @@
 
 #define	_LCK_BUSY(lu)			((lu)->lu_watchreq->lr_locked != 0)
 #define	_LCK_ACTIVE(lu)			((lu)->lu_watchreq->lr_active != 0)
-#define	_LCK_GRANTED(lu)		((lu)->lu_watchreq->lr_locked == 0)
+#define	_LCK_GRANTED(lu)		((lu)->lu_watchreq->lr_locked == 3)
 
 #define	_LCK_SET_PRIVATE(lu, p)		(lu)->lu_private = (void *)(p)
 #define	_LCK_GET_PRIVATE(lu)		(lu)->lu_private

==== //depot/projects/ia64/lib/libpthread/thread/thr_cancel.c#6 (text+ko) ====

@@ -1,6 +1,6 @@
 /*
  * David Leonard <d@openbsd.org>, 1999. Public domain.
- * $FreeBSD: src/lib/libpthread/thread/thr_cancel.c,v 1.20 2003/05/06 00:02:54 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/thread/thr_cancel.c,v 1.21 2003/05/24 02:29:25 deischen Exp $
  */
 #include <sys/errno.h>
 #include <pthread.h>
@@ -19,6 +19,7 @@
 _pthread_cancel(pthread_t pthread)
 {
 	struct pthread *curthread = _get_curthread();
+	struct pthread *joinee = NULL;
 	int ret;
 
 	if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) == 0) {
@@ -64,7 +65,17 @@
 				break;
 
 			case PS_JOIN:
+				/* Disconnect the thread from the joinee: */
+				joinee = pthread->join_status.thread;
+				pthread->join_status.thread = NULL;
 				pthread->cancelflags |= THR_CANCELLING;
+				_thr_setrunnable_unlocked(pthread);
+				if ((joinee != NULL) &&
+				    (curthread->kseg == joinee->kseg)) {
+					/* Remove the joiner from the joinee. */
+					joinee->joiner = NULL;
+					joinee = NULL;
+				}
 				break;
 
 			case PS_SUSPENDED:
@@ -103,6 +114,15 @@
 		 */
 		THR_SCHED_UNLOCK(curthread, pthread);
 		_thr_ref_delete(curthread, pthread);
+
+		if ((joinee != NULL) &&
+		    (_thr_ref_add(curthread, joinee, /* include dead */1) == 0)) {
+			/* Remove the joiner from the joinee. */
+			THR_SCHED_LOCK(curthread, joinee);
+			joinee->joiner = NULL;
+			THR_SCHED_UNLOCK(curthread, joinee);
+			_thr_ref_delete(curthread, joinee);
+		}
 	}
 	return (ret);
 }

==== //depot/projects/ia64/lib/libpthread/thread/thr_concurrency.c#3 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/thread/thr_concurrency.c,v 1.2 2003/04/28 23:56:11 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/thread/thr_concurrency.c,v 1.3 2003/05/24 02:29:25 deischen Exp $
  */
 #include <errno.h>
 #include <pthread.h>
@@ -103,6 +103,7 @@
 		TAILQ_INSERT_TAIL(&newkse->k_kseg->kg_kseq,
 		    newkse, k_kgqe);
 		newkse->k_kseg->kg_ksecount++;
+		newkse->k_flags |= KF_STARTED;
 		KSE_SCHED_UNLOCK(curthread->kse, newkse->k_kseg);
 		if (kse_create(&newkse->k_mbx, 0) != 0) {
 			KSE_SCHED_LOCK(curthread->kse, newkse->k_kseg);

==== //depot/projects/ia64/lib/libpthread/thread/thr_cond.c#9 (text+ko) ====

@@ -29,7 +29,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/thread/thr_cond.c,v 1.41 2003/05/19 23:04:50 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/thread/thr_cond.c,v 1.42 2003/05/24 02:29:25 deischen Exp $
  */
 #include <stdlib.h>
 #include <errno.h>
@@ -184,6 +184,9 @@
 	    (rval = pthread_cond_init(cond, NULL)) != 0)
 		return (rval);
 
+	if (!_kse_isthreaded())
+		_kse_setthreaded(1);
+
 	/*
 	 * Enter a loop waiting for a condition signal or broadcast
 	 * to wake up this thread.  A loop is needed in case the waiting
@@ -388,6 +391,9 @@
 	if (*cond == NULL && (rval = pthread_cond_init(cond, NULL)) != 0)
 		return (rval);
 
+	if (!_kse_isthreaded())
+		_kse_setthreaded(1);
+
 	/*
 	 * Enter a loop waiting for a condition signal or broadcast
 	 * to wake up this thread.  A loop is needed in case the waiting

==== //depot/projects/ia64/lib/libpthread/thread/thr_create.c#9 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/thread/thr_create.c,v 1.44 2003/05/04 16:17:01 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/thread/thr_create.c,v 1.45 2003/05/24 02:29:25 deischen Exp $
  */
 #include <errno.h>
 #include <stdlib.h>
@@ -44,8 +44,6 @@
 #include "thr_private.h"
 #include "libc_private.h"
 
-static u_int64_t next_uniqueid = 1;
-
 #define OFF(f)	offsetof(struct pthread, f)
 int _thread_next_offset			= OFF(tle.tqe_next);
 int _thread_uniqueid_offset		= OFF(uniqueid);
@@ -145,8 +143,13 @@
 		    || ((kseg = _kseg_alloc(curthread)) == NULL))) {
 			/* Insufficient memory to create a new KSE/KSEG: */
 			ret = EAGAIN;
-			if (kse != NULL)
+#ifndef	KMF_DONE
+#define	KMF_DONE	0x04
+#endif
+			if (kse != NULL) {
+				kse->k_mbx.km_flags |= KMF_DONE;
 				_kse_free(curthread, kse);
+			}
 			if ((new_thread->attr.flags & THR_STACK_USER) == 0) {
 				crit = _kse_critical_enter();
 				curkse = _get_curkse();
@@ -161,7 +164,8 @@
 		else {
 			if (kseg != NULL) {
 				/* Add the KSE to the KSEG's list of KSEs. */
-				TAILQ_INSERT_HEAD(&kseg->kg_kseq, kse, k_qe);
+				TAILQ_INSERT_HEAD(&kseg->kg_kseq, kse, k_kgqe);
+				kseg->kg_ksecount = 1;
 				kse->k_kseg = kseg;
 				kse->k_schedq = &kseg->kg_schedq;
 			}
@@ -286,30 +290,11 @@
 				kse->k_mbx.km_curthread = NULL;
 			}
 
-			crit = _kse_critical_enter();
-			KSE_LOCK_ACQUIRE(curthread->kse, &_thread_list_lock);
 			/*
-			 * Initialise the unique id which GDB uses to
-			 * track threads.
-			 */
-			new_thread->uniqueid = next_uniqueid++;
-			/* Add the thread to the linked list of all threads: */
-			THR_LIST_ADD(new_thread);
-			KSE_LOCK_RELEASE(curthread->kse, &_thread_list_lock);
-
-			/*
 			 * Schedule the new thread starting a new KSEG/KSE
 			 * pair if necessary.
 			 */
 			ret = _thr_schedule_add(curthread, new_thread);
-			if (ret != 0) {
-				KSE_LOCK_ACQUIRE(curthread->kse,
-				    &_thread_list_lock);
-				THR_LIST_REMOVE(new_thread);
-				KSE_LOCK_RELEASE(curthread->kse,
-				    &_thread_list_lock);
-			}
-			_kse_critical_leave(crit);
 			if (ret != 0)
 				free_thread(curthread, new_thread);
 
@@ -341,7 +326,7 @@
 	/* Check if a stack was specified in the thread attributes: */
 	if ((pattr->stackaddr_attr) != NULL) {
 		pattr->guardsize_attr = 0;
-		pattr->flags = THR_STACK_USER;
+		pattr->flags |= THR_STACK_USER;
 		ret = 0;
 	}
 	else

==== //depot/projects/ia64/lib/libpthread/thread/thr_detach.c#4 (text+ko) ====

@@ -29,7 +29,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/thread/thr_detach.c,v 1.21 2003/04/28 23:56:11 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/thread/thr_detach.c,v 1.22 2003/05/24 02:29:25 deischen Exp $
  */
 #include <sys/types.h>
 #include <machine/atomic.h>
@@ -70,8 +70,7 @@
 
 		/* Retrieve any joining thread and remove it: */
 		joiner = pthread->joiner;
-		pthread->joiner = NULL;
-		if (joiner->kseg == pthread->kseg) {
+		if ((joiner != NULL) && (joiner->kseg == pthread->kseg)) {
 			/*
 			 * We already own the scheduler lock for the joiner.
 			 * Take advantage of that and make the joiner runnable.
@@ -89,10 +88,10 @@
 			joiner = NULL;
 		}
 		THR_SCHED_UNLOCK(curthread, pthread);
-		_thr_ref_delete(curthread, pthread);
 
 		/* See if there is a thread waiting in pthread_join(): */
-		if (joiner != NULL && _thr_ref_add(curthread, joiner, 0) == 0) {
+		if ((joiner != NULL) &&
+		    (_thr_ref_add(curthread, joiner, 0) == 0)) {
 			/* Lock the joiner before fiddling with it. */
 			THR_SCHED_LOCK(curthread, joiner);
 			if (joiner->join_status.thread == pthread) {
@@ -108,6 +107,7 @@
 			THR_SCHED_UNLOCK(curthread, joiner);
 			_thr_ref_delete(curthread, joiner);
 		}
+		_thr_ref_delete(curthread, pthread);
 	}
 
 	/* Return the completion status: */

==== //depot/projects/ia64/lib/libpthread/thread/thr_find_thread.c#4 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libpthread/thread/thr_find_thread.c,v 1.11 2003/04/28 23:56:11 deischen Exp $
+ * $FreeBSD: src/lib/libpthread/thread/thr_find_thread.c,v 1.12 2003/05/24 02:29:25 deischen Exp $
  */
 #include <errno.h>
 #include <pthread.h>
@@ -47,13 +47,15 @@
 {
 	kse_critical_t crit;

>>> TRUNCATED FOR MAIL (1000 lines) <<<


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