CVS commit: src/distrib/sets/lists/modules

2014-03-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar  5 08:23:16 UTC 2014

Added Files:
src/distrib/sets/lists/modules: md.evbppc.powerpc
Removed Files:
src/distrib/sets/lists/modules: md.evbppc-powerpc

Log Message:
It is md.${MACHINE}.${MACHINE_ARCH}


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/distrib/sets/lists/modules/md.evbppc-powerpc
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/modules/md.evbppc.powerpc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/distrib/sets/lists/modules/md.evbppc.powerpc
diff -u /dev/null src/distrib/sets/lists/modules/md.evbppc.powerpc:1.1
--- /dev/null	Wed Mar  5 08:23:16 2014
+++ src/distrib/sets/lists/modules/md.evbppc.powerpc	Wed Mar  5 08:23:16 2014
@@ -0,0 +1,467 @@
+# $NetBSD: md.evbppc.powerpc,v 1.1 2014/03/05 08:23:16 martin Exp $
+./stand/powerpc-4xx			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/accf_dataready			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/accf_dataready/accf_dataready.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/accf_httpready			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/accf_httpready/accf_httpready.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/adosfsbase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/adosfs/adosfs.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/aiobase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/aio/aio.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/blowfish			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/blowfish/blowfish.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/bpfbase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/bpf/bpf.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/ccdbase-kernel-modules	kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/ccd/ccd.kmod			base-kernel-modules	kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/camellia			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/camellia/camellia.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/cast128base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/cast128/cast128.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/cd9660base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/cd9660/cd9660.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/cgdbase-kernel-modules	kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/cgd/cgd.kmod			base-kernel-modules	kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/chfsbase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/chfs/chfs.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/codabase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/coda/coda.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/coda5base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/coda5/coda5.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/compatbase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/compat/compat.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/compat_ossaudio			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/compat_ossaudio/compat_ossaudio.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/coredump			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/coredump/coredump.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/cryptobase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/crypto/crypto.kmod		base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/dbcoolbase-kernel-modules kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/dbcool/dbcool.kmod		base-kernel-modules kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/desbase-kernel-modules kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/des/des.kmod			base-kernel-modules kmod
+./stand/powerpc-4xx/@OSRELEASE@/modules/dirhashbase-obsolete		obsolete

CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2/i915drm

2014-03-05 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Wed Mar  5 08:45:06 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/i915drm [riastradh-drm2]: i915_gem_gtt.c

Log Message:
revert to bogus assertion, as requested by riastradh@ to ease forecoming commit


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 \
src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.7 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.8
--- src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.7	Tue Mar  4 22:14:12 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c	Wed Mar  5 08:45:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_gtt.c,v 1.1.2.7 2014/03/04 22:14:12 aymeric Exp $	*/
+/*	$NetBSD: i915_gem_gtt.c,v 1.1.2.8 2014/03/05 08:45:06 aymeric Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i915_gem_gtt.c,v 1.1.2.7 2014/03/04 22:14:12 aymeric Exp $);
+__KERNEL_RCSID(0, $NetBSD: i915_gem_gtt.c,v 1.1.2.8 2014/03/05 08:45:06 aymeric Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -330,7 +330,7 @@ i915_gem_gtt_bind_object(struct drm_i915
 enum i915_cache_level cache_level)
 {
 
-	KASSERT(6 = INTEL_INFO(obj-base.dev)-gen); /* XXX gen6 */
+	KASSERT(6  INTEL_INFO(obj-base.dev)-gen); /* XXX gen6 */
 	gen6_ggtt_bind_object(obj, cache_level);
 	obj-has_global_gtt_mapping = 1;
 }



CVS commit: src/sys/dev/scsipi

2014-03-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar  5 08:45:13 UTC 2014

Modified Files:
src/sys/dev/scsipi: atapiconf.c

Log Message:
Don't probe beyond chan_ntargets in atapi_probe_bus in the all case.

PR/48626: ahci_atapi_probe_device panic with kmemguard


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/scsipi/atapiconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/atapiconf.c
diff -u src/sys/dev/scsipi/atapiconf.c:1.86 src/sys/dev/scsipi/atapiconf.c:1.87
--- src/sys/dev/scsipi/atapiconf.c:1.86	Sun Jun 24 07:48:01 2012
+++ src/sys/dev/scsipi/atapiconf.c	Wed Mar  5 08:45:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atapiconf.c,v 1.86 2012/06/24 07:48:01 riastradh Exp $	*/
+/*	$NetBSD: atapiconf.c,v 1.87 2014/03/05 08:45:13 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atapiconf.c,v 1.86 2012/06/24 07:48:01 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: atapiconf.c,v 1.87 2014/03/05 08:45:13 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -231,8 +231,10 @@ atapi_probe_bus(struct atapibus_softc *s
 	int error;
 	struct atapi_adapter *atapi_adapter;
 
+	KASSERT(chan-chan_ntargets = 1);
+
 	if (target == -1) {
-		maxtarget = 1;
+		maxtarget = chan-chan_ntargets - 1;
 		mintarget = 0;
 	} else {
 		if (target  0 || target = chan-chan_ntargets)



CVS commit: src

2014-03-05 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Mar  5 09:37:29 UTC 2014

Modified Files:
src/share/man/man9: vnode.9
src/sys/kern: vfs_mount.c vfs_vnode.c
src/sys/sys: mount.h param.h vnode.h
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_vfsops.c
src/sys/ufs/lfs: lfs_syscalls.c

Log Message:
Current support for iterating over mnt_vnodelist is rudimentary.  Every
caller has to care about list and vnode mutexes, reference count being zero,
intermediate vnode states like VI_CLEAN, VI_XLOCK, VI_MARKER and so on.

Add an interface to iterate over a vnode list:

void vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **marker)
void vfs_vnode_iterator_destroy(struct vnode_iterator *marker)
bool vfs_vnode_iterator_next(struct vnode_iterator *marker, struct vnode **vpp)

vfs_vnode_iterator_next() returns either false / *vpp == NULL when done
or true / *vpp != NULL to return the next referenced vnode from the list.

To make vrecycle() work in this environment change it to

bool vrecycle(struct vnode *vp)

where vp is a referenced vnode to be destroyed if this is the last reference.

Discussed on tech-kern.

Welcome to 6.99.34


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/share/man/man9/vnode.9
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.211 -r1.212 src/sys/sys/mount.h
cvs rdiff -u -r1.442 -r1.443 src/sys/sys/param.h
cvs rdiff -u -r1.243 -r1.244 src/sys/sys/vnode.h
cvs rdiff -u -r1.176 -r1.177 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.292 -r1.293 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.150 -r1.151 src/sys/ufs/lfs/lfs_syscalls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/vnode.9
diff -u src/share/man/man9/vnode.9:1.59 src/share/man/man9/vnode.9:1.60
--- src/share/man/man9/vnode.9:1.59	Sat Feb 22 11:28:18 2014
+++ src/share/man/man9/vnode.9	Wed Mar  5 09:37:29 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: vnode.9,v 1.59 2014/02/22 11:28:18 wiz Exp $
+.\ $NetBSD: vnode.9,v 1.60 2014/03/05 09:37:29 hannken Exp $
 .\
 .\ Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 22, 2014
+.Dd March 5, 2014
 .Dt VNODE 9
 .Os
 .Sh NAME
@@ -79,7 +79,7 @@
 .Ft void
 .Fn ungetnewvnode struct vnode *vp
 .Ft int
-.Fn vrecycle struct vnode *vp struct kmutex_t *inter_lkp
+.Fn vrecycle struct vnode *vp
 .Ft void
 .Fn vgone struct vnode *vp
 .Ft void
@@ -616,12 +616,12 @@ This function is needed for
 .Xr VFS_VGET 9
 which may need to push back a vnode in case of a locking race
 condition.
-.It Fn vrecycle vp inter_lkp
-Recycle the unused vnode
+.It Fn vrecycle vp
+Recycle the referenced vnode
 .Fa vp
-from the front of the freelist.
+if this is the last reference.
 .Fn vrecycle
-is a null operation if the reference count is greater than zero.
+is a null operation if the reference count is greater than one.
 .It Fn vgone vp
 Eliminate all activity associated with the unlocked vnode
 .Fa vp

Index: src/sys/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.26 src/sys/kern/vfs_mount.c:1.27
--- src/sys/kern/vfs_mount.c:1.26	Thu Feb 27 13:00:06 2014
+++ src/sys/kern/vfs_mount.c	Wed Mar  5 09:37:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.26 2014/02/27 13:00:06 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.27 2014/03/05 09:37:29 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_mount.c,v 1.26 2014/02/27 13:00:06 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_mount.c,v 1.27 2014/03/05 09:37:29 hannken Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -375,6 +375,82 @@ vunmark(vnode_t *mvp)
 	return vp;
 }
 
+struct vnode_iterator {
+	struct vnode vi_vnode;
+}; 
+
+void
+vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **vipp)
+{
+	struct vnode *vp;
+
+	vp = vnalloc(mp);
+
+	mutex_enter(mntvnode_lock);
+	TAILQ_INSERT_HEAD(mp-mnt_vnodelist, vp, v_mntvnodes);
+	vp-v_usecount = 1;
+	mutex_exit(mntvnode_lock);
+
+	*vipp = (struct vnode_iterator *)vp;
+}
+
+void
+vfs_vnode_iterator_destroy(struct vnode_iterator *vi)
+{
+	struct vnode *mvp = vi-vi_vnode;
+
+	mutex_enter(mntvnode_lock);
+	KASSERT(ISSET(mvp-v_iflag, VI_MARKER));
+	if (mvp-v_usecount != 0)
+		TAILQ_REMOVE(mvp-v_mount-mnt_vnodelist, mvp, v_mntvnodes);
+	mutex_exit(mntvnode_lock);
+	vnfree(mvp);
+}
+
+bool
+vfs_vnode_iterator_next(struct vnode_iterator *vi, struct vnode **vpp)
+{
+	struct vnode *mvp = vi-vi_vnode;
+	struct mount *mp = mvp-v_mount;
+	struct vnode *vp;
+	int error;
+
+	KASSERT(ISSET(mvp-v_iflag, VI_MARKER));
+
+	do {
+		mutex_enter(mntvnode_lock);
+		vp 

CVS commit: src/sys/arch/sandpoint/conf

2014-03-05 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Mar  5 14:13:20 UTC 2014

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC

Log Message:
Enabled SYSV* options, which all ports have (and which is needed by 3rd
party software like SANE, e.g.).
Added ugen*.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/sandpoint/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sandpoint/conf/GENERIC
diff -u src/sys/arch/sandpoint/conf/GENERIC:1.80 src/sys/arch/sandpoint/conf/GENERIC:1.81
--- src/sys/arch/sandpoint/conf/GENERIC:1.80	Sun Jun 30 21:38:58 2013
+++ src/sys/arch/sandpoint/conf/GENERIC	Wed Mar  5 14:13:20 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.80 2013/06/30 21:38:58 rmind Exp $
+# $NetBSD: GENERIC,v 1.81 2014/03/05 14:13:20 phx Exp $
 #
 # machine description file for GENERIC NAS
 # 
@@ -22,7 +22,7 @@ include 	arch/sandpoint/conf/std.sandpo
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.80 $
+#ident 		GENERIC-$Revision: 1.81 $
 
 maxusers	32
 
@@ -34,9 +34,9 @@ maxusers	32
 options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
 options 	KTRACE
 
-#options 	SYSVMSG		# System V message queues
-#options 	SYSVSEM		# System V semaphores
-#options 	SYSVSHM		# System V shared memory
+options 	SYSVMSG		# System V message queues
+options 	SYSVSEM		# System V semaphores
+options 	SYSVSHM		# System V shared memory
 
 #options 	MODULAR		# module(7) support
 #options 	USERCONF	# userconf(4) support
@@ -205,7 +205,26 @@ viaide* 	at pci? dev ? function ?	# VIA 
 atabus* at ata?
 
 # IDE drives
-wd*		at atabus? drive ? flags 0x	# the drives themselves
+# Flags are used only with controllers that support DMA operations
+# and mode settings (e.g. some pciide controllers)
+# The lowest order four bits (rightmost digit) of the flags define the PIO
+# mode to use, the next set of four bits the DMA mode and the third set the
+# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
+# to use, and the last bit must be 1 for this setting to be used.
+# For DMA and UDMA, 0xf () means 'disable'.
+# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
+# (0xc=1100, 0xa=1010, 0xf=)
+# 0x means use whatever the drive claims to support.
+wd*		at atabus? drive ? flags 0x
+
+# ATAPI bus support
+atapibus*	at atapi?
+
+# ATAPI devices
+# flags have the same meaning as for IDE drives.
+cd*	at atapibus? drive ? flags 0x	# ATAPI CD-ROM drives
+sd*	at atapibus? drive ? flags 0x	# ATAPI disk drives
+uk*	at atapibus? drive ? flags 0x	# ATAPI unknown
 
 # PCI network interfaces
 ral*	at pci? dev ? function ?	# Ralink Technology RT25x0 802.11a/b/g
@@ -247,19 +266,23 @@ uvideo* at uhub?			# USB Video Class cap
 video*	at videobus?
 
 # USB printer
-ulpt*	at uhub? port ? configuration ? interface ?	# USB Printer
+ulpt*	at uhub? port ? configuration ? interface ?
 
 # USB Mass Storage
 umass*	at uhub? port ? configuration ? interface ?
 wd*	at umass?
 
-scsibus* at umass?
-sd*	at scsibus? target ? lun ?	# SCSI disk drives
-cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
+# USB scanners
+#uscanner* at uhub? port ?
+ugen*	at uhub? port ? configuration ? interface ?	# USB Generic driver
+
+# SCSI bus support
+scsibus* 	at umass?
+
+# SCSI devices
+sd*		at scsibus? target ? lun ?	# SCSI disk drives
+cd*		at scsibus? target ? lun ?	# SCSI CD-ROM drives
 
-atapibus* at atapi?
-sd*	at atapibus? drive ? flags 0x	# ATAPI disk drives
-cd*	at atapibus? drive ? flags 0x	# ATAPI CD-ROM drives
 
 #
 # Pseudo-Devices



CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 14:42:27 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm [riastradh-drm2]: drmP.h
src/sys/external/bsd/drm2/drm [riastradh-drm2]: drm_drv.c
src/sys/external/bsd/drm2/i915drm [riastradh-drm2]: i915_pci.c

Log Message:
Handle attach failure and don't try a framebuffer in i915 on failure.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.57 -r1.1.1.1.2.58 \
src/sys/external/bsd/drm2/dist/include/drm/drmP.h
cvs rdiff -u -r1.1.2.36 -r1.1.2.37 src/sys/external/bsd/drm2/drm/drm_drv.c
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 \
src/sys/external/bsd/drm2/i915drm/i915_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.1.1.1.2.57 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.1.1.1.2.58
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.1.1.1.2.57	Tue Mar  4 20:45:16 2014
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Wed Mar  5 14:42:27 2014
@@ -1469,7 +1469,7 @@ extern int drm_lastclose(struct drm_devi
 #endif
 
 #ifdef __NetBSD__
-extern void drm_config_found(device_t, /*  const */ struct drm_driver *,
+extern int drm_config_found(device_t, /* XXX const */ struct drm_driver *,
 unsigned long, struct drm_device *);
 #endif
 

Index: src/sys/external/bsd/drm2/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.1.2.36 src/sys/external/bsd/drm2/drm/drm_drv.c:1.1.2.37
--- src/sys/external/bsd/drm2/drm/drm_drv.c:1.1.2.36	Tue Mar  4 20:45:16 2014
+++ src/sys/external/bsd/drm2/drm/drm_drv.c	Wed Mar  5 14:42:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.1.2.36 2014/03/04 20:45:16 riastradh Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.1.2.37 2014/03/05 14:42:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: drm_drv.c,v 1.1.2.36 2014/03/04 20:45:16 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: drm_drv.c,v 1.1.2.37 2014/03/05 14:42:27 riastradh Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -49,6 +49,8 @@ __KERNEL_RCSID(0, $NetBSD: drm_drv.c,v 
 
 #include uvm/uvm_extern.h
 
+#include prop/proplib.h
+
 #include drm/drmP.h
 
 #include ioconf.h
@@ -327,6 +329,7 @@ drm_attach(device_t parent, device_t sel
 
 	if (device_unit(self) = 64) { /* XXX Need to do something here!  */
 		aprint_error_dev(self, can't handle =64 drm devices!);
+		error = ENFILE;	/* XXX */
 		goto fail0;
 	}
 
@@ -373,8 +376,11 @@ drm_attach(device_t parent, device_t sel
 		/* XXX errno Linux-NetBSD */
 		error = -drm_mode_group_init_legacy_group(dev,
 		dev-primary-mode_group);
-		if (error)
+		if (error) {
+			aprint_error_dev(parent, unable to init legacy group
+			: %d\n, error);
 			goto fail2;
+		}
 	}
 
 	/* Success!  */
@@ -384,7 +390,8 @@ drm_attach(device_t parent, device_t sel
 fail2:	if (dev-driver-unload != NULL)
 		(*dev-driver-unload)(dev);
 fail1:	drm_undo_fill_in_dev(dev);
-fail0:	return;
+fail0:	prop_dictionary_set_int64(device_properties(self), error,
+	(int64_t)error);
 }
 
 static int
@@ -893,22 +900,33 @@ out:
 	return error;
 }
 
-void
+int
 drm_config_found(device_t parent, struct drm_driver *driver,
 unsigned long flags, struct drm_device *dev)
 {
 	static const struct drm_attach_args zero_daa;
 	struct drm_attach_args daa = zero_daa;
+	device_t child;
+	int64_t error64;
+	int error = 0;
 
 	daa.daa_drm_dev = dev;
 	daa.daa_driver = driver;
 	daa.daa_flags = flags;
 
 	dev-driver = driver;
-	if (config_found_ia(parent, drmkmsbus, daa, NULL) == NULL) {
-		aprint_error_dev(parent, unable to attach drm\n);
-		return;
+
+	child = config_found_ia(parent, drmkmsbus, daa, NULL);
+	if (child == NULL) {
+		aprint_error_dev(parent, no drm pseudo-device found\n);
+		return ENOENT;
 	}
+
+	if (prop_dictionary_get_int64(device_properties(child), error,
+		error64))
+		error = (int)error64;
+
+	return error;
 }
 
 struct drm_local_map *

Index: src/sys/external/bsd/drm2/i915drm/i915_pci.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_pci.c:1.1.2.12 src/sys/external/bsd/drm2/i915drm/i915_pci.c:1.1.2.13
--- src/sys/external/bsd/drm2/i915drm/i915_pci.c:1.1.2.12	Wed Jan 29 19:48:14 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_pci.c	Wed Mar  5 14:42:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_pci.c,v 1.1.2.12 2014/01/29 19:48:14 riastradh Exp $	*/
+/*	$NetBSD: i915_pci.c,v 1.1.2.13 2014/03/05 14:42:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i915_pci.c,v 1.1.2.12 2014/01/29 19:48:14 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: i915_pci.c,v 1.1.2.13 2014/03/05 14:42:27 riastradh Exp $);
 
 #include sys/types.h
 #ifndef _MODULE
@@ -153,6 +153,7 @@ 

CVS commit: [riastradh-drm2] src/sys/dev/pci

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 14:42:41 UTC 2014

Modified Files:
src/sys/dev/pci [riastradh-drm2]: agp_i810.c
Added Files:
src/sys/dev/pci [riastradh-drm2]: agp_i810var.h

Log Message:
Expose the agp_i810 softc.

This is an Intel-specific kludge so that i915drmkms can get at the
GTT, graphics translation table, for pre-Sandy Bridge Intel graphics
devices.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.73.26.1 src/sys/dev/pci/agp_i810.c
cvs rdiff -u -r0 -r1.1.2.1 src/sys/dev/pci/agp_i810var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/agp_i810.c
diff -u src/sys/dev/pci/agp_i810.c:1.73 src/sys/dev/pci/agp_i810.c:1.73.26.1
--- src/sys/dev/pci/agp_i810.c:1.73	Mon Apr  4 20:37:56 2011
+++ src/sys/dev/pci/agp_i810.c	Wed Mar  5 14:42:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_i810.c,v 1.73 2011/04/04 20:37:56 dyoung Exp $	*/
+/*	$NetBSD: agp_i810.c,v 1.73.26.1 2014/03/05 14:42:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -26,11 +26,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/pci/agp_i810.c,v 1.4 2001/07/05 21:28:47 jhb Exp $
+ *	$FreeBSD$
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agp_i810.c,v 1.73 2011/04/04 20:37:56 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: agp_i810.c,v 1.73.26.1 2014/03/05 14:42:40 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -45,6 +45,7 @@ __KERNEL_RCSID(0, $NetBSD: agp_i810.c,v
 #include dev/pci/pcidevs.h
 #include dev/pci/agpvar.h
 #include dev/pci/agpreg.h
+#include dev/pci/agp_i810var.h
 
 #include sys/agpio.h
 
@@ -52,6 +53,8 @@ __KERNEL_RCSID(0, $NetBSD: agp_i810.c,v
 
 #include agp_intel.h
 
+struct agp_softc *agp_i810_sc = NULL;
+
 #define READ1(off)	bus_space_read_1(isc-bst, isc-bsh, off)
 #define READ4(off)	bus_space_read_4(isc-bst, isc-bsh, off)
 #define WRITE4(off,v)	bus_space_write_4(isc-bst, isc-bsh, off, v)
@@ -64,22 +67,6 @@ __KERNEL_RCSID(0, $NetBSD: agp_i810.c,v
 #define CHIP_G33  5	/* G33/Q33/Q35 */
 #define CHIP_G4X  6	/* G45/Q45 */
 
-struct agp_i810_softc {
-	u_int32_t initial_aperture;	/* aperture size at startup */
-	struct agp_gatt *gatt;
-	int chiptype;			/* i810-like or i830 */
-	u_int32_t dcache_size;		/* i810 only */
-	u_int32_t stolen;		/* number of i830/845 gtt entries
-	   for stolen memory */
-	bus_space_tag_t bst;		/* register bus_space tag */
-	bus_space_handle_t bsh;		/* register bus_space handle */
-	bus_space_tag_t gtt_bst;	/* GTT bus_space tag */
-	bus_space_handle_t gtt_bsh;	/* GTT bus_space handle */
-	struct pci_attach_args vga_pa;
-
-	u_int32_t pgtblctl;
-};
-
 /* XXX hack, see below */
 static bus_addr_t agp_i810_vga_regbase;
 static bus_space_handle_t agp_i810_vga_bsh;
@@ -676,6 +663,15 @@ static int agp_i810_init(struct agp_soft
 	 */
 	agp_flush_cache();
 
+	/*
+	 * Publish what we found for kludgey drivers (I'm looking at
+	 * you, drm).
+	 */
+	if (agp_i810_sc == NULL)
+		agp_i810_sc = sc;
+	else
+		aprint_error_dev(sc-as_dev, i810 agp already attached\n);
+
 	return 0;
 }
 

Added files:

Index: src/sys/dev/pci/agp_i810var.h
diff -u /dev/null src/sys/dev/pci/agp_i810var.h:1.1.2.1
--- /dev/null	Wed Mar  5 14:42:41 2014
+++ src/sys/dev/pci/agp_i810var.h	Wed Mar  5 14:42:40 2014
@@ -0,0 +1,53 @@
+/*	$NetBSD: agp_i810var.h,v 1.1.2.1 2014/03/05 14:42:40 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2000 Doug Rabson
+ * Copyright (c) 2000 Ruslan Ermilov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/types.h
+#include sys/bus.h
+
+#include 

CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2/i915drm

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 14:45:00 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/i915drm [riastradh-drm2]: i915_gem_gtt.c

Log Message:
First draft of i915_gem_gtt.c for pre-Sandy Bridge (gen6) devices.

These go through the legacy AGP cruft to get at the GTT.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 \
src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.8 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.9
--- src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.8	Wed Mar  5 08:45:06 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c	Wed Mar  5 14:45:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_gtt.c,v 1.1.2.8 2014/03/05 08:45:06 aymeric Exp $	*/
+/*	$NetBSD: i915_gem_gtt.c,v 1.1.2.9 2014/03/05 14:45:00 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i915_gem_gtt.c,v 1.1.2.8 2014/03/05 08:45:06 aymeric Exp $);
+__KERNEL_RCSID(0, $NetBSD: i915_gem_gtt.c,v 1.1.2.9 2014/03/05 14:45:00 riastradh Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -40,181 +40,119 @@ __KERNEL_RCSID(0, $NetBSD: i915_gem_gtt
 
 #include dev/pci/pcivar.h
 
+#include dev/pci/agpvar.h
+#include dev/pci/agp_i810var.h
+
 #include drm/drmP.h
 
 #include i915_drv.h
 
+static int	i915_gem_gtt_init_scratch_page(struct intel_gtt *,
+		bus_dma_tag_t);
+static void	i915_gem_gtt_fini_scratch_page(struct intel_gtt *,
+		bus_dma_tag_t);
+
 static void	i915_gtt_color_adjust(struct drm_mm_node *, unsigned long,
 		unsigned long *, unsigned long *);
 static void	i915_ggtt_clear_range(struct drm_device *, unsigned, unsigned);
+
+static int	agp_gtt_init(struct drm_device *);
+static void	agp_gtt_fini(struct drm_device *);
+static void	agp_ggtt_bind_object(struct drm_i915_gem_object *,
+		enum i915_cache_level);
+static void	agp_ggtt_clear_range(struct drm_device *, unsigned, unsigned);
+
+static int	gen6_gtt_init(struct drm_device *);
+static void	gen6_gtt_fini(struct drm_device *);
 static void	gen6_ggtt_bind_object(struct drm_i915_gem_object *,
 		enum i915_cache_level);
 static void	gen6_ggtt_clear_range(struct drm_device *, unsigned, unsigned);
 
-#define	SNB_GMCH_GGMS	(SNB_GMCH_GGMS_MASK  SNB_GMCH_GGMS_SHIFT)
-#define	SNB_GMCH_GMS	(SNB_GMCH_GMS_MASK  SNB_GMCH_GMS_SHIFT)
-#define	IVB_GMCH_GMS	(IVB_GMCH_GMS_MASK  IVB_GMCH_GMS_SHIFT)
-
-typedef uint32_t gtt_pte_t;
-
-#define	GEN6_PTE_VALID		__BIT(0)
-#define	GEN6_PTE_UNCACHED	__BIT(1)
-#define	HSW_PTE_UNCACHED	(0)
-#define	GEN6_PTE_CACHE_LLC	__BIT(2)
-#define	GEN6_PTE_CACHE_LLC_MLC	__BIT(3)
-
-static uint32_t
-gen6_pte_addr_encode(bus_addr_t addr)
-{
-	KASSERT(addr = __BITS(39, 0));
-	return (addr | ((addr  28)  0xff0));
-}
-
-static gtt_pte_t
-pte_encode(struct drm_device *dev, bus_addr_t addr,
-enum i915_cache_level level)
-{
-	uint32_t flags = GEN6_PTE_VALID;
-
-	switch (level) {
-	case I915_CACHE_LLC_MLC:
-		flags |= (IS_HASWELL(dev)? GEN6_PTE_CACHE_LLC
-		: GEN6_PTE_CACHE_LLC_MLC);
-		break;
-
-	case I915_CACHE_LLC:
-		flags |= GEN6_PTE_CACHE_LLC;
-		break;
-
-	case I915_CACHE_NONE:
-		flags |= (IS_HASWELL(dev)? HSW_PTE_UNCACHED
-		: GEN6_PTE_UNCACHED);
-		break;
-
-	default:
-		panic(invalid i915 GTT cache level: %d, (int)level);
-		break;
-	}
-
-	return (gen6_pte_addr_encode(addr) | flags);
-}
-
 int
 i915_gem_gtt_init(struct drm_device *dev)
 {
 	struct drm_i915_private *const dev_priv = dev-dev_private;
-	struct pci_attach_args *const pa = dev-pdev-pd_pa;
 	struct intel_gtt *gtt;
-	uint16_t snb_gmch_ctl, ggms, gms;
-	int nsegs;
 	int ret;
 
-	if (INTEL_INFO(dev)-gen  6) {
-		/* XXX gen6 */
-		DRM_ERROR(device is too old for drm2 for now!\n);
-		return -ENODEV;
-	}
-
-	gtt = kmem_zalloc(sizeof(*gtt), KM_NOSLEEP);
-
-	/* XXX pci_set_dma_mask?  pci_set_consistent_dma_mask?  */
-	drm_limit_dma_space(dev, 0, 0x000fULL);
+	dev_priv-mm.gtt = gtt = kmem_zalloc(sizeof(*gtt), KM_SLEEP);
+	if (INTEL_INFO(dev)-gen  6)
+		ret = agp_gtt_init(dev);
+	else
+		ret = gen6_gtt_init(dev);
+	if (ret)
+		goto fail0;
 
-	gtt-gma_bus_addr = dev-bus_maps[2].bm_base;
+	/* Success!  */
+	DRM_INFO(Memory usable by graphics device = %dM\n,
+	gtt-gtt_total_entries  8);
+	DRM_DEBUG_DRIVER(GMADR size = %dM\n, gtt-gtt_mappable_entries  8);
+	DRM_DEBUG_DRIVER(GTT stolen size = %dM\n, gtt-stolen_size  20);
+	return 0;
 
-	snb_gmch_ctl = pci_conf_read(pa-pa_pc, pa-pa_tag, SNB_GMCH_CTRL);
+fail1: __unused
+	if (INTEL_INFO(dev)-gen  6)
+		agp_gtt_fini(dev);
+	else
+		gen6_gtt_fini(dev);
+fail0:	kmem_free(gtt, sizeof(*gtt));
+	return ret;
+}
 
-	/* GMS: Graphics Mode Select.  */
-	if (INTEL_INFO(dev)-gen  7) {
-		gms = 

CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2/include/drm

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 15:08:00 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/include/drm [riastradh-drm2]: intel-gtt.h

Log Message:
Oops -- define struct intel_gtt::do_idle_maps.

Missed this in last commit.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/sys/external/bsd/drm2/include/drm/intel-gtt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/drm/intel-gtt.h
diff -u src/sys/external/bsd/drm2/include/drm/intel-gtt.h:1.1.2.2 src/sys/external/bsd/drm2/include/drm/intel-gtt.h:1.1.2.3
--- src/sys/external/bsd/drm2/include/drm/intel-gtt.h:1.1.2.2	Sun Sep  8 15:40:17 2013
+++ src/sys/external/bsd/drm2/include/drm/intel-gtt.h	Wed Mar  5 15:08:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel-gtt.h,v 1.1.2.2 2013/09/08 15:40:17 riastradh Exp $	*/
+/*	$NetBSD: intel-gtt.h,v 1.1.2.3 2014/03/05 15:08:00 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -48,6 +48,7 @@ struct intel_gtt {
 	bus_dma_segment_t	gtt_scratch_seg;
 	bus_dmamap_t		gtt_scratch_map;
 	bus_space_handle_t	gtt_bsh;
+	bool			do_idle_maps;
 };
 
 struct intel_gtt *



CVS commit: src/sys/arch/x68k/conf

2014-03-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Mar  5 16:02:29 UTC 2014

Modified Files:
src/sys/arch/x68k/conf: GENERIC INSTALL

Log Message:
Delete the word buggy in the comment of NULLFS.
This has been added in 1999, but it's not a buggy now.
Adviced from tsutsui@, msaitoh@.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/x68k/conf/GENERIC
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x68k/conf/INSTALL

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/conf/GENERIC
diff -u src/sys/arch/x68k/conf/GENERIC:1.170 src/sys/arch/x68k/conf/GENERIC:1.171
--- src/sys/arch/x68k/conf/GENERIC:1.170	Sun Jun 30 21:38:59 2013
+++ src/sys/arch/x68k/conf/GENERIC	Wed Mar  5 16:02:29 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.170 2013/06/30 21:38:59 rmind Exp $
+# $NetBSD: GENERIC,v 1.171 2014/03/05 16:02:29 isaki Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	arch/x68k/conf/std.x68k
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.170 $
+#ident 		GENERIC-$Revision: 1.171 $
 
 maxusers	8
 
@@ -173,7 +173,7 @@ options 	COMPAT_BSDPTY	# /dev/[pt]ty?? p
 file-system	FFS		# Berkeley Fast Filesystem
 file-system	NFS		# Sun NFS-compatible filesystem client
 file-system	KERNFS		# kernel data-structure filesystem
-#file-system	NULLFS		# NULL layered filesystem (buggy)
+#file-system	NULLFS		# NULL layered filesystem
 #file-system 	OVERLAY		# overlay file system
 file-system	MFS		# memory-based filesystem
 #file-system	FDESC		# user file descriptor filesystem

Index: src/sys/arch/x68k/conf/INSTALL
diff -u src/sys/arch/x68k/conf/INSTALL:1.103 src/sys/arch/x68k/conf/INSTALL:1.104
--- src/sys/arch/x68k/conf/INSTALL:1.103	Thu Feb 27 09:13:20 2014
+++ src/sys/arch/x68k/conf/INSTALL	Wed Mar  5 16:02:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.103 2014/02/27 09:13:20 isaki Exp $
+#	$NetBSD: INSTALL,v 1.104 2014/03/05 16:02:29 isaki Exp $
 
 #
 #	INSTALL -- installation kernel.
@@ -8,7 +8,7 @@ include arch/x68k/conf/std.x68k
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		INSTALL-$Revision: 1.103 $
+#ident 		INSTALL-$Revision: 1.104 $
 
 makeoptions	COPTS=-Os		# Optimise for space. Implies -O2
 
@@ -158,7 +158,7 @@ options 	COMPAT_BSDPTY	# /dev/[pt]ty?? p
 file-system	FFS		# Berkeley Fast Filesystem
 file-system	NFS		# Sun NFS-compatible filesystem client
 #file-system	KERNFS		# kernel data-structure filesystem
-#file-system	NULLFS		# NULL layered filesystem (buggy)
+#file-system	NULLFS		# NULL layered filesystem
 #file-system 	OVERLAY		# overlay file system
 #file-system	MFS		# memory-based filesystem
 #file-system	FDESC		# user file descriptor filesystem



CVS commit: src/external/gpl3/gcc.old/lib/libgomp

2014-03-05 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Mar  5 16:18:41 UTC 2014

Modified Files:
src/external/gpl3/gcc.old/lib/libgomp: Makefile

Log Message:
Fix build with USE_SSP set to yes.

Problem reported by B Harder on current-users mailing list.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl3/gcc.old/lib/libgomp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc.old/lib/libgomp/Makefile
diff -u src/external/gpl3/gcc.old/lib/libgomp/Makefile:1.1.1.2 src/external/gpl3/gcc.old/lib/libgomp/Makefile:1.2
--- src/external/gpl3/gcc.old/lib/libgomp/Makefile:1.1.1.2	Wed Feb 26 10:57:30 2014
+++ src/external/gpl3/gcc.old/lib/libgomp/Makefile	Wed Mar  5 16:18:41 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.1.2 2014/02/26 10:57:30 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/05 16:18:41 tron Exp $
 
 # build GCC's libgomp, so that -fopenmp works.
 
@@ -73,6 +73,9 @@ INCSDIR=	/usr/include/gcc-4.5
 libinstall::
 .endif			# }
 
+COPTS.team.c = -Wno-stack-protector
+COPTS.task.c = -Wno-stack-protector
+
 .include bsd.lib.mk
 
 .PATH:	${ARCHDIR} ${DIST}/libgomp ${DIST}/libgomp/config/posix



CVS commit: src/sys/arch/arm/include

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar  5 16:33:33 UTC 2014

Modified Files:
src/sys/arch/arm/include: armreg.h db_machdep.h

Log Message:
Define all the instruction conditions.
Use __SHIFTOUT to get the condition.
Add bool arm_cond_ok_p(uint32_t insn, uint32_t psr) inline
Add tlbtr inline


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/arm/include/armreg.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/db_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.90 src/sys/arch/arm/include/armreg.h:1.91
--- src/sys/arch/arm/include/armreg.h:1.90	Mon Mar  3 14:26:32 2014
+++ src/sys/arch/arm/include/armreg.h	Wed Mar  5 16:33:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.90 2014/03/03 14:26:32 matt Exp $	*/
+/*	$NetBSD: armreg.h,v 1.91 2014/03/05 16:33:33 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -565,7 +565,21 @@
 
 #define INSN_SIZE		4		/* Always 4 bytes */
 #define INSN_COND_MASK		0xf000	/* Condition mask */
-#define INSN_COND_AL		0xe000	/* Always condition */
+#define INSN_COND_EQ		0		/* Z == 1 */
+#define INSN_COND_NE		1		/* Z == 0 */
+#define INSN_COND_CS		2		/* C == 1 */
+#define INSN_COND_CC		3		/* C == 0 */
+#define INSN_COND_MI		4		/* N == 1 */
+#define INSN_COND_PL		5		/* N == 0 */
+#define INSN_COND_VS		6		/* V == 1 */
+#define INSN_COND_VC		7		/* V == 0 */
+#define INSN_COND_HI		8		/* C == 1  Z == 0 */
+#define INSN_COND_LS		9		/* C == 0 || Z == 1 */
+#define INSN_COND_GE		10		/* N == V */
+#define INSN_COND_LT		11		/* N != V */
+#define INSN_COND_GT		12		/* Z == 0  N == V */
+#define INSN_COND_LE		13		/* Z == 1 || N != V */
+#define INSN_COND_AL		14		/* Always condition */
 
 #define THUMB_INSN_SIZE		2		/* Some are 4 bytes.  */
 
@@ -756,6 +770,47 @@
 #define ARM_A5_TLBDATAOP_INDEX		__BITS(5,0)
 #define ARM_A7_TLBDATAOP_INDEX		__BITS(6,0)
 
+#if !defined(__ASSEMBLER__)
+static inline bool
+arm_cond_ok_p(uint32_t insn, uint32_t psr)
+{
+	const uint32_t __cond = __SHIFTOUT(insn, INSN_COND_MASK);
+
+	bool __ok;
+	const bool __z = (psr  PSR_Z_bit);
+	const bool __n = (psr  PSR_N_bit);
+	const bool __c = (psr  PSR_C_bit);
+	const bool __v = (psr  PSR_V_bit);
+	switch (__cond  ~1) {
+	case INSN_COND_EQ:	// Z == 1
+		__ok = __z;
+		break;
+	case INSN_COND_CS:	// C == 1
+		__ok = __c;
+		break;
+	case INSN_COND_MI:	// N == 1
+		__ok = __n;
+		break;
+	case INSN_COND_VS:	// V == 1
+		__ok = __v;
+		break;
+	case INSN_COND_HI:	// C == 1  Z == 0
+		__ok = __c  !__z;
+		break;
+	case INSN_COND_GE:	// N == V
+		__ok = __n == __v;
+		break;
+	case INSN_COND_GT:	// N == V  Z == 0
+		__ok = __n == __v  !__z;
+		break;
+	case INSN_COND_AL:
+		return true;
+	}
+
+	return (__cond  1) ? !__ok : __ok;
+}
+#endif
+
 #if !defined(__ASSEMBLER__)  !defined(_RUMPKERNEL)
 #define	ARMREG_READ_INLINE(name, __insnstring)			\
 static inline uint32_t armreg_##name##_read(void)		\
@@ -815,6 +870,7 @@ ARMREG_WRITE_INLINE2(fpinst2, fmxr\tfpi
 /* cp15 c0 registers */
 ARMREG_READ_INLINE(midr, p15,0,%0,c0,c0,0) /* Main ID Register */
 ARMREG_READ_INLINE(ctr, p15,0,%0,c0,c0,1) /* Cache Type Register */
+ARMREG_READ_INLINE(tlbtr, p15,0,%0,c0,c0,3) /* TLB Type Register */
 ARMREG_READ_INLINE(mpidr, p15,0,%0,c0,c0,5) /* Multiprocess Affinity Register */
 ARMREG_READ_INLINE(pfr0, p15,0,%0,c0,c1,0) /* Processor Feature Register 0 */
 ARMREG_READ_INLINE(pfr1, p15,0,%0,c0,c1,1) /* Processor Feature Register 1 */

Index: src/sys/arch/arm/include/db_machdep.h
diff -u src/sys/arch/arm/include/db_machdep.h:1.18 src/sys/arch/arm/include/db_machdep.h:1.19
--- src/sys/arch/arm/include/db_machdep.h:1.18	Thu Feb 16 02:26:35 2012
+++ src/sys/arch/arm/include/db_machdep.h	Wed Mar  5 16:33:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.h,v 1.18 2012/02/16 02:26:35 christos Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.19 2014/03/05 16:33:33 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Scott K Stevens
@@ -99,8 +99,8 @@ extern db_regs_t	ddb_regs;	/* register s
 #define inst_load(ins)		(0)
 #define inst_store(ins)		(0)
 #define inst_unconditional_flow_transfer(ins)	\
-	ins)  INSN_COND_MASK) == INSN_COND_AL)  \
-	 (inst_branch(ins) || inst_call(ins) || inst_return(ins)))
+	(__SHIFTOUT((ins), INSN_COND_MASK) == INSN_COND_AL \
+	  (inst_branch(ins) || inst_call(ins) || inst_return(ins)))
 
 #define getreg_val			(0)
 #define next_instr_address(pc, bd)	((bd) ? (pc) : ((pc) + INSN_SIZE))



CVS commit: src/common/lib/libc/arch/arm/atomic

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar  5 17:20:48 UTC 2014

Modified Files:
src/common/lib/libc/arch/arm/atomic: atomic_cas_64.S

Log Message:
apcs-gnu only passes one register on the stack.
ldrd always loads little endian (low address, low register).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S:1.9 src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S:1.10
--- src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S:1.9	Tue Mar  4 16:15:28 2014
+++ src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S	Wed Mar  5 17:20:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_cas_64.S,v 1.9 2014/03/04 16:15:28 matt Exp $	*/
+/*	$NetBSD: atomic_cas_64.S,v 1.10 2014/03/05 17:20:48 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,13 +41,8 @@ ENTRY_NP(_atomic_cas_64)
 #ifdef __ARM_EABI__
 	ldrd	r4, r5, [sp, #16]	/* fetch new value */
 #else
-#if __ARMEB__
-	ldr	r5, [sp, #16]		/* fetch new value */
-	ldr	r4, [sp, #20]		/* fetch new value */
-#else
-	ldr	r4, [sp, #16]		/* fetch new value */
-	ldr	r5, [sp, #20]		/* fetch new value */
-#endif
+	ldr	r5, [sp, #16]		/* second word third argument */
+	mov	r4, r3			/* first word third argument */
 	mov	r3, r2			/* r2 will be overwritten by r1 which ... */
 	mov	r2, r1			/* r1 will be overwritten by ldrexd */
 #endif



CVS commit: src/tests/lib/libm

2014-03-05 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Mar  5 19:43:46 UTC 2014

Modified Files:
src/tests/lib/libm: t_acos.c
Added Files:
src/tests/lib/libm: t_libm.h

Log Message:
Move the #defines that simplified the test definitions and checks
  into a separate header than can be used by the other libm tests.
Make the subtest index 'unsigned int' so that simple constants (eg 0)
  print correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libm/t_acos.c
cvs rdiff -u -r0 -r1.1 src/tests/lib/libm/t_libm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_acos.c
diff -u src/tests/lib/libm/t_acos.c:1.8 src/tests/lib/libm/t_acos.c:1.9
--- src/tests/lib/libm/t_acos.c:1.8	Mon Mar  3 18:21:33 2014
+++ src/tests/lib/libm/t_acos.c	Wed Mar  5 19:43:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_acos.c,v 1.8 2014/03/03 18:21:33 dsl Exp $ */
+/* $NetBSD: t_acos.c,v 1.9 2014/03/05 19:43:46 dsl Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,55 +31,24 @@
 
 #include atf-c.h
 #include math.h
-
-/*
- * Check result of fn(arg) is correct within the bounds.
- * Should be ok to do the checks using 'double' for 'float' functions.
- */
-#define T_LIBM_CHECK(subtest, fn, arg, expect, epsilon) do { \
-	double r = fn(arg); \
-	double e = fabs(r - expect); \
-	if (e  epsilon) \
-		atf_tc_fail_nonfatal( \
-		subtest %zu:  #fn (%g) is %g not %g (error %g  %g), \
-		subtest, arg, r, expect, e, epsilon); \
-} while (0)
-
-/* Check that the result of fn(arg) is NaN */
-#ifndef __vax__
-#define T_LIBM_CHECK_NAN(subtest, fn, arg) do { \
-	double r = fn(arg); \
-	if (!isnan(r)) \
-		atf_tc_fail_nonfatal(subtest %zu:  #fn (%g) is %g not NaN, \
-		subtest, arg, r); \
-} while (0)
-#else
-/* vax doesn't support NaN */
-#define T_LIBM_CHECK_NAN(subtest, fn, arg) (void)(arg)
-#endif
-
-#define AFT_LIBM_TEST(name, description) \
-ATF_TC(name); \
-ATF_TC_HEAD(name, tc) { atf_tc_set_md_var(tc, descr, description); } \
-ATF_TC_BODY(name, tc)
+#include t_libm.h
 
 /*
  * acos(3) and acosf(3)
  */
 
-AFT_LIBM_TEST(acos_nan, Test acos/acosf(x) == NaN, x = NaN, +/-Inf, ![-1..1])
+AFT_LIBM_TEST(acos_is_nan, Test acos/acosf(x) == NaN, x = NaN, +/-Inf, ![-1..1])
 {
 	static const double x[] = {
 	-1.1, 1.1,
 	-1.001, 1.001,
 	-1.1, 1.1,
 #ifndef __vax__
-	0.0L / 0.0L,  /* NAN */
-	-1.0L / 0.0L, /* -Inf */
-	+1.0L / 0.0L, /* +Inf */
+	T_LIBM_NAN,
+	T_LIBM_MINUS_INF, T_LIBM_PLUS_INF,
 #endif
 	};
-	size_t i;
+	unsigned int i;
 
 	for (i = 0; i  __arraycount(x); i++) {
 		T_LIBM_CHECK_NAN(i, acos, x[i]);
@@ -105,7 +74,7 @@ AFT_LIBM_TEST(acos_inrange, Test acos/a
 		{  0.5,  1.047197551196598, },
 		{  0.99, 0.141539473324427, },
 	};
-	size_t i;
+	unsigned int i;
 
 	/*
 	 * Note that acos(x) might be calculated as atan2(sqrt(1-x*x),x).
@@ -119,29 +88,18 @@ AFT_LIBM_TEST(acos_inrange, Test acos/a
 	}
 }
 
-AFT_LIBM_TEST(acos_one_pos, Test acos(1.0) == +0.0)
-{
-	const double y = acos(1.0);
-
-	if (fabs(y)  0.0 || signbit(y) != 0)
-		atf_tc_fail_nonfatal(acos(1.0) != +0.0);
-}
-
-AFT_LIBM_TEST(acosf_one_pos, Test acosf(1.0) == +0.0)
+AFT_LIBM_TEST(acos_is_plus_zero, Test acosf(1.0) == +0.0)
 {
-	const float y = acosf(1.0);
-
-	if (fabsf(y)  0.0 || signbit(y) != 0)
-		atf_tc_fail_nonfatal(acosf(1.0) != +0.0);
+	T_LIBM_CHECK_PLUS_ZERO(0, acos, 1.0);
+	T_LIBM_CHECK_PLUS_ZERO(0, acosf, 1.0);
 }
 
 ATF_TP_ADD_TCS(tp)
 {
 
-	ATF_TP_ADD_TC(tp, acos_nan);
 	ATF_TP_ADD_TC(tp, acos_inrange);
-	ATF_TP_ADD_TC(tp, acos_one_pos);
-	ATF_TP_ADD_TC(tp, acosf_one_pos);
+	ATF_TP_ADD_TC(tp, acos_is_nan);
+	ATF_TP_ADD_TC(tp, acos_is_plus_zero);
 
 	return atf_no_error();
 }

Added files:

Index: src/tests/lib/libm/t_libm.h
diff -u /dev/null src/tests/lib/libm/t_libm.h:1.1
--- /dev/null	Wed Mar  5 19:43:46 2014
+++ src/tests/lib/libm/t_libm.h	Wed Mar  5 19:43:46 2014
@@ -0,0 +1,54 @@
+/* $NetBSD: t_libm.h,v 1.1 2014/03/05 19:43:46 dsl Exp $ */
+
+/*
+ * Check result of fn(arg) is correct within the bounds.
+ * Should be ok to do the checks using 'double' for 'float' functions.
+ */
+#define T_LIBM_CHECK(subtest, fn, arg, expect, epsilon) do { \
+	double r = fn(arg); \
+	double e = fabs(r - expect); \
+	if (e  epsilon) \
+		atf_tc_fail_nonfatal( \
+		subtest %u:  #fn (%g) is %g not %g (error %g  %g), \
+		subtest, arg, r, expect, e, epsilon); \
+} while (0)
+
+/* Check that the result of fn(arg) is NaN */
+#ifndef __vax__
+#define T_LIBM_CHECK_NAN(subtest, fn, arg) do { \
+	double r = fn(arg); \
+	if (!isnan(r)) \
+		atf_tc_fail_nonfatal(subtest %u:  #fn (%g) is %g not NaN, \
+		subtest, arg, r); \
+} while (0)
+#else
+/* vax doesn't support NaN */
+#define T_LIBM_CHECK_NAN(subtest, fn, arg) (void)(arg)
+#endif
+
+/* Check that the result of fn(arg) is +0.0 */
+#define T_LIBM_CHECK_PLUS_ZERO(subtest, fn, 

CVS commit: src/external/cddl/osnet

2014-03-05 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Mar  5 20:14:15 UTC 2014

Modified Files:
src/external/cddl/osnet/dev/fbt: fbt.c
src/external/cddl/osnet/dist/uts/common/dtrace: dtrace.c

Log Message:
Fix build of DTrace with GCC 4.8.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/cddl/osnet/dev/fbt/fbt.c
cvs rdiff -u -r1.24 -r1.25 \
src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dev/fbt/fbt.c
diff -u src/external/cddl/osnet/dev/fbt/fbt.c:1.12 src/external/cddl/osnet/dev/fbt/fbt.c:1.13
--- src/external/cddl/osnet/dev/fbt/fbt.c:1.12	Sun Mar  3 18:18:13 2013
+++ src/external/cddl/osnet/dev/fbt/fbt.c	Wed Mar  5 20:14:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt.c,v 1.12 2013/03/03 18:18:13 christos Exp $	*/
+/*	$NetBSD: fbt.c,v 1.13 2014/03/05 20:14:15 tron Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -703,7 +703,6 @@ static int
 fbt_ctfoff_init(dtrace_modctl_t *mod, mod_ctf_t *mc)
 {
 	const Elf_Sym *symp = mc-symtab;
-	const char *name;
 	const ctf_header_t *hp = (const ctf_header_t *) mc-ctftab;
 	const uint8_t *ctfdata = mc-ctftab + sizeof(ctf_header_t);
 	int i;
@@ -758,11 +757,6 @@ fbt_ctfoff_init(dtrace_modctl_t *mod, mo
 			continue;
 		}
 
-		if (symp-st_name  mc-strcnt)
-			name = mc-strtab + symp-st_name;
-		else
-			name = (?);
-
 		switch (ELF_ST_TYPE(symp-st_info)) {
 		case STT_OBJECT:
 			if (objtoff = hp-cth_funcoff ||

Index: src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
diff -u src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.24 src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.25
--- src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.24	Wed Mar  5 06:12:00 2014
+++ src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c	Wed Mar  5 20:14:15 2014
@@ -1,6 +1,7 @@ dtrace_state_worker_add(void (*fn)(dtrac
 	w-exiting = false;
 	error = kthread_create(PRI_NONE, KTHREAD_MPSAFE|KTHREAD_MUSTJOIN, NULL,
 	dtrace_state_worker_thread, w, w-lwp, dtrace-state-worker);
+	(void) error;
 	KASSERT(error == 0); /* XXX */
 	return w;
 }



CVS commit: src/tests/lib/libm

2014-03-05 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Mar  5 20:14:46 UTC 2014

Modified Files:
src/tests/lib/libm: t_acos.c t_libm.h

Log Message:
Fix some typos.
Make the infinity and nan constants 'double' not 'long double'.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libm/t_acos.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libm/t_libm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_acos.c
diff -u src/tests/lib/libm/t_acos.c:1.9 src/tests/lib/libm/t_acos.c:1.10
--- src/tests/lib/libm/t_acos.c:1.9	Wed Mar  5 19:43:46 2014
+++ src/tests/lib/libm/t_acos.c	Wed Mar  5 20:14:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_acos.c,v 1.9 2014/03/05 19:43:46 dsl Exp $ */
+/* $NetBSD: t_acos.c,v 1.10 2014/03/05 20:14:46 dsl Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  * acos(3) and acosf(3)
  */
 
-AFT_LIBM_TEST(acos_is_nan, Test acos/acosf(x) == NaN, x = NaN, +/-Inf, ![-1..1])
+ATF_LIBM_TEST(acos_is_nan, Test acos/acosf(x) == NaN, x = NaN, +/-Inf, ![-1..1])
 {
 	static const double x[] = {
 	-1.1, 1.1,
@@ -59,7 +59,7 @@ AFT_LIBM_TEST(acos_is_nan, Test acos/ac
 	}
 }
 
-AFT_LIBM_TEST(acos_inrange, Test acos/acosf(x) for some valid values)
+ATF_LIBM_TEST(acos_inrange, Test acos/acosf(x) for some valid values)
 {
 	static const struct {
 		double x;
@@ -88,7 +88,7 @@ AFT_LIBM_TEST(acos_inrange, Test acos/a
 	}
 }
 
-AFT_LIBM_TEST(acos_is_plus_zero, Test acosf(1.0) == +0.0)
+ATF_LIBM_TEST(acos_is_plus_zero, Test acosf(1.0) == +0.0)
 {
 	T_LIBM_CHECK_PLUS_ZERO(0, acos, 1.0);
 	T_LIBM_CHECK_PLUS_ZERO(0, acosf, 1.0);

Index: src/tests/lib/libm/t_libm.h
diff -u src/tests/lib/libm/t_libm.h:1.1 src/tests/lib/libm/t_libm.h:1.2
--- src/tests/lib/libm/t_libm.h:1.1	Wed Mar  5 19:43:46 2014
+++ src/tests/lib/libm/t_libm.h	Wed Mar  5 20:14:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_libm.h,v 1.1 2014/03/05 19:43:46 dsl Exp $ */
+/* $NetBSD: t_libm.h,v 1.2 2014/03/05 20:14:46 dsl Exp $ */
 
 /*
  * Check result of fn(arg) is correct within the bounds.
@@ -43,12 +43,12 @@
 } while (0)
 
 /* Some useful constants (for test vectors) */
-#define T_LIBM_NAN	(0.0L / 0.0L)
-#define T_LIBM_PLUS_INF	(+1.0L / 0.0L)
-#define T_LIBM_MINUS_INF (-1.0L / 0.0L)
+#define T_LIBM_NAN	(0.0 / 0.0)
+#define T_LIBM_PLUS_INF	(+1.0 / 0.0)
+#define T_LIBM_MINUS_INF (-1.0 / 0.0)
 
 /* One line definition of a simple test */
-#define AFT_LIBM_TEST(name, description) \
+#define ATF_LIBM_TEST(name, description) \
 ATF_TC(name); \
 ATF_TC_HEAD(name, tc) { atf_tc_set_md_var(tc, descr, description); } \
 ATF_TC_BODY(name, tc)



CVS commit: src/tests/lib/libm

2014-03-05 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Mar  5 20:15:41 UTC 2014

Modified Files:
src/tests/lib/libm: t_atan.c

Log Message:
A couple of the atan tests are randomly failing.
Print the incorrect value.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libm/t_atan.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_atan.c
diff -u src/tests/lib/libm/t_atan.c:1.11 src/tests/lib/libm/t_atan.c:1.12
--- src/tests/lib/libm/t_atan.c:1.11	Mon Mar  3 10:39:08 2014
+++ src/tests/lib/libm/t_atan.c	Wed Mar  5 20:15:41 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_atan.c,v 1.11 2014/03/03 10:39:08 martin Exp $ */
+/* $NetBSD: t_atan.c,v 1.12 2014/03/05 20:15:41 dsl Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,11 +31,14 @@
 
 #include atf-c.h
 #include math.h
+#include t_libm.h
 
 static const struct {
 	double x;
 	double y;
 } values[] = {
+	{ T_LIBM_MINUS_INF, -M_PI / 2 },
+	{ T_LIBM_PLUS_INF,   M_PI / 2 },
 	{ -100, -1.560796660108231, },
 	{  -10, -1.471127674303735, },
 	{   -1, -M_PI / 4, },
@@ -49,212 +52,43 @@ static const struct {
 /*
  * atan(3)
  */
-ATF_TC(atan_nan);
-ATF_TC_HEAD(atan_nan, tc)
+ATF_LIBM_TEST(atan_nan, Test atan/atanf(NaN) == NaN)
 {
-	atf_tc_set_md_var(tc, descr, Test atan(NaN) == NaN);
+	T_LIBM_CHECK_NAN(0, atan, T_LIBM_NAN);
+	T_LIBM_CHECK_NAN(0, atanf, T_LIBM_NAN);
 }
 
-ATF_TC_BODY(atan_nan, tc)
+ATF_LIBM_TEST(atan_inrange, Test atan/atanf(x) for some values)
 {
-	const double x = 0.0L / 0.0L;
-
-	if (isnan(atan(x)) == 0)
-		atf_tc_fail_nonfatal(atan(NaN) != NaN);
-}
-
-ATF_TC(atan_inf_neg);
-ATF_TC_HEAD(atan_inf_neg, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atan(-Inf) == -pi/2);
-}
-
-ATF_TC_BODY(atan_inf_neg, tc)
-{
-	const double x = -1.0L / 0.0L;
-	const double eps = 1.0e-15;
-
-	if (fabs(atan(x) + M_PI_2)  eps)
-		atf_tc_fail_nonfatal(atan(-Inf) != -pi/2);
-}
-
-ATF_TC(atan_inf_pos);
-ATF_TC_HEAD(atan_inf_pos, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atan(+Inf) == pi/2);
-}
-
-ATF_TC_BODY(atan_inf_pos, tc)
-{
-	const double x = +1.0L / 0.0L;
-	const double eps = 1.0e-15;
-
-	if (fabs(atan(x) - M_PI_2)  eps)
-		atf_tc_fail_nonfatal(atan(+Inf) != pi/2);
-}
-
-ATF_TC(atan_inrange);
-ATF_TC_HEAD(atan_inrange, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atan(x) for some values);
-}
-
-ATF_TC_BODY(atan_inrange, tc)
-{
-	const double eps = 1.0e-15;
-	size_t i;
-
-	for (i = 0; i  __arraycount(values); i++) {
-		if (fabs(atan(values[i].x) - values[i].y)  eps)
-			atf_tc_fail_nonfatal(atan(%g) != %g,
-values[i].x, values[i].y);
-	}
-}
-
-ATF_TC(atan_zero_neg);
-ATF_TC_HEAD(atan_zero_neg, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atan(-0.0) == -0.0);
-}
-
-ATF_TC_BODY(atan_zero_neg, tc)
-{
-	const double x = -0.0L;
-	double y = atan(x);
-
-	if (fabs(y)  0.0 || signbit(y) == 0)
-		atf_tc_fail_nonfatal(atan(-0.0) != -0.0);
-}
-
-ATF_TC(atan_zero_pos);
-ATF_TC_HEAD(atan_zero_pos, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atan(+0.0) == +0.0);
-}
-
-ATF_TC_BODY(atan_zero_pos, tc)
-{
-	const double x = 0.0L;
-	double y = atan(x);
-
-	if (fabs(y)  0.0 || signbit(y) != 0)
-		atf_tc_fail_nonfatal(atan(+0.0) != +0.0);
-}
-
-/*
- * atanf(3)
- */
-ATF_TC(atanf_nan);
-ATF_TC_HEAD(atanf_nan, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atanf(NaN) == NaN);
-}
-
-ATF_TC_BODY(atanf_nan, tc)
-{
-	const float x = 0.0L / 0.0L;
-
-	if (isnan(atanf(x)) == 0)
-		atf_tc_fail_nonfatal(atanf(NaN) != NaN);
-}
-
-ATF_TC(atanf_inf_neg);
-ATF_TC_HEAD(atanf_inf_neg, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atanf(-Inf) == -pi/2);
-}
-
-ATF_TC_BODY(atanf_inf_neg, tc)
-{
-	const float x = -1.0L / 0.0L;
-	const float eps = 1.0e-7;
-
-	if (fabsf(atanf(x) + (float)M_PI_2)  eps)
-		atf_tc_fail_nonfatal(atanf(-Inf) != -pi/2);
-}
-
-ATF_TC(atanf_inf_pos);
-ATF_TC_HEAD(atanf_inf_pos, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atanf(+Inf) == pi/2);
-}
-
-ATF_TC_BODY(atanf_inf_pos, tc)
-{
-	const float x = +1.0L / 0.0L;
-	const float eps = 1.0e-7;
-
-	if (fabsf(atanf(x) - (float)M_PI_2)  eps)
-		atf_tc_fail_nonfatal(atanf(+Inf) != pi/2);
-}
-
-ATF_TC(atanf_inrange);
-ATF_TC_HEAD(atanf_inrange, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atanf(x) for some values);
-}
-
-ATF_TC_BODY(atanf_inrange, tc)
-{
-	const float eps = 1.0e-7;
-	float x;
-	float y;
-	size_t i;
+	unsigned int i;
 
 	for (i = 0; i  __arraycount(values); i++) {
-		x = values[i].x;
-		y = values[i].y;
-		if (fabs(atanf(x) - y)  eps)
-			atf_tc_fail_nonfatal(atan(%g) != %g, x, y);
+		T_LIBM_CHECK(i, atan, values[i].x, values[i].y, 1.0e-15);
+		T_LIBM_CHECK(i, atanf, values[i].x, values[i].y, 1.0e-7);
 	}
 }
 
-ATF_TC(atanf_zero_neg);
-ATF_TC_HEAD(atanf_zero_neg, tc)
-{
-	atf_tc_set_md_var(tc, descr, Test atanf(-0.0) == -0.0);
-}
-
-ATF_TC_BODY(atanf_zero_neg, tc)
+ATF_LIBM_TEST(atan_zero_neg, Test atan/atanf(-0.0) == -0.0)
 {
-	const float x = -0.0L;
-	float y = atanf(x);
 
-	if 

CVS commit: xsrc/external/mit

2014-03-05 Thread Joerg Sonnenberger
Module Name:xsrc
Committed By:   joerg
Date:   Wed Mar  5 21:29:31 UTC 2014

Modified Files:
xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis: sis_tritmp.h
xsrc/external/mit/libXaw/dist/src: Text.c
xsrc/external/mit/libXpm/dist/src: create.c
xsrc/external/mit/xf86-video-chips/dist/src: ct_driver.c
xsrc/external/mit/xorg-server/dist/hw/xfree86/x86emu: prim_ops.c
xsrc/external/mit/xorg-server/dist/mi: miarc.c
xsrc/external/mit/xorg-server/dist/randr: rrtransform.c
xsrc/external/mit/xtrap/dist: xtrapout.c

Log Message:
Fix abs usage.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis/sis_tritmp.h
cvs rdiff -u -r1.1.1.4 -r1.2 xsrc/external/mit/libXaw/dist/src/Text.c
cvs rdiff -u -r1.1.1.4 -r1.2 xsrc/external/mit/libXpm/dist/src/create.c
cvs rdiff -u -r1.14 -r1.15 \
xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/x86emu/prim_ops.c
cvs rdiff -u -r1.1.1.3 -r1.2 xsrc/external/mit/xorg-server/dist/mi/miarc.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/xorg-server/dist/randr/rrtransform.c
cvs rdiff -u -r1.1.1.1 -r1.2 xsrc/external/mit/xtrap/dist/xtrapout.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis/sis_tritmp.h
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis/sis_tritmp.h:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis/sis_tritmp.h:1.2
--- xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis/sis_tritmp.h:1.1.1.2	Thu Jun 11 00:50:21 2009
+++ xsrc/external/mit/MesaLib/dist/src/mesa/drivers/dri/sis/sis_tritmp.h	Wed Mar  5 21:29:31 2014
@@ -204,7 +204,7 @@ static void TAG(sis6326_draw_line_mmio)(
sisVertexPtr v1 = (sisVertexPtr)(verts + smesa-vertex_size * 4);
GLint dwPrimitiveSet = smesa-dwPrimitiveSet;
 
-   if (abs(v0-v.y - v1-v.y)  abs(v0-v.x - v1-v.x))
+   if (fabsf(v0-v.y - v1-v.y)  fabsf(v0-v.x - v1-v.x))
{
   dwPrimitiveSet |= OP_3D_DIRECTION_VERTICAL;
   if (v0-v.y  v1-v.y)

Index: xsrc/external/mit/libXaw/dist/src/Text.c
diff -u xsrc/external/mit/libXaw/dist/src/Text.c:1.1.1.4 xsrc/external/mit/libXaw/dist/src/Text.c:1.2
--- xsrc/external/mit/libXaw/dist/src/Text.c:1.1.1.4	Fri May 31 00:34:37 2013
+++ xsrc/external/mit/libXaw/dist/src/Text.c	Wed Mar  5 21:29:31 2014
@@ -2837,7 +2837,7 @@ DoSelection(TextWidget ctx, XawTextPosit
 if (motion)
 	newType = ctx-text.s.type;
 else {
-	if ((abs((long) time - (long) ctx-text.lasttime)  MULTI_CLICK_TIME)
+	if ((labs((long) time - (long) ctx-text.lasttime)  MULTI_CLICK_TIME)
 	 (pos = ctx-text.s.left  pos = ctx-text.s.right)) {
 	sarray = ctx-text.sarray;
 	for (; *sarray != XawselectNull  *sarray != ctx-text.s.type;

Index: xsrc/external/mit/libXpm/dist/src/create.c
diff -u xsrc/external/mit/libXpm/dist/src/create.c:1.1.1.4 xsrc/external/mit/libXpm/dist/src/create.c:1.2
--- xsrc/external/mit/libXpm/dist/src/create.c:1.1.1.4	Fri May 31 01:09:03 2013
+++ xsrc/external/mit/libXpm/dist/src/create.c	Wed Mar  5 21:29:31 2014
@@ -347,10 +347,10 @@ SetCloseColor(
 
 	closenesses[i].cols_index = i;
 	closenesses[i].closeness =
-		COLOR_FACTOR * (abs((long) col-red - (long) cols[i].red)
-+ abs((long) col-green - (long) cols[i].green)
-+ abs((long) col-blue - (long) cols[i].blue))
-		+ BRIGHTNESS_FACTOR * abs(((long) col-red +
+		COLOR_FACTOR * (labs((long) col-red - (long) cols[i].red)
++ labs((long) col-green - (long) cols[i].green)
++ labs((long) col-blue - (long) cols[i].blue))
+		+ BRIGHTNESS_FACTOR * labs(((long) col-red +
 	   (long) col-green +
 	   (long) col-blue)
 	   - ((long) cols[i].red +

Index: xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c
diff -u xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c:1.14 xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c:1.15
--- xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c:1.14	Sun Jun  2 08:05:46 2013
+++ xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c	Wed Mar  5 21:29:31 2014
@@ -2166,7 +2166,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int 
 	/* Only alter the memory clock if the desired memory clock differs
 	 * by 50kHz from the one currently being used.
 	 */
-	if (abs(mclk - MemClk-ProbedClk)  50) {
+	if ((mclk - MemClk-ProbedClk)  50U) {
 		unsigned char vclk[3];
 
 		MemClk-Clk = mclk;
@@ -5406,7 +5406,7 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, Dis
 	ChipsNew-XR[0x80] = ~0x80;
 }
 
-if (abs(cPtr-MemClock.Clk - cPtr-MemClock.ProbedClk)  50) {
+if ((cPtr-MemClock.Clk - cPtr-MemClock.ProbedClk)  50U) {
 	/* set mem clk */
 	ChipsNew-XR[0xCC] = cPtr-MemClock.xrCC;
 	ChipsNew-XR[0xCD] = cPtr-MemClock.xrCD;
@@ -6278,7 +6278,7 @@ 

CVS commit: xsrc/external/mit/xman/dist

2014-03-05 Thread Joerg Sonnenberger
Module Name:xsrc
Committed By:   joerg
Date:   Wed Mar  5 21:35:04 UTC 2014

Modified Files:
xsrc/external/mit/xman/dist: handler.c

Log Message:
Drop tautologic check.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 xsrc/external/mit/xman/dist/handler.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xman/dist/handler.c
diff -u xsrc/external/mit/xman/dist/handler.c:1.1.1.4 xsrc/external/mit/xman/dist/handler.c:1.2
--- xsrc/external/mit/xman/dist/handler.c:1.1.1.4	Sat Jul 23 05:56:02 2011
+++ xsrc/external/mit/xman/dist/handler.c	Wed Mar  5 21:35:04 2014
@@ -320,8 +320,6 @@ SaveFormattedPage(Widget w, XEvent * eve
  * If we are not active then take no action.
  */
 
-  if (man_globals-tempfile == NULL) return;
-
   switch (params[0][0]) {
   case 'S':
   case 's':



CVS commit: src/external/gpl3/gcc

2014-03-05 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Mar  5 21:37:02 UTC 2014

Modified Files:
src/external/gpl3/gcc/lib/libgcc/libgcc_eh: Makefile
src/external/gpl3/gcc/usr.bin/cc1plus: Makefile
src/external/gpl3/gcc/usr.bin/common: Makefile
src/external/gpl3/gcc/usr.bin/common-target: Makefile
src/external/gpl3/gcc/usr.bin/gcov: Makefile
src/external/gpl3/gcc/usr.bin/libcpp: Makefile

Log Message:
Get GCC 4.8 closer to build with USE_SSP set to yes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/cc1plus/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/usr.bin/common/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/usr.bin/common-target/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/usr.bin/gcov/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/libcpp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile:1.7 src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile:1.8
--- src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile:1.7	Sat Mar  1 10:00:36 2014
+++ src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile	Wed Mar  5 21:37:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2014/03/01 10:00:36 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2014/03/05 21:37:02 tron Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -14,7 +14,8 @@ LIB=		gcc_eh
 .cc: # disable .cc-NULL transform
 
 SRCS+=		${LIB2_EH} ${LIB2_EHASM}
-COPTS.unwind-dw2.c = -Wno-stack-protector
+COPTS.c-typeck.c=	-Wno-stack-protector
+COPTS.unwind-dw2.c=	-Wno-stack-protector
 
 MKPIC:=	no
 

Index: src/external/gpl3/gcc/usr.bin/cc1plus/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.6 src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.7
--- src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.6	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/cc1plus/Makefile	Wed Mar  5 21:37:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/05 21:37:02 tron Exp $
 
 PROG=		cc1plus
 SRCS=		${G_CXX_OBJS:S,c-family/,,:S,cp/,,:Nlibcpp.a:.o=.c} main.c ${PROG}-checksum.c
@@ -38,6 +38,7 @@ CHECKSUM_OBJS= ${LIBBACKTRACEOBJ}/libbac
 
 # YUCK.  but see timevar.h:POP_TIMEVAR_AND_RETURN
 CFLAGS+=	-Wno-error # not good enough: -Wno-return-type
+COPTS+=		-Wno-stack-protector
 
 LDADD+=	${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
 DPADD+=	${LIBMPC} ${LIBMPFR} ${LIBGMP} ${LIBINTL} ${LIBZ} ${LIBM}

Index: src/external/gpl3/gcc/usr.bin/common/Makefile
diff -u src/external/gpl3/gcc/usr.bin/common/Makefile:1.1 src/external/gpl3/gcc/usr.bin/common/Makefile:1.2
--- src/external/gpl3/gcc/usr.bin/common/Makefile:1.1	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/common/Makefile	Wed Mar  5 21:37:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/05 21:37:02 tron Exp $
 
 LIBISPRIVATE=	yes
 
@@ -22,6 +22,9 @@ MKPICLIB:=	no
 
 HOSTPROG_CXX=	1
 
+COPTS.diagnostic.c=	-Wno-stack-protector
+COPTS.intl.c=		-Wno-stack-protector
+
 .include bsd.lib.mk
 
 # Force using C++ for this

Index: src/external/gpl3/gcc/usr.bin/common-target/Makefile
diff -u src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.1 src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.2
--- src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.1	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/common-target/Makefile	Wed Mar  5 21:37:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/05 21:37:02 tron Exp $
 
 LIBISPRIVATE=	yes
 
@@ -19,6 +19,9 @@ CPPFLAGS+=	-I${GCCARCH} -I${BACKENDOBJ} 
 		-DCONFIGURE_SPECS=\\ \
 		-I${BACKENDOBJ}
 
+COPTS.prefix.c=		-Wno-stack-protector
+COPTS.opts-common.c=	-Wno-stack-protector
+
 GENPROG_ERROR_DEPENDS=errors.lo
 
 .include ../Makefile.options

Index: src/external/gpl3/gcc/usr.bin/gcov/Makefile
diff -u src/external/gpl3/gcc/usr.bin/gcov/Makefile:1.4 src/external/gpl3/gcc/usr.bin/gcov/Makefile:1.5
--- src/external/gpl3/gcc/usr.bin/gcov/Makefile:1.4	Sat Mar  1 10:00:52 2014
+++ src/external/gpl3/gcc/usr.bin/gcov/Makefile	Wed Mar  5 21:37:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2014/03/01 10:00:52 mrg Exp $
+#	$NetBSD: Makefile,v 1.5 2014/03/05 21:37:02 tron Exp $
 
 .include bsd.own.mk
 
@@ -18,7 +18,7 @@ HOSTPROG_CXX=	1
 # Force using C++ for this
 HOST_CC:=	${HOST_CXX}
 CC:=		${CXX}
-CFLAGS:=	${CXXFLAGS}
+CFLAGS:=	${CXXFLAGS} -Wno-stack-protector
 
 .include ../Makefile.common
 .include ../Makefile.libcpp
@@ -29,6 +29,4 @@ CFLAGS:=	${CXXFLAGS}
 LDADD+=		-lintl
 DPADD+=		${LIBINTL}
 
-COPTS+=		-Wno-stack-protector
-
 .PATH: ${DIST}/gcc

Index: 

CVS commit: src/external/gpl3/gcc/lib/libgcc/libgcc_s

2014-03-05 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Mar  5 21:38:59 UTC 2014

Modified Files:
src/external/gpl3/gcc/lib/libgcc/libgcc_s: Makefile

Log Message:
Remove automatically generated file libgcc-std.ver while cleaning.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile:1.8 src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile:1.9
--- src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile:1.8	Sat Mar  1 10:00:36 2014
+++ src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile	Wed Mar  5 21:38:59 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2014/03/01 10:00:36 mrg Exp $
+#	$NetBSD: Makefile,v 1.9 2014/03/05 21:38:59 tron Exp $
 
 USE_SHLIBDIR=	yes
 REQUIRETOOLS=	yes
@@ -46,6 +46,7 @@ LIBGCC_S_OBJS=	${OBJS}
 .endif
 
 LIBGCC_STD_VER_IN=	${GNUHOSTDIST}/libgcc/libgcc-std.ver.in
+CLEANFILES+=		libgcc-std.ver
 
 libgcc-std.ver:	${LIBGCC_STD_VER_IN}
 	${_MKTARGET_CREATE}



CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2/i915drm

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 22:17:59 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/i915drm [riastradh-drm2]: intel_gtt.c

Log Message:
Kludgey attempt to fill in intel_gtt stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/sys/external/bsd/drm2/i915drm/intel_gtt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/intel_gtt.c
diff -u src/sys/external/bsd/drm2/i915drm/intel_gtt.c:1.1.2.1 src/sys/external/bsd/drm2/i915drm/intel_gtt.c:1.1.2.2
--- src/sys/external/bsd/drm2/i915drm/intel_gtt.c:1.1.2.1	Sun Sep  8 15:52:20 2013
+++ src/sys/external/bsd/drm2/i915drm/intel_gtt.c	Wed Mar  5 22:17:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_gtt.c,v 1.1.2.1 2013/09/08 15:52:20 riastradh Exp $	*/
+/*	$NetBSD: intel_gtt.c,v 1.1.2.2 2014/03/05 22:17:59 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,17 +32,36 @@
 /* Intel GTT stubs */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intel_gtt.c,v 1.1.2.1 2013/09/08 15:52:20 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: intel_gtt.c,v 1.1.2.2 2014/03/05 22:17:59 riastradh Exp $);
+
+#include sys/types.h			/* XXX pcivar.h needs...@!#^  */
+
+#include dev/pci/pcivar.h		/* XXX agpvar.h needs...  */
+#include dev/pci/agpvar.h
+#include dev/pci/agp_i810var.h
 
 #include drm/intel-gtt.h
 
 bool
 intel_enable_gtt(void)
 {
-	return false;
+
+	/*
+	 * The agp_i810 initialization code already enables the GTT, as
+	 * far as I can tell.
+	 *
+	 * XXX That might not be correct.
+	 */
+	return (agp_i810_sc != NULL);
 }
 
 void
 intel_gtt_chipset_flush(void)
 {
+
+	/*
+	 * XXX If the Linux code is any indication, this is not
+	 * sufficient...but it'll probably do for now.
+	 */
+	agp_flush_cache();
 }



CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 22:18:10 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915 [riastradh-drm2]: i915_gem.c
intel_display.c
src/sys/external/bsd/drm2/include/drm [riastradh-drm2]:
drm_wait_netbsd.h

Log Message:
Implement and use non-interruptible DRM_WAIT_* gizmos.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.20 -r1.1.1.1.2.21 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
cvs rdiff -u -r1.1.1.1.2.9 -r1.1.1.1.2.10 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 \
src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.1.1.1.2.20 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.1.1.1.2.21
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.1.1.1.2.20	Tue Jan 21 20:57:00 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Wed Mar  5 22:18:10 2014
@@ -1195,14 +1195,16 @@ static int __wait_seqno(struct intel_rin
 #ifdef __NetBSD__
 		unsigned long flags;
 		spin_lock_irqsave(dev_priv-irq_lock, flags);
-		/*
-		 * XXX This wait is always interruptible; we should
-		 * heed the flag `interruptible'.
-		 */
-		DRM_SPIN_TIMED_WAIT_UNTIL(end, ring-irq_queue,
-		dev_priv-irq_lock,
-		timeout_jiffies,
-		EXIT_COND);
+		if (interruptible)
+			DRM_SPIN_TIMED_WAIT_UNTIL(end, ring-irq_queue,
+			dev_priv-irq_lock,
+			timeout_jiffies,
+			EXIT_COND);
+		else
+			DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(end, ring-irq_queue,
+			dev_priv-irq_lock,
+			timeout_jiffies,
+			EXIT_COND);
 		spin_unlock_irqrestore(dev_priv-irq_lock, flags);
 #else
 		if (interruptible)

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.1.1.1.2.9 src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.1.1.1.2.10
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.1.1.1.2.9	Sun Sep  8 16:38:51 2013
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c	Wed Mar  5 22:18:10 2014
@@ -2248,14 +2248,12 @@ intel_finish_fb(struct drm_framebuffer *
 	bool was_interruptible = dev_priv-mm.interruptible;
 	int ret;
 
-#ifdef __NetBSD__		/* XXX DRM_WAIT_UNINTERRUPTIBLE_UNTIL */
+#ifdef __NetBSD__
 	mutex_lock(dev_priv-pending_flip_lock);
-	do {
-		DRM_WAIT_UNTIL(ret, dev_priv-pending_flip_queue,
-		dev_priv-pending_flip_lock,
-		(atomic_read(dev_priv-mm.wedged) ||
-			atomic_read(obj-pending_flip) == 0));
-	} while (ret);
+	DRM_WAIT_NOINTR_UNTIL(ret, dev_priv-pending_flip_queue,
+	dev_priv-pending_flip_lock,
+	(atomic_read(dev_priv-mm.wedged) ||
+		atomic_read(obj-pending_flip) == 0));
 	mutex_unlock(dev_priv-pending_flip_lock);
 #else
 	wait_event(dev_priv-pending_flip_queue,
@@ -2970,13 +2968,11 @@ static void intel_crtc_wait_for_pending_
 	if (crtc-fb == NULL)
 		return;
 
-#ifdef __NetBSD__		/* XXX DRM_WAIT_UNINTERRUPTIBLE_UNTIL */
+#ifdef __NetBSD__
 	mutex_lock(dev_priv-pending_flip_lock);
-	do {
-		DRM_WAIT_UNTIL(error, dev_priv-pending_flip_queue,
-		dev_priv-pending_flip_lock,
-		!intel_crtc_has_pending_flip(crtc));
-	} while (error);
+	DRM_WAIT_NOINTR_UNTIL(error, dev_priv-pending_flip_queue,
+	dev_priv-pending_flip_lock,
+	!intel_crtc_has_pending_flip(crtc));
 	mutex_unlock(dev_priv-pending_flip_lock);
 #else
 	wait_event(dev_priv-pending_flip_queue,

Index: src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h
diff -u src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h:1.1.2.8 src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h:1.1.2.9
--- src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h:1.1.2.8	Sun Sep  8 16:35:20 2013
+++ src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h	Wed Mar  5 22:18:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_wait_netbsd.h,v 1.1.2.8 2013/09/08 16:35:20 riastradh Exp $	*/
+/*	$NetBSD: drm_wait_netbsd.h,v 1.1.2.9 2014/03/05 22:18:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@ DRM_SPIN_WAKEUP_ALL(drm_waitqueue_t *q, 
 	cv_broadcast(q);
 }
 
-#define	DRM_WAIT_UNTIL(RET, Q, INTERLOCK, CONDITION)	do		\
+#define	_DRM_WAIT_UNTIL(RET, WAIT, Q, INTERLOCK, CONDITION) do		\
 {	\
 	KASSERT(mutex_is_locked((INTERLOCK)));\
 	for (;;) {			\
@@ -108,13 +108,21 @@ DRM_SPIN_WAKEUP_ALL(drm_waitqueue_t *q, 
 			break;		\
 		}			\
 		/* XXX errno NetBSD-Linux */\
-		(RET) = -cv_wait_sig((Q), (INTERLOCK)-mtx_lock);	\
+		(RET) = -WAIT((Q), (INTERLOCK)-mtx_lock);		\
 		if (RET)		\
 			break;		\
 	}\
 } while (0)
 
-#define	DRM_TIMED_WAIT_UNTIL(RET, Q, INTERLOCK, TICKS, CONDITION) do	\
+#define	cv_wait_nointr(Q, I)	(cv_wait((Q), (I)), 

CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2/i915drm

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 22:18:27 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/i915drm [riastradh-drm2]: i915_gem_gtt.c

Log Message:
Fix up i915_gem_gtt for agp-style gen6 devices.

- Set the DMA mask correctly: gen4 needs 32-bit; gen4+, 36-bit.
- Use agp_i810_write_gtt_entry, not AGP_BIND_PAGE.
- Do a posting read after changing all the GTT entries.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 \
src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.9 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.10
--- src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.1.2.9	Wed Mar  5 14:45:00 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c	Wed Mar  5 22:18:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_gtt.c,v 1.1.2.9 2014/03/05 14:45:00 riastradh Exp $	*/
+/*	$NetBSD: i915_gem_gtt.c,v 1.1.2.10 2014/03/05 22:18:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i915_gem_gtt.c,v 1.1.2.9 2014/03/05 14:45:00 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: i915_gem_gtt.c,v 1.1.2.10 2014/03/05 22:18:27 riastradh Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -83,6 +83,18 @@ i915_gem_gtt_init(struct drm_device *dev
 	if (ret)
 		goto fail0;
 
+	/*
+	 * The GTT entries are limited to 32-bit physical addresses up
+	 * until gen4, at and after which they are limited to 36-bit
+	 * physical addresses.
+	 *
+	 * XXX pci_set_dma_mask?  pci_set_consistent_dma_mask?
+	 */
+	if (INTEL_INFO(dev)-gen  4)
+		drm_limit_dma_space(dev, 0, 0xULL);
+	else
+		drm_limit_dma_space(dev, 0, 0x000fULL);
+
 	/* Success!  */
 	DRM_INFO(Memory usable by graphics device = %dM\n,
 	gtt-gtt_total_entries  8);
@@ -428,10 +440,12 @@ agp_ggtt_bind_object(struct drm_i915_gem
 {
 	struct drm_device *const dev = obj-base.dev;
 	struct drm_i915_private *const dev_priv = dev-dev_private;
+	struct agp_i810_softc *const isc = agp_i810_sc-as_chipc;
 	const off_t start = obj-gtt_space-start;
 	bus_addr_t addr;
 	bus_size_t len;
 	unsigned int seg, i = 0;
+	int error;
 
 	for (seg = 0; seg  obj-igo_dmamap-dm_nsegs; seg++) {
 		addr = obj-igo_dmamap-dm_segs[seg].ds_addr;
@@ -439,8 +453,14 @@ agp_ggtt_bind_object(struct drm_i915_gem
 		do {
 			KASSERT(PAGE_SIZE = len);
 			KASSERT(0 == (len % PAGE_SIZE));
-			AGP_BIND_PAGE(agp_i810_sc, (start + (i  PAGE_SHIFT)),
-			addr);
+			error = agp_i810_write_gtt_entry(isc,
+			(start + (i  PAGE_SHIFT)), (addr | 1));
+			if (error)
+DRM_DEBUG(agp_i810_write_gtt_entry
+ %PRIxMAX - %PRIxMAX failed: %d\n,
+(uintmax_t)(start + (i  PAGE_SHIFT)),
+(uintmax_t)(addr | 1),
+error);
 			addr += PAGE_SIZE;
 			len -= PAGE_SIZE;
 			i += 1;
@@ -452,22 +472,20 @@ agp_ggtt_bind_object(struct drm_i915_gem
 		(start  PAGE_SHIFT)));
 	KASSERT(i == (obj-base.size  PAGE_SHIFT));
 
-	/*
-	 * XXX Linux does a posting read here of the last PTE, but the
-	 * AGP API provides no way to do that.  Hope it's OK...
-	 */
+	agp_i810_post_gtt_entry(isc, (start + ((i-1)  PAGE_SHIFT)));
 }
 
 static void
 agp_ggtt_clear_range(struct drm_device *dev, unsigned start_page,
 unsigned npages)
 {
+	struct agp_i810_softc *const isc = agp_i810_sc-as_chipc;
 	unsigned page;
 
 	for (page = start_page; npages--; page++)
-		AGP_UNBIND_PAGE(agp_i810_sc, (off_t)page  PAGE_SHIFT);
+		agp_i810_write_gtt_entry(isc, (off_t)page  PAGE_SHIFT, 0);
 
-	/* XXX Posting read!  */
+	agp_i810_post_gtt_entry(isc, ((page - 1)  PAGE_SHIFT));
 }
 
 /*
@@ -533,9 +551,6 @@ gen6_gtt_init(struct drm_device *dev)
 
 	gtt-do_idle_maps = false;
 
-	/* XXX pci_set_dma_mask?  pci_set_consistent_dma_mask?  */
-	drm_limit_dma_space(dev, 0, 0x000fULL);
-
 	gtt-gma_bus_addr = dev-bus_maps[2].bm_base;
 
 	snb_gmch_ctl = pci_conf_read(pa-pa_pc, pa-pa_tag, SNB_GMCH_CTRL);
@@ -595,8 +610,7 @@ fail2: __unused
 	i915_gem_gtt_fini_scratch_page(gtt, dev-dmat);
 fail1:	bus_space_unmap(dev-bst, gtt-gtt_bsh,
 	(gtt-gtt_total_entries * sizeof(gtt_pte_t)));
-fail0:	/* XXX Undo drm_limit_dma_space?  */
-	return ret;
+fail0:	return ret;
 }
 
 static void



CVS commit: [riastradh-drm2] src/sys/dev/pci

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  5 22:18:19 UTC 2014

Modified Files:
src/sys/dev/pci [riastradh-drm2]: agp_i810.c agp_i810var.h

Log Message:
Expose agp_i810_write_gtt_entry for drm2.

Also add an agp_i810_post_gtt_entry to do a posting read for that GTT
entry.


To generate a diff of this commit:
cvs rdiff -u -r1.73.26.1 -r1.73.26.2 src/sys/dev/pci/agp_i810.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/dev/pci/agp_i810var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/agp_i810.c
diff -u src/sys/dev/pci/agp_i810.c:1.73.26.1 src/sys/dev/pci/agp_i810.c:1.73.26.2
--- src/sys/dev/pci/agp_i810.c:1.73.26.1	Wed Mar  5 14:42:40 2014
+++ src/sys/dev/pci/agp_i810.c	Wed Mar  5 22:18:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_i810.c,v 1.73.26.1 2014/03/05 14:42:40 riastradh Exp $	*/
+/*	$NetBSD: agp_i810.c,v 1.73.26.2 2014/03/05 22:18:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agp_i810.c,v 1.73.26.1 2014/03/05 14:42:40 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: agp_i810.c,v 1.73.26.2 2014/03/05 22:18:19 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -87,8 +87,6 @@ static bool agp_i810_resume(device_t, co
 static int agp_i810_init(struct agp_softc *);
 
 static int agp_i810_init(struct agp_softc *);
-static int agp_i810_write_gtt_entry(struct agp_i810_softc *, off_t,
-bus_addr_t);
 
 static struct agp_methods agp_i810_methods = {
 	agp_i810_get_aperture,
@@ -103,7 +101,7 @@ static struct agp_methods agp_i810_metho
 	agp_i810_unbind_memory,
 };
 
-static int
+int
 agp_i810_write_gtt_entry(struct agp_i810_softc *isc, off_t off, bus_addr_t v)
 {
 	u_int32_t pte;
@@ -157,6 +155,35 @@ agp_i810_write_gtt_entry(struct agp_i810
 	return 0;
 }
 
+void
+agp_i810_post_gtt_entry(struct agp_i810_softc *isc, off_t off)
+{
+	bus_size_t base_off, wroff;
+
+	base_off = 0;
+	wroff = (off  AGP_PAGE_SHIFT) * 4;
+
+	switch (isc-chiptype) {
+	case CHIP_I810:
+	case CHIP_I830:
+	case CHIP_I855:
+		base_off = AGP_I810_GTT;
+		break;
+	case CHIP_I965:
+		base_off = AGP_I965_GTT;
+		break;
+	case CHIP_G4X:
+		base_off = AGP_G4X_GTT;
+		break;
+	case CHIP_I915:
+	case CHIP_G33:
+		(void)bus_space_read_4(isc-gtt_bst, isc-gtt_bsh, wroff);
+		return;
+	}
+
+	(void)READ4(base_off + wroff);
+}
+
 /* XXXthorpej -- duplicated code (see arch/x86/pci/pchb.c) */
 static int
 agp_i810_vgamatch(const struct pci_attach_args *pa)

Index: src/sys/dev/pci/agp_i810var.h
diff -u src/sys/dev/pci/agp_i810var.h:1.1.2.1 src/sys/dev/pci/agp_i810var.h:1.1.2.2
--- src/sys/dev/pci/agp_i810var.h:1.1.2.1	Wed Mar  5 14:42:40 2014
+++ src/sys/dev/pci/agp_i810var.h	Wed Mar  5 22:18:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_i810var.h,v 1.1.2.1 2014/03/05 14:42:40 riastradh Exp $	*/
+/*	$NetBSD: agp_i810var.h,v 1.1.2.2 2014/03/05 22:18:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -51,3 +51,6 @@ struct agp_i810_softc {
 };
 
 extern struct agp_softc	*agp_i810_sc;
+
+int	agp_i810_write_gtt_entry(struct agp_i810_softc *, off_t, bus_addr_t);
+void	agp_i810_post_gtt_entry(struct agp_i810_softc *, off_t);



CVS commit: src/external/gpl3/gdb/dist/gdb

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar  5 23:08:58 UTC 2014

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
Don't include corelow.o and solib.o the {powerpc,sh3}*-netbsd cases since
those are provided by Makefile.in.  This allows MKCROSSGDB to build again
for powerpc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.4 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.5
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.4	Thu Oct  3 18:30:44 2013
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Wed Mar  5 23:08:58 2014
@@ -405,8 +405,8 @@ powerpc*-*-freebsd*)
 powerpc-*-netbsd* | powerpc-*-knetbsd*-gnu | powerpc64-*-netbsd*)
 	# Target: NetBSD/powerpc
 	gdb_target_obs=rs6000-tdep.o ppcnbsd-tdep.o ppc-sysv-tdep.o \
-			solib.o solib-svr4.o solib-spu.o spu-multiarch.o \
-			corelow.o symfile-mem.o nbsd-tdep.o
+			solib-svr4.o solib-spu.o spu-multiarch.o \
+			symfile-mem.o nbsd-tdep.o
 			ravenscar-thread.o ppc-ravenscar-thread.o
 	gdb_sim=../sim/ppc/libsim.a
 	;;
@@ -486,7 +486,7 @@ sh*-*-linux*)
 sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu)
 	# Target: NetBSD/sh
 	gdb_target_obs=sh-tdep.o sh64-tdep.o shnbsd-tdep.o \
-			nbsd-tdep.o corelow.o solib.o solib-svr4.o
+			nbsd-tdep.o solib-svr4.o
 	gdb_sim=../sim/sh/libsim.a
 	;;
 sh*-*-openbsd*)



CVS commit: [riastradh-drm2] src/sys/external/bsd/drm2/dist/drm/i915

2014-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  6 00:32:39 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915 [riastradh-drm2]: i915_gem.c

Log Message:
Take the vmobjlock in i915_gem_release_mmap around pmap_page_protect.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.21 -r1.1.1.1.2.22 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.1.1.1.2.21 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.1.1.1.2.22
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.1.1.1.2.21	Wed Mar  5 22:18:10 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Thu Mar  6 00:32:39 2014
@@ -1774,10 +1774,12 @@ i915_gem_release_mmap(struct drm_i915_ge
 	{
 		struct vm_page *page;
 
+		mutex_enter(obj-base.gemo_shm_uao-vmobjlock);
 		KASSERT(obj-pages != NULL);
 		/* Force a fresh fault for each page.  */
 		TAILQ_FOREACH(page, obj-igo_pageq, pageq.queue)
 			pmap_page_protect(page, VM_PROT_NONE);
+		mutex_exit(obj-base.gemo_shm_uao-vmobjlock);
 	}
 #else
 	if (obj-base.dev-dev_mapping)



CVS commit: src/external/bsd/bind

2014-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  6 02:12:56 UTC 2014

Modified Files:
src/external/bsd/bind: bind2netbsd

Log Message:
bid the libtool.m4 lossage.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bind/bind2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/bind/bind2netbsd
diff -u src/external/bsd/bind/bind2netbsd:1.1 src/external/bsd/bind/bind2netbsd:1.2
--- src/external/bsd/bind/bind2netbsd:1.1	Tue Dec 31 15:23:12 2013
+++ src/external/bsd/bind/bind2netbsd	Wed Mar  5 21:12:56 2014
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: bind2netbsd,v 1.1 2013/12/31 20:23:12 christos Exp $
+#	$NetBSD: bind2netbsd,v 1.2 2014/03/06 02:12:56 christos Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -79,6 +79,11 @@ echo copying $r to $d
 cd $r
 pax -rw * $d
 
+if [ -d $d/libtool.m4 ]
+then
+	mv $d/libtool.m4 $d/m4
+fi
+
 ### Remove the $'s around RCS tags
 cleantags $d
 



CVS commit: othersrc/external/bsd/bikeshed/dist/design

2014-03-05 Thread David A. Holland
Module Name:othersrc
Committed By:   dholland
Date:   Thu Mar  6 05:24:08 UTC 2014

Modified Files:
othersrc/external/bsd/bikeshed/dist/design: requirements.txt

Log Message:
a couple minor adjustments, sitting around since last july


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
othersrc/external/bsd/bikeshed/dist/design/requirements.txt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/bikeshed/dist/design/requirements.txt
diff -u othersrc/external/bsd/bikeshed/dist/design/requirements.txt:1.2 othersrc/external/bsd/bikeshed/dist/design/requirements.txt:1.3
--- othersrc/external/bsd/bikeshed/dist/design/requirements.txt:1.2	Fri May 24 08:25:11 2013
+++ othersrc/external/bsd/bikeshed/dist/design/requirements.txt	Thu Mar  6 05:24:08 2014
@@ -178,7 +178,7 @@ in up front.
 
 Branches that are intended to diverge (releases, for example, or
 outright project forks) are fundamentally different from branches that
-are expected to reconnect to their parent (b.g. feature development
+are expected to reconnect to their parent (e.g. feature development
 branches) once the version control system has any kind of branch
 management or tracking support.
 
@@ -197,7 +197,8 @@ capable of listing the ones that haven't
 possible action. There is absolutely no reason, however, that the
 version control system shouldn't be able to provide this information.
 AIUI, for release branches releng currently has to maintain this
-metadata by hand.
+metadata by hand. (Update: no existing ... may actually be no
+existing free )
 
 If you duplicate a file, such as cloning a device driver template file
 for a new driver, or starting a new pmap by copying an old one,



CVS commit: src/libexec/ld.elf_so/arch/powerpc

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 07:47:19 UTC 2014

Added Files:
src/libexec/ld.elf_so/arch/powerpc: rtld_start64.S

Log Message:
Startup file for powerpc64.  (too many difference with ppc32 to do
#ifdef dance)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/libexec/ld.elf_so/arch/powerpc/rtld_start64.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/libexec/ld.elf_so/arch/powerpc/rtld_start64.S
diff -u /dev/null src/libexec/ld.elf_so/arch/powerpc/rtld_start64.S:1.1
--- /dev/null	Thu Mar  6 07:47:19 2014
+++ src/libexec/ld.elf_so/arch/powerpc/rtld_start64.S	Thu Mar  6 07:47:19 2014
@@ -0,0 +1,129 @@
+/*	$NetBSD: rtld_start64.S,v 1.1 2014/03/06 07:47:19 matt Exp $	*/
+
+/*-
+ * Copyright (C) 1998	Tsubai Masanari
+ * Portions copyright 2002 Charles M. Hannum r...@ihack.net
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include machine/asm.h
+
+	.globl	_rtld_relocate_nonplt_self
+	.globl	_rtld
+
+	.text
+ENTRY_NOPROFILE(_rtld_start)
+	mr	%r23,%r3		// argc
+	mr	%r24,%r4		// argv
+	mr	%r25,%r5		// envp
+/*	mr	%r26,%r6		// obj		(always 0) */
+/*	mr	%r27,%r7		// cleanup	(always 0) */
+	mr	%r28,%r8		// ps_strings
+	li	%r0,0
+	stdu	%r0,-64(%r1)		// terminate stack chain
+	std	%r2,40(%r1)		// save TOC
+	std	%r0,16(%r1)		// ditto
+
+	bcl	20,31,1f
+1:	mflr	%r30
+	ld	%r3,0(%r2)		// TOC[0] = TOC
+	sub	%r29,%r2,%r3		// compute relocbase
+
+	addis	%r3,%r3,_DYNAMIC-1b@ha	// get _DYNAMIC actual address
+	addi	%r3,%r3,_DYNAMIC-1b@l
+	mr	%r4,%r29		// r4 = relocbase
+	CALL(_rtld_relocate_nonplt_self)
+
+	addi	%r3,%r1,48		// sp = local variable space
+	mr	%r4,%r29		// r4 = relocbase
+	CALL(_rtld)			// _start = _rtld(sp, relocbase)
+
+	ld	%r0,0(%r3)		// func address
+	ld	%r2,8(%r3)		// TOC address
+	ld	%r11,16(%r3)		// environment pointer
+	mtctr	%r0			// so we can call it.
+
+	mr	%r3,%r23		// argc
+	mr	%r4,%r24		// argv
+	mr	%r5,%r25		// envp
+	ld	%r6,56(%r1)		// obj = localvar[1]
+	ld	%r7,48(%r1)		// cleanup = localvar[0]
+	mr	%r8,%r28		// ps_strings
+
+	bctrl		// _start(argc, argv, envp, obj, cleanup, ps_strings)
+	nop
+
+	li	%r0,1			// _exit()
+	sc
+END(_rtld_start)
+
+	.globl	_rtld_bind
+
+/*
+ * %r0 has the index of the rela, %r12 has a pointer to the plt entry.
+ */
+ENTRY_NOPROFILE(_rtld_bind_start)
+	std	%r3,-72(%r1)		// save argument register
+	std	%r4,-64(%r1)		// save argument register
+	std	%r5,-56(%r1)		// save argument register
+	std	%r6,-48(%r1)		// save argument register
+	std	%r7,-40(%r1)		// save argument register
+	std	%r8,-32(%r1)		// save argument register
+	std	%r9,-24(%r1)		// save argument register
+	std	%r10,-16(%r1)		// save argument register
+	std	%r31,-8(%r1)		// save register
+	stdu	%r1,-(48+80)(%r1)	// create back chain
+	mflr	%r10
+	std	%r10,16(%r1)		// save LR
+	mfcr	%r9
+	std	%r9,8(%r1)		// save CR to be safe
+
+	mr	%r31, %r12		// save this across bind call
+	mr	%r3, %r11 		// obj
+	mr	%r4, %r0		// reloff
+
+	CALL(_rtld_bind)		// _rtld_bind(obj, reloff)
+
+	mtctr	%r3
+	ld	%r2,8(%r31)		// load TOC for function
+	ld	%r11,16(%r31)		// load env ptr for function.
+
+	ld	%r0,8(%r1)		// get saved CR
+	mtcr	%r0			// restore it
+	ld	%r0,16(%r1)		// get saved LR
+	mtlr	%r0			// restore it
+
+	addi	%r1,%r1,(48+80)		// adjust stack
+	ld	%r3,-72(%r1)		// restore argument register
+	ld	%r4,-64(%r1)		// restore argument register
+	ld	%r5,-56(%r1)		// restore argument register
+	ld	%r6,-48(%r1)		// restore argument register
+	ld	%r7,-40(%r1)		// restore argument register
+	ld	

CVS commit: src/libexec/ld.elf_so/arch/powerpc

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 07:47:39 UTC 2014

Modified Files:
src/libexec/ld.elf_so/arch/powerpc: Makefile.inc

Log Message:
powerpc64 changes


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/libexec/ld.elf_so/arch/powerpc/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/arch/powerpc/Makefile.inc
diff -u src/libexec/ld.elf_so/arch/powerpc/Makefile.inc:1.12 src/libexec/ld.elf_so/arch/powerpc/Makefile.inc:1.13
--- src/libexec/ld.elf_so/arch/powerpc/Makefile.inc:1.12	Wed Oct 26 15:56:58 2011
+++ src/libexec/ld.elf_so/arch/powerpc/Makefile.inc	Thu Mar  6 07:47:39 2014
@@ -1,11 +1,16 @@
-#	$NetBSD: Makefile.inc,v 1.12 2011/10/26 15:56:58 chs Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2014/03/06 07:47:39 matt Exp $
 
-SRCS+=		rtld_start.S ppc_reloc.c
+SRCS+=		ppc_reloc.c
+LDFLAGS+=	-Wl,-e,_rtld_start
 
 # XXX Should not be in CPPFLAGS!
+.if ${LDELFSO_MACHINE_ARCH} == powerpc64
+SRCS+=		rtld_start64.S
+CPPFLAGS+=	-DELFSIZE=64
+.else
+SRCS+=		rtld_start.S
 CPPFLAGS+=	-fpic
-
 CPPFLAGS+=	-DELFSIZE=32
-
-LDFLAGS+=	-Wl,-e,_rtld_start
 LDFLAGS+=	-Wl,--script,${.CURDIR}/arch/powerpc/ld.so.script
+.endif
+



CVS commit: src/sys/arch/powerpc/include

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 07:48:25 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: elf_machdep.h

Log Message:
More comments.
rest of powerpc64 relocs


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/include/elf_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.9 src/sys/arch/powerpc/include/elf_machdep.h:1.10
--- src/sys/arch/powerpc/include/elf_machdep.h:1.9	Sat Jan 15 10:00:07 2011
+++ src/sys/arch/powerpc/include/elf_machdep.h	Thu Mar  6 07:48:25 2014
@@ -1,4 +1,7 @@
-/*	$NetBSD: elf_machdep.h,v 1.9 2011/01/15 10:00:07 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.10 2014/03/06 07:48:25 matt Exp $	*/
+
+#ifndef _POWERPC_ELF_MACHDEP_H_
+#define _POWERPC_ELF_MACHDEP_H_
 
 #define	ELF32_MACHDEP_ENDIANNESS	ELFDATA2MSB
 #define	ELF32_MACHDEP_ID_CASES		\
@@ -22,84 +25,179 @@
 /* Specify the value of _GLOBAL_OFFSET_TABLE_ */
 #define	DT_PPC_GOT		DT_LOPROC
 
+// A = the addend used to compute the value of relocatable field
+// B = the base address of the shared object
+// G = offset into the global offset table
+// L = section offset or address of the procedure link table entry for the
+// symbol + addend
+// M = similar to G except the address which is stored may be the address of
+// the procedure linkage table entry for the symbol
+// P = the place (section offset or address) of the storage unit being
+// relocated (computed using r_offset)
+// R = the offset of the symbol with the section in which the symbol is defined
+// S = the value of the symbol whose index resides in the relocation entry
+//
+// @dtpmod
+//   Computes the load module index of the load module that contains the
+//   definition of sym.  The addend, if present, is ignored.
+// @dtprel
+//   Computes a dtv-relative displacement, the difference between the value of
+//   S + A and the base address of the thread-local storage block that contains
+//   the definition of the symbol, minus 0x8000.
+// @tprel
+//   Computes a tp-relative displacement, the difference between the value of
+//   S + A and the value of the thread pointer (r13).
+// @got@tlsgd
+//   Allocates two contiguous entries in the GOT to hold a tls_index structure,
+//   with values @dtpmod and @dtprel, and computes the offset to the first
+//   entry relative to the TOC base (r2).
+// @got@tlsld
+//   Allocates two contiguous entries in the GOT to hold a tls_index structure,
+//   with values @dtpmod and zero, and computes the offset to the first entry
+//   relative to the TOC base (r2).
+// @got@dtprel
+//   Allocates an entry in the GOT with value @dtprel, and computes the offset
+//   to the entry relative to the TOC base (r2).
+// @got@tprel
+//   Allocates an entry in the GOT with value @tprel, and computes the offset
+//   to the entry relative to the TOC base (r2).
+// 
+// #lo(x) = (x  0x)
+// #hi(x) = ((x  16)  0x)
+// #ha(x) = (((x  16) + ((x  0x8) == 0x8000))  0x)
+// #higher(x) = ((x  32)  0x)
+// #highera(x) =
+//(((x  32) + ((x  0x8000) == 0x8000))  0x)
+// #highest(x) = ((x  48)  0x)
+// #highesta(x) =
+//(((x  48) + ((x  0x8000) == 0x8000))  0x)
+// .TOC. = base TOC base of TOC section for object being relocated
+
 #define	R_PPC_NONE 		0
-#define	R_PPC_32 		1
-#define	R_PPC_24 		2
-#define	R_PPC_16 		3
-#define	R_PPC_16_LO 		4
-#define	R_PPC_16_HI 		5 /* R_PPC_ADDIS */
-#define	R_PPC_16_HA 		6
-#define	R_PPC_14 		7
-#define	R_PPC_14_TAKEN 		8
-#define	R_PPC_14_NTAKEN 	9
-#define	R_PPC_REL24 		10 /* R_PPC_BRANCH */
-#define	R_PPC_REL14 		11
-#define	R_PPC_REL14_TAKEN 	12
-#define	R_PPC_REL14_NTAKEN 	13
-#define	R_PPC_GOT16 		14
-#define	R_PPC_GOT16_LO 		15
-#define	R_PPC_GOT16_HI 		16
-#define	R_PPC_GOT16_HA 		17
-#define	R_PPC_PLT24 		18
-#define	R_PPC_COPY 		19
-#define	R_PPC_GLOB_DAT 		20
+#define	R_PPC_ADDR32 		1	// S + A
+#define	R_PPC_ADDR24 		2	// (S + A)  2
+#define	R_PPC_ADDR16 		3	// S + A
+#define	R_PPC_ADDR16_LO 	4	// #lo(S + A)
+#define	R_PPC_ADDR16_HI 	5	// #hi(S + A)
+#define	R_PPC_ADDR16_HA 	6	// #ha(S + A)
+#define	R_PPC_ADDR14 		7	// (S + A)  2
+#define	R_PPC_ADDR14_TAKEN 	8	// (S + A)  2
+#define	R_PPC_ADDR14_NTAKEN 	9	// (S + A)  2
+#define	R_PPC_REL24 		10 	// (S + A - P)  2
+#define	R_PPC_REL14 		11	// (S + A - P)  2
+#define	R_PPC_REL14_TAKEN 	12	// (S + A - P)  2
+#define	R_PPC_REL14_NTAKEN 	13	// (S + A - P)  2
+#define	R_PPC_GOT16 		14	// G + A
+#define	R_PPC_GOT16_LO 		15	// #lo(G + A)
+#define	R_PPC_GOT16_HI 		16	// #hi(G + A)
+#define	R_PPC_GOT16_HA 		17	// #ha(G + A)
+#define	R_PPC_PLTREL24 		18	// (L + A - P)  2
+#define	R_PPC_COPY 		19	// none
+#define	R_PPC_GLOB_DAT 		20	// S + A
 #define	R_PPC_JMP_SLOT 		21
-#define	R_PPC_RELATIVE 		22
-#define	R_PPC_LOCAL24PC 	23