CVS commit: [netbsd-5] src

2013-06-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun 12 06:05:52 UTC 2013

Modified Files:
src/sys/arch/vax/boot/xxboot [netbsd-5]: start.S
src/sys/sys [netbsd-5]: bootblock.h disklabel.h
src/usr.sbin/installboot/arch [netbsd-5]: vax.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1856):
sys/arch/vax/boot/xxboot/start.S: revision 1.5
sys/sys/bootblock.h: revision 1.55
sys/sys/disklabel.h: revision 1.113
usr.sbin/installboot/arch/vax.c: revision 1.14-1.15
Rearrange primary bootstrap slightly to free up all space between the disk
label and the uVAX rom boot parameter block.
Calculate the disklabel size (for asm code) dynamically based on MAXPARTITIONS.
Adapt to new vax primary bootstrap layout.
Fix installboot for VAX, as discussed on port-vax. Problem pointed out
by Jonny Billquist, thanks to Marl Pizzolato for patiently explaining
the various ways of booting a vax to me.
Now VAX 780 can boot directly from VMB.EXE again.
Provide an empty __CTASSERT() for toolbuilds


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.88.1 src/sys/arch/vax/boot/xxboot/start.S
cvs rdiff -u -r1.45 -r1.45.10.1 src/sys/sys/bootblock.h
cvs rdiff -u -r1.102 -r1.102.4.1 src/sys/sys/disklabel.h
cvs rdiff -u -r1.12 -r1.12.6.1 src/usr.sbin/installboot/arch/vax.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/arch/vax/boot/xxboot/start.S
diff -u src/sys/arch/vax/boot/xxboot/start.S:1.4 src/sys/arch/vax/boot/xxboot/start.S:1.4.88.1
--- src/sys/arch/vax/boot/xxboot/start.S:1.4	Sun Dec 11 12:19:34 2005
+++ src/sys/arch/vax/boot/xxboot/start.S	Wed Jun 12 06:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: start.S,v 1.4 2005/12/11 12:19:34 christos Exp $ */
+/*	$NetBSD: start.S,v 1.4.88.1 2013/06/12 06:05:52 msaitoh Exp $ */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -38,6 +38,7 @@
 
 #define _LOCORE
 
+#define	__HAVE_OLD_DISKLABEL	/* not automatically added due to _LOCORE */
 #define OMIT_DKTYPENUMS
 #define OMIT_FSTYPENUMS
 #include sys/disklabel.h
@@ -55,8 +56,12 @@ _C_LABEL(start):
 .org	0x00			# uVAX booted from TK50 starts here
 	brb	from_0x00	# continue behind dispatch-block
 
+# At offset 0x02 we have a dual used area: VMB.EXE starts execution here,
+# and uVAX-ROM looks for a pointer to a parameter block. We arrange for
+# the parameter block offset to disassmble as a CASEL instructions which
+# falls through to 0x08.
 .org	0x02			# information used by uVAX-ROM
-	.byte	0xcf		# offset in words to identification area 
+	.byte	0xcf		# offset in words to identification area
 	.byte	1		# this byte must be 1
 	.word	0		# logical block number (word swapped) 
 	.word	0		# of the secondary image
@@ -74,20 +79,6 @@ from_0x00:			# uVAX from TK50 
 
 from_0x08:			# Any machine from VMB
 	movzbl	$4,_C_LABEL(from)		# Booted from full VMB
-	brw	start_vmb
-
-# the complete area reserved for label
-# must be empty (i.e. filled with zeroes).
-# disklabel(8) checks that before installing
-# the bootblocks over existing label.
-
-.org	LABELOFFSET
-	.globl	_C_LABEL(romlabel)
-_C_LABEL(romlabel):
-	.long	0
-
-.org	LABELOFFSET + d_end_
-start_vmb:
 	/*
 	 * Read in block 1-15.
 	 */
@@ -102,6 +93,20 @@ start_vmb:
 	calls	$6, (%r6)	# call the qio-routine
 	brw	start_uvax
 
+# the complete area reserved for label
+# must be empty (i.e. filled with zeroes).
+# disklabel(8) checks that before installing
+# the bootblocks over existing label.
+
+.org	LABELOFFSET
+	.globl	_C_LABEL(romlabel)
+_C_LABEL(romlabel):
+	.long	0
+
+.org	LABELOFFSET + d_end_
+# Make sure the parameter block is past the disklabel.
+# If not, the next .org would try to move backwards.
+
 /*
  * Parameter block for uVAX boot.
  */
@@ -110,7 +115,7 @@ start_vmb:
 #define SILOAD		0	/* load offset (usually 0) from the default */
 #define SIOFF		0x200	/* byte offset into secondary image */
 
-.org	0x19e
+.org	0x19e	# do not move, see comment earlier about CASEL
 	.byte	0x18		# must be 0x18 
 	.byte	0x00		# must be 0x00 (MBZ) 
 	.byte	0x00		# any value 

Index: src/sys/sys/bootblock.h
diff -u src/sys/sys/bootblock.h:1.45 src/sys/sys/bootblock.h:1.45.10.1
--- src/sys/sys/bootblock.h:1.45	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/bootblock.h	Wed Jun 12 06:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootblock.h,v 1.45 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: bootblock.h,v 1.45.10.1 2013/06/12 06:05:52 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -1380,7 +1380,8 @@ struct vax_boot_block {
 	uint8_t		bb_mbone;	/* must be one */
 	uint16_t	bb_lbn_hi;	/* lbn (hi word) of bootstrap */
 	uint16_t	bb_lbn_low;	/* lbn (low word) of bootstrap */
-	uint8_t		pad1[332];
+	uint8_t		pad1[460];
+	/* disklabel offset is 64 from base, or 56 from start of pad1 */
 
 	/* The rest of these fields are identification area and describe
 	

CVS commit: [netbsd-5] src/doc

2013-06-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun 12 06:07:09 UTC 2013

Modified Files:
src/doc [netbsd-5]: CHANGES-5.3

Log Message:
Ticket 1856


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-5.3

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

Modified files:

Index: src/doc/CHANGES-5.3
diff -u src/doc/CHANGES-5.3:1.1.2.15 src/doc/CHANGES-5.3:1.1.2.16
--- src/doc/CHANGES-5.3:1.1.2.15	Sun Jun  9 22:50:45 2013
+++ src/doc/CHANGES-5.3	Wed Jun 12 06:07:09 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.15 2013/06/09 22:50:45 msaitoh Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.16 2013/06/12 06:07:09 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -328,3 +328,12 @@ sys/netinet/ip_icmp.hpatch
 
 	Add missing codes to ICMP handling.  PR#47693.
 	[fair, ticket #1855]
+
+sys/arch/vax/boot/xxboot/start.S		1.5
+sys/sys/bootblock.h1.55
+sys/sys/disklabel.h1.113
+usr.sbin/installboot/arch/vax.c			1.14-1.15
+
+	fix VAX bootblocks and installboot for VAX 780 and similar machines
+	(booting via VMB.EXE)
+	[martin, ticket #1856]



CVS import: xsrc/external/mit/libxcb/dist

2013-06-12 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Jun 12 06:11:15 UTC 2013

Update of /cvsroot/xsrc/external/mit/libxcb/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv12577

Log Message:
initial import of libxcb-1.9.1

Status:

Vendor Tag: xorg
Release Tags:   libxcb-1-9-1

U xsrc/external/mit/libxcb/dist/xcb-xkb.pc.in
U xsrc/external/mit/libxcb/dist/configure.ac
U xsrc/external/mit/libxcb/dist/autogen.sh
U xsrc/external/mit/libxcb/dist/INSTALL
U xsrc/external/mit/libxcb/dist/xcb-shm.pc.in
U xsrc/external/mit/libxcb/dist/NEWS
U xsrc/external/mit/libxcb/dist/xcb-record.pc.in
U xsrc/external/mit/libxcb/dist/xcb-dri2.pc.in
U xsrc/external/mit/libxcb/dist/xcb-sync.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xtest.pc.in
U xsrc/external/mit/libxcb/dist/xcb-dpms.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xprint.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xevie.pc.in
U xsrc/external/mit/libxcb/dist/ltmain.sh
U xsrc/external/mit/libxcb/dist/xcb-xselinux.pc.in
U xsrc/external/mit/libxcb/dist/xcb-glx.pc.in
U xsrc/external/mit/libxcb/dist/config.sub
U xsrc/external/mit/libxcb/dist/acinclude.m4
U xsrc/external/mit/libxcb/dist/xcb.pc.in
U xsrc/external/mit/libxcb/dist/xcb-render.pc.in
U xsrc/external/mit/libxcb/dist/README
U xsrc/external/mit/libxcb/dist/missing
U xsrc/external/mit/libxcb/dist/xcb-xfixes.pc.in
U xsrc/external/mit/libxcb/dist/depcomp
U xsrc/external/mit/libxcb/dist/xcb-res.pc.in
N xsrc/external/mit/libxcb/dist/test-driver
U xsrc/external/mit/libxcb/dist/xcb-composite.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xinput.pc.in
U xsrc/external/mit/libxcb/dist/Makefile.am
U xsrc/external/mit/libxcb/dist/xcb-xinerama.pc.in
U xsrc/external/mit/libxcb/dist/xcb-damage.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xf86dri.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xvmc.pc.in
U xsrc/external/mit/libxcb/dist/xcb-randr.pc.in
U xsrc/external/mit/libxcb/dist/aclocal.m4
U xsrc/external/mit/libxcb/dist/COPYING
U xsrc/external/mit/libxcb/dist/xcb-screensaver.pc.in
U xsrc/external/mit/libxcb/dist/xcb-xv.pc.in
U xsrc/external/mit/libxcb/dist/install-sh
U xsrc/external/mit/libxcb/dist/configure
U xsrc/external/mit/libxcb/dist/Makefile.in
U xsrc/external/mit/libxcb/dist/xcb-shape.pc.in
U xsrc/external/mit/libxcb/dist/config.guess
U xsrc/external/mit/libxcb/dist/doc/xcb.doxygen.in
U xsrc/external/mit/libxcb/dist/doc/xkb_internals
U xsrc/external/mit/libxcb/dist/doc/Makefile.in
U xsrc/external/mit/libxcb/dist/doc/Makefile.am
U xsrc/external/mit/libxcb/dist/doc/xkb_issues
U xsrc/external/mit/libxcb/dist/doc/tutorial/index.html
U xsrc/external/mit/libxcb/dist/doc/tutorial/xcb.css
U xsrc/external/mit/libxcb/dist/tools/constants
U xsrc/external/mit/libxcb/dist/tools/README
U xsrc/external/mit/libxcb/dist/tools/api_conv.pl
U xsrc/external/mit/libxcb/dist/src/xcb_windefs.h
U xsrc/external/mit/libxcb/dist/src/xcb_out.c
U xsrc/external/mit/libxcb/dist/src/xcb_conn.c
C xsrc/external/mit/libxcb/dist/src/xcb_in.c
U xsrc/external/mit/libxcb/dist/src/xcbint.h
U xsrc/external/mit/libxcb/dist/src/xcb.h
U xsrc/external/mit/libxcb/dist/src/xcb_ext.c
U xsrc/external/mit/libxcb/dist/src/config.h.in
U xsrc/external/mit/libxcb/dist/src/c_client.py
U xsrc/external/mit/libxcb/dist/src/Makefile.am
U xsrc/external/mit/libxcb/dist/src/xcb_list.c
U xsrc/external/mit/libxcb/dist/src/xcb_xid.c
U xsrc/external/mit/libxcb/dist/src/xcb_auth.c
U xsrc/external/mit/libxcb/dist/src/Makefile.in
U xsrc/external/mit/libxcb/dist/src/xcbext.h
U xsrc/external/mit/libxcb/dist/src/xcb_util.c
U xsrc/external/mit/libxcb/dist/src/man/xcb-requests.3
U xsrc/external/mit/libxcb/dist/src/man/xcb-examples.3
U xsrc/external/mit/libxcb/dist/tests/check_public.c
U xsrc/external/mit/libxcb/dist/tests/check_suites.h
U xsrc/external/mit/libxcb/dist/tests/check_all.c
U xsrc/external/mit/libxcb/dist/tests/Makefile.am
U xsrc/external/mit/libxcb/dist/tests/CheckLog.xsl
U xsrc/external/mit/libxcb/dist/tests/Makefile.in

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jxorg:yesterday -jxorg xsrc/external/mit/libxcb/dist



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 07:12:10 UTC 2013

Modified Files:
src/sys/arch/arm/conf: files.arm

Log Message:
Add CPU_ARMV7 and make CPU_PJ4B and CPU_CORTEX instantiate it.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/arm/conf/files.arm

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/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.117 src/sys/arch/arm/conf/files.arm:1.118
--- src/sys/arch/arm/conf/files.arm:1.117	Sun May 19 15:51:10 2013
+++ src/sys/arch/arm/conf/files.arm	Wed Jun 12 07:12:10 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.117 2013/05/19 15:51:10 rkujawa Exp $
+#	$NetBSD: files.arm,v 1.118 2013/06/12 07:12:10 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -6,16 +6,17 @@ defflagARM32
 # CPU types.  Make sure to update arm/cpuconf.h if you change this list.
 defflag	opt_cputypes.h		CPU_ARM2 CPU_ARM250 CPU_ARM3
 defflag	opt_cputypes.h		CPU_ARM6 CPU_ARM7 CPU_ARM7TDMI CPU_ARM8
-CPU_ARM9 CPU_ARM9E CPU_ARM10 CPU_ARM11
+CPU_ARM9 CPU_ARM9E CPU_ARM10 CPU_ARM11 CPU_ARMV7
 CPU_SA110 CPU_SA1100 CPU_SA1110 CPU_IXP12X0
-CPU_FA526 CPU_CORTEX CPU_PJ4B
-CPU_XSCALE_80200 CPU_XSCALE_80321
+CPU_FA526 CPU_XSCALE_80200 CPU_XSCALE_80321
 CPU_XSCALE_PXA250 CPU_XSCALE_PXA270
 CPU_XSCALE_IXP425 
 CPU_SHEEVA
 defflag	opt_cputypes.h		CPU_ARM1136: CPU_ARM11
 defflag	opt_cputypes.h		CPU_ARM1176: CPU_ARM11
 defflag	opt_cputypes.h		CPU_ARM11MPCORE: CPU_ARM11
+defflag	opt_cputypes.h		CPU_PJ4B: CPU_ARMV7
+defflag	opt_cputypes.h		CPU_CORTEX: CPU_ARMV7
 defflag	opt_cputypes.h		CPU_CORTEXA5: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA7: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA8: CPU_CORTEX



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 07:13:18 UTC 2013

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
If the vector_page is not ARM_VECTORS_{LOW,HIGH}, assume it's in kernel
text and don't do anything special to map it.


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.255 src/sys/arch/arm/arm32/pmap.c:1.256
--- src/sys/arch/arm/arm32/pmap.c:1.255	Sat May 11 10:15:43 2013
+++ src/sys/arch/arm/arm32/pmap.c	Wed Jun 12 07:13:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.255 2013/05/11 10:15:43 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.256 2013/06/12 07:13:18 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -162,8 +162,8 @@
  *   the active domain on that cpu). I guess there are lots more tlb
  *   shootdown issues too...
  *
- * o If the vector_page is at 0x instead of 0x, then
- *   MP systems will lose big-time because of the MMU domain hack.
+ * o If the vector_page is at 0x instead of in kernel VA space,
+ *   then MP systems will lose big-time because of the MMU domain hack.
  *   The only way this can be solved (apart from moving the vector
  *   page to 0x) is to reserve the first 1MB of user address
  *   space for kernel use only. This would require re-linking all
@@ -212,7 +212,7 @@
 #include arm/cpuconf.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.255 2013/05/11 10:15:43 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.256 2013/06/12 07:13:18 matt Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -5135,6 +5135,17 @@ vector_page_setprot(int prot)
 	struct l2_bucket *l2b;
 	pt_entry_t *ptep;
 
+#if defined(CPU_ARMV7) || defined(CPU_ARM11)
+	/*
+	 * If we are using VBAR to use the vectors in the kernel, then it's
+	 * already mapped in the kernel text so no need to anything here.
+	 */
+	if (vector_page != ARM_VECTORS_LOW  vector_page != ARM_VECTORS_HIGH) {
+		KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
+		return;
+	}
+#endif
+
 	l2b = pmap_get_l2_bucket(pmap_kernel(), vector_page);
 	KDASSERT(l2b != NULL);
 



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 07:14:26 UTC 2013

Modified Files:
src/sys/arch/arm/arm32: arm32_boot.c

Log Message:
Add printfs around initializing the vector_page.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm32/arm32_boot.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/arch/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.3 src/sys/arch/arm/arm32/arm32_boot.c:1.4
--- src/sys/arch/arm/arm32/arm32_boot.c:1.3	Sat May 11 10:15:10 2013
+++ src/sys/arch/arm/arm32/arm32_boot.c	Wed Jun 12 07:14:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.3 2013/05/11 10:15:10 skrll Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.4 2013/06/12 07:14:26 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -123,7 +123,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.3 2013/05/11 10:15:10 skrll Exp $);
+__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.4 2013/06/12 07:14:26 matt Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -169,7 +169,13 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	printf(bootstrap done.\n);
 #endif
 
+#ifdef VERBOSE_INIT_ARM
+	printf(vectors);
+#endif
 	arm32_vector_init(systempage.pv_va, ARM_VEC_ALL);
+#ifdef VERBOSE_INIT_ARM
+	printf( %#PRIxVADDR\n, vector_page);
+#endif
 
 	/*
 	 * Pages were allocated during the secondary bootstrap for the



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 07:17:23 UTC 2013

Modified Files:
src/sys/arch/arm/arm: vectors.S

Log Message:
If we are using the VBAR to access the system vectors, we can just branch
to the exception routines avoiding a load.  VBAR only exists for those
processors which implement the Security extension.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/arm/vectors.S

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/arm/vectors.S
diff -u src/sys/arch/arm/arm/vectors.S:1.4 src/sys/arch/arm/arm/vectors.S:1.5
--- src/sys/arch/arm/arm/vectors.S:1.4	Sat Aug 17 16:36:32 2002
+++ src/sys/arch/arm/arm/vectors.S	Wed Jun 12 07:17:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.S,v 1.4 2002/08/17 16:36:32 thorpej Exp $	*/
+/*	$NetBSD: vectors.S,v 1.5 2013/06/12 07:17:23 matt Exp $	*/
 
 /*
  * Copyright (C) 1994-1997 Mark Brinicombe
@@ -32,6 +32,7 @@
  */
 
 #include assym.h
+#include opt_cputypes.h
 #include machine/asm.h
 
 /*
@@ -47,6 +48,26 @@
 	.global	_C_LABEL(page0), _C_LABEL(page0_data), _C_LABEL(page0_end)
 	.global _C_LABEL(fiqvector)
 
+#if defined(CPU_ARMV7) || defined(CPU_ARM11)
+	/*
+	 * ARMv[67] processors with the Security Extension have the VBAR
+	 * which redirects the low vector to any 32-byte aligned address. 
+	 * Since we are in kernel, we can just do a relative branch to the
+	 * exception code and avoid the intermediate load.
+	 */
+	.global	_C_LABEL(page0rel)
+	.p2align 5
+_C_LABEL(page0rel):
+	b	reset_entry
+	b	undefined_entry
+	b	swi_entry
+	b	prefetch_abort_entry
+	b	data_abort_entry
+	b	address_exception_entry
+	b	irq_entry
+	b	_C_LABEL(fiqvector)
+#endif
+
 _C_LABEL(page0):
 	ldr	pc, .Lreset_target
 	ldr	pc, .Lundefined_target



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

2013-06-12 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Jun 12 07:50:29 UTC 2013

Modified Files:
xsrc/external/mit/xrandr/dist: xrandr.c

Log Message:
revert revision 1.8; no longer necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/xrandr/dist/xrandr.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/xrandr/dist/xrandr.c
diff -u xsrc/external/mit/xrandr/dist/xrandr.c:1.8 xsrc/external/mit/xrandr/dist/xrandr.c:1.9
--- xsrc/external/mit/xrandr/dist/xrandr.c:1.8	Fri May 31 08:59:45 2013
+++ xsrc/external/mit/xrandr/dist/xrandr.c	Wed Jun 12 07:50:29 2013
@@ -1524,7 +1524,7 @@ crtc_set_transform (crtc_t *crtc, transf
 if (major  1 || (major == 1  minor = 3))
 	XRRSetCrtcTransform (dpy, crtc-crtc.xid,
 			 transform-transform,
-			 __UNCONST(transform-filter),
+			 transform-filter,
 			 transform-params,
 			 transform-nparams);
 }



CVS commit: xsrc/external/mit/libpciaccess/dist/src

2013-06-12 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Wed Jun 12 09:58:54 UTC 2013

Modified Files:
xsrc/external/mit/libpciaccess/dist/src: netbsd_pci.c

Log Message:
Remove trailing whitespace (reduce diff to upstream).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.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/libpciaccess/dist/src/netbsd_pci.c
diff -u xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c:1.11 xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c:1.12
--- xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c:1.11	Mon Jun  3 19:08:56 2013
+++ xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c	Wed Jun 12 09:58:54 2013
@@ -75,7 +75,7 @@ static int nbuses = 0;		/* number of bus
  * With all this we should be able to use any PCI graphics device on any PCI
  * bus on any architecture as long as Xorg has a driver, without allowing
  * arbitrary mappings via /dev/mem and without userland having to know or care
- * about translating bus addresses to physical addresses or the other way 
+ * about translating bus addresses to physical addresses or the other way
  * around.
  */
 
@@ -503,10 +503,10 @@ pci_device_netbsd_read_rom(struct pci_de
 	}
 }
 
-fprintf(stderr, Using rom_base = 0x%lx 0x%lx (pci_rom=%d)\n, 
+fprintf(stderr, Using rom_base = 0x%lx 0x%lx (pci_rom=%d)\n,
 (long)rom_base, (long)rom_size, pci_rom);
 
-bios = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, buses[dev-domain].fd, 
+bios = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, buses[dev-domain].fd,
 (off_t)rom_base);
 if (bios == MAP_FAILED) {
 	int serrno = errno;



CVS commit: xsrc/external/mit/libpciaccess/dist/src

2013-06-12 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Wed Jun 12 09:59:11 UTC 2013

Modified Files:
xsrc/external/mit/libpciaccess/dist/src: common_interface.c

Log Message:
Re-add const in correct place (reduce diff to upstream).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/libpciaccess/dist/src/common_interface.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/libpciaccess/dist/src/common_interface.c
diff -u xsrc/external/mit/libpciaccess/dist/src/common_interface.c:1.3 xsrc/external/mit/libpciaccess/dist/src/common_interface.c:1.4
--- xsrc/external/mit/libpciaccess/dist/src/common_interface.c:1.3	Sat Jun  1 09:03:25 2013
+++ xsrc/external/mit/libpciaccess/dist/src/common_interface.c	Wed Jun 12 09:59:11 2013
@@ -268,7 +268,7 @@ pci_device_map_range(struct pci_device *
 
 
 for (region = 0; region  6; region++) {
-const struct pci_mem_region * r = dev-regions[region];
+const struct pci_mem_region * const r = dev-regions[region];
 
 if (r-size != 0) {
 if ((r-base_addr = base)  ((r-base_addr + r-size)  base)) {



CVS commit: src/tests/fs/vfs

2013-06-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun 12 12:08:08 UTC 2013

Modified Files:
src/tests/fs/vfs: t_io.c

Log Message:
Fix the test for rumpfs on amd64 by adding a creation mode to open().
thanks to gson for the prod.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/vfs/t_io.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/fs/vfs/t_io.c
diff -u src/tests/fs/vfs/t_io.c:1.10 src/tests/fs/vfs/t_io.c:1.11
--- src/tests/fs/vfs/t_io.c:1.10	Tue Mar 20 18:20:49 2012
+++ src/tests/fs/vfs/t_io.c	Wed Jun 12 12:08:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_io.c,v 1.10 2012/03/20 18:20:49 njoly Exp $	*/
+/*	$NetBSD: t_io.c,v 1.11 2013/06/12 12:08:08 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -122,11 +122,11 @@ overwritebody(const atf_tc_t *tc, off_t 
 
 	REQUIRE_LIBC(buf = malloc(count), NULL);
 	FSTEST_ENTER();
-	RL(fd = rump_sys_open(testi, O_CREAT | O_RDWR));
+	RL(fd = rump_sys_open(testi, O_CREAT | O_RDWR, 0666));
 	ATF_REQUIRE_EQ(rump_sys_write(fd, buf, count), count);
 	RL(rump_sys_close(fd));
 
-	RL(fd = rump_sys_open(testi, O_CREAT | O_RDWR));
+	RL(fd = rump_sys_open(testi, O_RDWR));
 	if (dotrunc)
 		RL(rump_sys_ftruncate(fd, 0));
 	ATF_REQUIRE_EQ(rump_sys_write(fd, buf, count), count);



CVS commit: src/sys/rump/librump/rumpvfs

2013-06-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun 12 12:14:35 UTC 2013

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Make sure root creds override fs mode (at least in a root cred secmodel).
The correct way is of course for the access method to perform this:

return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(mode,
vp-v_type, attr-va_mode), vp, NULL, genfs_can_access(vp-v_type,
attr-va_mode, attr-va_uid, attr-va_gid, mode, cred));


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/rump/librump/rumpvfs/rumpfs.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/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.115 src/sys/rump/librump/rumpvfs/rumpfs.c:1.116
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.115	Mon Jun 10 14:15:03 2013
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Wed Jun 12 12:14:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.115 2013/06/10 14:15:03 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.116 2013/06/12 12:14:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rumpfs.c,v 1.115 2013/06/10 14:15:03 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rumpfs.c,v 1.116 2013/06/12 12:14:35 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -846,8 +846,9 @@ rump_check_permitted(struct vnode *vp, s
 {
 	struct vattr *attr = rnode-rn_va;
 
-	return genfs_can_access(vp-v_type, attr-va_mode, attr-va_uid,
-	attr-va_gid, mode, cred);
+	return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(mode,
+	vp-v_type, attr-va_mode), vp, NULL, genfs_can_access(vp-v_type,
+	attr-va_mode, attr-va_uid, attr-va_gid, mode, cred));
 }
 
 int



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 15:10:13 UTC 2013

Modified Files:
src/sys/arch/arm/arm: vectors.S

Log Message:
Deal with __ARM_FIQ_INDIRECT


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/arm/vectors.S

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/arm/vectors.S
diff -u src/sys/arch/arm/arm/vectors.S:1.5 src/sys/arch/arm/arm/vectors.S:1.6
--- src/sys/arch/arm/arm/vectors.S:1.5	Wed Jun 12 07:17:23 2013
+++ src/sys/arch/arm/arm/vectors.S	Wed Jun 12 15:10:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.S,v 1.5 2013/06/12 07:17:23 matt Exp $	*/
+/*	$NetBSD: vectors.S,v 1.6 2013/06/12 15:10:13 matt Exp $	*/
 
 /*
  * Copyright (C) 1994-1997 Mark Brinicombe
@@ -65,7 +65,11 @@ _C_LABEL(page0rel):
 	b	data_abort_entry
 	b	address_exception_entry
 	b	irq_entry
+#ifdef __ARM_FIQ_INDIRECT
 	b	_C_LABEL(fiqvector)
+#else
+	b	.Lfiqvector
+#endif
 #endif
 
 _C_LABEL(page0):



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

2013-06-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Jun 12 15:11:08 UTC 2013

Modified Files:
src/sys/arch/powerpc/powerpc: ofw_machdep.c

Log Message:
Fix lost avail memory over 256M.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/powerpc/ofw_machdep.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/arch/powerpc/powerpc/ofw_machdep.c
diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.23 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.24
--- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.23	Sun May 12 13:42:39 2013
+++ src/sys/arch/powerpc/powerpc/ofw_machdep.c	Wed Jun 12 15:11:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.23 2013/05/12 13:42:39 macallan Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.24 2013/06/12 15:11:08 kiyohara Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ofw_machdep.c,v 1.23 2013/05/12 13:42:39 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: ofw_machdep.c,v 1.24 2013/06/12 15:11:08 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -70,7 +70,7 @@ void
 mem_regions(struct mem_region **memp, struct mem_region **availp)
 {
 	const char *macrisc[] = {MacRISC, MacRISC2, MacRISC4, NULL};
-	int hroot, hmem, i, cnt, regcnt, acells, scells;
+	int hroot, hmem, i, cnt, memcnt, regcnt, acells, scells;
 	int numregs;
 	uint32_t regs[OFMEM_REGIONS * 4]; /* 2 values + 2 for 64bit */
 
@@ -103,7 +103,7 @@ mem_regions(struct mem_region **memp, st
 
 	/* move the data into OFmem */
 	memset(OFmem, 0, sizeof(OFmem));
-	for (i = 0, cnt = 0; i  numregs; i++) {
+	for (i = 0, memcnt = 0; i  numregs; i++) {
 		uint64_t addr, size;
 
 		if (acells  1)
@@ -129,11 +129,11 @@ mem_regions(struct mem_region **memp, st
 			continue;
 		}
 #endif
-		OFmem[cnt].start = addr;
-		OFmem[cnt].size = size;
+		OFmem[memcnt].start = addr;
+		OFmem[memcnt].size = size;
 		aprint_normal(mem region %d start=%llx size=%llx\n,
-		cnt, addr, size);
-		cnt++;
+		memcnt, addr, size);
+		memcnt++;
 	}
 
 	DPRINTF(available\n);
@@ -208,13 +208,13 @@ mem_regions(struct mem_region **memp, st
 #define AVAIL_THRESH (0x1000-1)
 		if (((OFavail[cnt-1].start + OFavail[cnt-1].size +
 		AVAIL_THRESH)  ~AVAIL_THRESH) 
-		(OFmem[regcnt-1].start + OFmem[regcnt-1].size)) {
+		(OFmem[memcnt-1].start + OFmem[memcnt-1].size)) {
 
 			OFavail[cnt].start =
 			(OFavail[cnt-1].start + OFavail[cnt-1].size +
 			AVAIL_THRESH)  ~AVAIL_THRESH;
 			OFavail[cnt].size =
-			OFmem[regcnt-1].size - OFavail[cnt].start;
+			OFmem[memcnt-1].size - OFavail[cnt].start;
 			aprint_normal(WARNING: add memory segment %lx - %lx,
 			\nWARNING: which was not recognized by 
 			the Firmware.\n,



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 17:06:52 UTC 2013

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

Log Message:
Fix VBAR inlines


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/arm/include/armreg.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.78 src/sys/arch/arm/include/armreg.h:1.79
--- src/sys/arch/arm/include/armreg.h:1.78	Wed Jun 12 05:25:58 2013
+++ src/sys/arch/arm/include/armreg.h	Wed Jun 12 17:06:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.78 2013/06/12 05:25:58 matt Exp $	*/
+/*	$NetBSD: armreg.h,v 1.79 2013/06/12 17:06:52 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -732,8 +732,8 @@ ARMREG_WRITE_INLINE(contextidr, p15,0,%
 ARMREG_READ_INLINE(tpidrprw, p15,0,%0,c13,c0,4) /* PL1 only Thread ID Register */
 ARMREG_WRITE_INLINE(tpidrprw, p15,0,%0,c13,c0,4) /* PL1 only Thread ID Register */
 /* cp14 c12 registers */
-ARMREG_READ_INLINE(vbar, p15,4,%0,c12,c0,0)	/* Vector Base Address Register */
-ARMREG_WRITE_INLINE(vbar, p15,4,%0,c12,c0,0)	/* Vector Base Address Register */
+ARMREG_READ_INLINE(vbar, p15,0,%0,c12,c0,0)	/* Vector Base Address Register */
+ARMREG_WRITE_INLINE(vbar, p15,0,%0,c12,c0,0)	/* Vector Base Address Register */
 /* cp15 c14 registers */
 /* cp15 Global Timer Registers */
 ARMREG_READ_INLINE(cntfrq, p15,0,%0,c14,c0,0) /* Counter Frequency Register */



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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 17:13:05 UTC 2013

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c arm32_machdep.c

Log Message:
Add support for the VBAR (vector base address register) to remap the vectors
into the kernel text segment.  This register is available on arm1176 and
all cortex processors since they all have the arm security (trustzone)
extension.  We avoid having to specially map either vector page (0x
or 0x) and use VBAR to both to page0rel in the text segment.  These
vector group differs from the normal page0, that since it's in the kernel,
it can branch directly to the exception routine, instead of loading the
address into the PC.  This should result in a tiny improvement in speed since
we eliminate a TLB mapping the vector page and a load on every exception.

XXX Add __HAVE_ARM_TRUSTZONE cpp define and use that to eliminate all code
have to do with manipulating the vector page.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/arm32/arm32_kvminit.c
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/arm/arm32/arm32_machdep.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/arch/arm/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.18 src/sys/arch/arm/arm32/arm32_kvminit.c:1.19
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.18	Wed Feb 27 22:15:46 2013
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed Jun 12 17:13:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.18 2013/02/27 22:15:46 matt Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.19 2013/06/12 17:13:05 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.18 2013/02/27 22:15:46 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.19 2013/06/12 17:13:05 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -372,6 +372,12 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 #else
 	const size_t cpu_num = 1;
 #endif
+#if defined(CPU_ARMV7) || defined(CPU_ARM11)
+	const bool map_vectors_p = vectors == ARM_VECTORS_LOW
+	 !(armreg_pfr1_read()  ARM_PFR1_SEC_MASK);
+#else
+	const bool map_vectors_p = true;
+#endif
 
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 	KASSERT(mapallmem_p);
@@ -448,15 +454,18 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	 * allocate the L2 page.
 	 */
 
-	/*
-	 * First allocate L2 page for the vectors.
-	 */
+	if (map_vectors_p) {
+		/*
+		 * First allocate L2 page for the vectors.
+		 */
 #ifdef VERBOSE_INIT_ARM
-	printf( vector);
+		printf( vector);
 #endif
-	valloc_pages(bmi, bmi-bmi_vector_l2pt, L2_TABLE_SIZE / PAGE_SIZE,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE, true);
-	add_pages(bmi, bmi-bmi_vector_l2pt);
+		valloc_pages(bmi, bmi-bmi_vector_l2pt,
+		L2_TABLE_SIZE / PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE,
+		PTE_PAGETABLE, true);
+		add_pages(bmi, bmi-bmi_vector_l2pt);
+	}
 
 	/*
 	 * Now allocate L2 pages for the kernel
@@ -525,13 +534,15 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	add_pages(bmi, msgbuf);
 	msgbufphys = msgbuf.pv_pa;
 
-	/*
-	 * Allocate a page for the system vector page.
-	 * This page will just contain the system vectors and can be
-	 * shared by all processes.
-	 */
-	valloc_pages(bmi, systempage, 1, VM_PROT_READ|VM_PROT_WRITE,
-	PTE_CACHE, true);
+	if (map_vectors_p) {
+		/*
+		 * Allocate a page for the system vector page.
+		 * This page will just contain the system vectors and can be
+		 * shared by all processes.
+		 */
+		valloc_pages(bmi, systempage, 1, VM_PROT_READ|VM_PROT_WRITE,
+		PTE_CACHE, true);
+	}
 	systempage.pv_va = vectors;
 
 	/*
@@ -568,14 +579,17 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	vaddr_t l1pt_va = kernel_l1pt.pv_va;
 	paddr_t l1pt_pa = kernel_l1pt.pv_pa;
 
-	/* Map the L2 pages tables in the L1 page table */
-	pmap_link_l2pt(l1pt_va, systempage.pv_va  -L2_S_SEGSIZE,
-	bmi-bmi_vector_l2pt);
-#ifdef VERBOSE_INIT_ARM
-	printf(%s: adding L2 pt (VA %#lx, PA %#lx) for VA %#lx\n (vectors),
-	__func__, bmi-bmi_vector_l2pt.pv_va, bmi-bmi_vector_l2pt.pv_pa,
-	systempage.pv_va);
+	if (map_vectors_p) {
+		/* Map the L2 pages tables in the L1 page table */
+		pmap_link_l2pt(l1pt_va, systempage.pv_va  -L2_S_SEGSIZE,
+		bmi-bmi_vector_l2pt);
+#ifdef VERBOSE_INIT_ARM
+		printf(%s: adding L2 pt (VA %#lx, PA %#lx) 
+		for VA %#lx\n (vectors),
+		__func__, bmi-bmi_vector_l2pt.pv_va,
+		bmi-bmi_vector_l2pt.pv_pa, systempage.pv_va);
 #endif
+	}
 
 	const vaddr_t kernel_base =
 	KERN_PHYSTOV(bmi, bmi-bmi_kernelstart  -L2_S_SEGSIZE);
@@ -772,9 +786,11 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	 * Now we map the stuff that isn't directly after the kernel
 	 */
 
-	/* Map the vector page. */
-	pmap_map_entry(l1pt_va, systempage.pv_va, systempage.pv_pa,
-	

CVS commit: src/sys/arch/evbarm/beagle

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 20:36:53 UTC 2013

Modified Files:
src/sys/arch/evbarm/beagle: beagle_machdep.c

Log Message:
Now that VBAR support is present, switch to ARM_VECTORS_LOW.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/beagle/beagle_machdep.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/arch/evbarm/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.43 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.44
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.43	Tue Jun 11 22:59:54 2013
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Wed Jun 12 20:36:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.43 2013/06/11 22:59:54 matt Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.44 2013/06/12 20:36:53 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: beagle_machdep.c,v 1.43 2013/06/11 22:59:54 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: beagle_machdep.c,v 1.44 2013/06/12 20:36:53 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -499,10 +499,11 @@ initarm(void *arg)
 #else
 	const bool mapallmem_p = false;
 #endif
+	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 
 	arm32_bootmem_init(bootconfig.dram[0].address, ram_size,
 	KERNEL_BASE_PHYS);
-	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
+	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, devmap,
 	mapallmem_p);
 
 	/* bootargs env variable is passed as 4th argument to kernel */



CVS commit: src/sys/arch/sparc/dev

2013-06-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 12 20:43:22 UTC 2013

Modified Files:
src/sys/arch/sparc/dev: sxreg.h

Log Message:
document arithmetics instructions


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc/dev/sxreg.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/sparc/dev/sxreg.h
diff -u src/sys/arch/sparc/dev/sxreg.h:1.8 src/sys/arch/sparc/dev/sxreg.h:1.9
--- src/sys/arch/sparc/dev/sxreg.h:1.8	Wed Jun 12 04:23:46 2013
+++ src/sys/arch/sparc/dev/sxreg.h	Wed Jun 12 20:43:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sxreg.h,v 1.8 2013/06/12 04:23:46 macallan Exp $	*/
+/*	$NetBSD: sxreg.h,v 1.9 2013/06/12 20:43:21 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -253,14 +253,15 @@
 		((sa)  14) | ((d)  7) | (sb))
 
 /* arithmetic group */
-#define SX_ADD_V	(0x00  21)
-#define SX_ADD_S	(0x01  21)
-#define SX_ADD_I	(0x02  21)
-#define SX_SUM		(0x03  21)
-#define SX_SUB_V	(0x04  21)
-#define SX_SUB_S	(0x05  21)
-#define SX_SUB_I	(0x06  21)
-#define SX_ABS		(0x07  21)
+#define SX_ADD_V	(0x00  21)	/* vector + vector */
+#define SX_ADD_S	(0x01  21)	/* vector + scalar */
+#define SX_ADD_I	(0x02  21)	/* vector + immediate */
+#define SX_SUM		(0x03  21)	/* sum of vector and scalar */
+#define SX_SUB_V	(0x04  21)	/* vector - veector */
+#define SX_SUB_S	(0x05  21)	/* vector - scalar */
+#define SX_SUB_I	(0x06  21)	/* vector - immediate */
+#define SX_ABS		(0x07  21)	/* abs(sb) with sa=R0 */
+/* hardware does sa - sb for sb  0 and sa + sb if sb  0 */
 
 #define SX_ADDV(sa, sb, d, cnt) (0xa000 | ((cnt)  24) | SX_ADD_V | \
 		((sa)  14) | ((d)  7) | (sb))



CVS commit: src/sys/arch/sparc/dev

2013-06-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 12 20:44:20 UTC 2013

Modified Files:
src/sys/arch/sparc/dev: sxreg.h

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/dev/sxreg.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/sparc/dev/sxreg.h
diff -u src/sys/arch/sparc/dev/sxreg.h:1.9 src/sys/arch/sparc/dev/sxreg.h:1.10
--- src/sys/arch/sparc/dev/sxreg.h:1.9	Wed Jun 12 20:43:21 2013
+++ src/sys/arch/sparc/dev/sxreg.h	Wed Jun 12 20:44:20 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sxreg.h,v 1.9 2013/06/12 20:43:21 macallan Exp $	*/
+/*	$NetBSD: sxreg.h,v 1.10 2013/06/12 20:44:20 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -257,7 +257,7 @@
 #define SX_ADD_S	(0x01  21)	/* vector + scalar */
 #define SX_ADD_I	(0x02  21)	/* vector + immediate */
 #define SX_SUM		(0x03  21)	/* sum of vector and scalar */
-#define SX_SUB_V	(0x04  21)	/* vector - veector */
+#define SX_SUB_V	(0x04  21)	/* vector - vector */
 #define SX_SUB_S	(0x05  21)	/* vector - scalar */
 #define SX_SUB_I	(0x06  21)	/* vector - immediate */
 #define SX_ABS		(0x07  21)	/* abs(sb) with sa=R0 */



CVS commit: src/sys/arch/arm

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 21:34:12 UTC 2013

Modified Files:
src/sys/arch/arm/arm: fiq.c vectors.S
src/sys/arch/arm/arm32: arm32_kvminit.c arm32_machdep.c pmap.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add a ARM_HAS_VBAR option which forces the use of the VBAR register.  This
allows much code to deal with vector_page mappings to be eliminated.  On a
BEAGLEBONE kernel, this saves 8KB of text and instructions that never have
to be executed.  (The PJ4B has VBAR but doesn't implement the security
extensions it is part of so a method was needed to allow it use VBAR with
relying on the default test for the security extensions.)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/arm/fiq.c \
src/sys/arch/arm/arm/vectors.S
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/arm32/arm32_kvminit.c
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.256 -r1.257 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/arm/include/arm32/pmap.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/arm/fiq.c
diff -u src/sys/arch/arm/arm/fiq.c:1.6 src/sys/arch/arm/arm/fiq.c:1.7
--- src/sys/arch/arm/arm/fiq.c:1.6	Wed Nov 19 06:29:48 2008
+++ src/sys/arch/arm/arm/fiq.c	Wed Jun 12 21:34:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fiq.c,v 1.6 2008/11/19 06:29:48 matt Exp $	*/
+/*	$NetBSD: fiq.c,v 1.7 2013/06/12 21:34:12 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fiq.c,v 1.6 2008/11/19 06:29:48 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: fiq.c,v 1.7 2013/06/12 21:34:12 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -62,6 +62,7 @@ extern char fiq_nullhandler[], fiq_nullh
 #define	FIQ_BIT		R15_FIQ_DISABLE
 #endif /* __PROG32 */
 
+#ifndef ARM_HAS_VBAR
 /*
  * fiq_installhandler:
  *
@@ -176,3 +177,4 @@ fiq_release(struct fiqhandler *fh)
 	oldirqstate = ~FIQ_BIT;
 	restore_interrupts(oldirqstate);
 }
+#endif /* !ARM_HAS_VBAR */
Index: src/sys/arch/arm/arm/vectors.S
diff -u src/sys/arch/arm/arm/vectors.S:1.6 src/sys/arch/arm/arm/vectors.S:1.7
--- src/sys/arch/arm/arm/vectors.S:1.6	Wed Jun 12 15:10:13 2013
+++ src/sys/arch/arm/arm/vectors.S	Wed Jun 12 21:34:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.S,v 1.6 2013/06/12 15:10:13 matt Exp $	*/
+/*	$NetBSD: vectors.S,v 1.7 2013/06/12 21:34:12 matt Exp $	*/
 
 /*
  * Copyright (C) 1994-1997 Mark Brinicombe
@@ -33,6 +33,7 @@
 
 #include assym.h
 #include opt_cputypes.h
+#include opt_cpuoptions.h
 #include machine/asm.h
 
 /*
@@ -44,11 +45,9 @@
  */
 
 	.text
-	.align	0
-	.global	_C_LABEL(page0), _C_LABEL(page0_data), _C_LABEL(page0_end)
 	.global _C_LABEL(fiqvector)
 
-#if defined(CPU_ARMV7) || defined(CPU_ARM11)
+#if defined(CPU_ARMV7) || defined(CPU_ARM11) || defined(ARM_HAS_VBAR)
 	/*
 	 * ARMv[67] processors with the Security Extension have the VBAR
 	 * which redirects the low vector to any 32-byte aligned address. 
@@ -67,11 +66,14 @@ _C_LABEL(page0rel):
 	b	irq_entry
 #ifdef __ARM_FIQ_INDIRECT
 	b	_C_LABEL(fiqvector)
-#else
+#elif !defined(ARM_HAS_VBAR)
 	b	.Lfiqvector
 #endif
-#endif
+#endif /* CPU_ARMV7 || CPU_ARM11 || ARM_HAS_VBAR */
 
+#ifndef ARM_HAS_VBAR
+	.global	_C_LABEL(page0), _C_LABEL(page0_data), _C_LABEL(page0_end)
+	.align	0
 _C_LABEL(page0):
 	ldr	pc, .Lreset_target
 	ldr	pc, .Lundefined_target
@@ -82,13 +84,20 @@ _C_LABEL(page0):
 	ldr	pc, .Lirq_target
 #ifdef __ARM_FIQ_INDIRECT
 	ldr	pc, .Lfiq_target
-#else
+#endif
+#endif /* !ARM_HAS_VBAR */
+#ifndef __ARM_FIQ_INDIRECT
 .Lfiqvector:
+#ifdef ARM_HAS_VBAR
+	.set	_C_LABEL(fiqvector), . - _C_LABEL(page0rel)
+#else
 	.set	_C_LABEL(fiqvector), . - _C_LABEL(page0)
+#endif
 	subs	pc, lr, #4
 	.org	.Lfiqvector + 0x100
 #endif
 
+#ifndef ARM_HAS_VBAR
 _C_LABEL(page0_data):
 .Lreset_target:
 	.word	reset_entry
@@ -118,6 +127,7 @@ _C_LABEL(page0_data):
 	.word	0	/* pad it out */
 #endif
 _C_LABEL(page0_end):
+#endif /* ARM_HAS_VBAR */
 
 #ifdef __ARM_FIQ_INDIRECT
 	.data

Index: src/sys/arch/arm/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.19 src/sys/arch/arm/arm32/arm32_kvminit.c:1.20
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.19	Wed Jun 12 17:13:05 2013
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed Jun 12 21:34:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.19 2013/06/12 17:13:05 matt Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.20 2013/06/12 21:34:12 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.19 2013/06/12 17:13:05 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.20 

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

2013-06-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 12 21:35:22 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf: std.beagle

Log Message:
add ARM_HAS_VBAR option


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.beagle

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/evbarm/conf/std.beagle
diff -u src/sys/arch/evbarm/conf/std.beagle:1.9 src/sys/arch/evbarm/conf/std.beagle:1.10
--- src/sys/arch/evbarm/conf/std.beagle:1.9	Sun Dec 16 23:47:56 2012
+++ src/sys/arch/evbarm/conf/std.beagle	Wed Jun 12 21:35:22 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: std.beagle,v 1.9 2012/12/16 23:47:56 matt Exp $
+#	$NetBSD: std.beagle,v 1.10 2013/06/12 21:35:22 matt Exp $
 #
 # standard NetBSD/evbarm for BEAGLEBOARD options
 
@@ -12,6 +12,7 @@ include		arch/evbarm/conf/files.beagle
 options 	__HAVE_CPU_COUNTER
 options 	CORTEX_PMC
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
+options 	ARM_HAS_VBAR
 options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 options 	TPIDRPRW_IS_CURCPU
 options 	KERNEL_BASE_EXT=0x8000



CVS commit: src

2013-06-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 12 21:35:30 UTC 2013

Modified Files:
src/distrib/sets: mkvars.mk sets.subr
src/distrib/sets/lists/xcomp: mi
src/external/mit/xorg/server: Makefile
src/external/mit/xorg/server/xorg-server: Makefile Makefile.common
src/share/mk: bsd.own.mk

Log Message:
rename (new) xorg_drivers to xorg_server -- platforms that build the
actual Xorg server (aka xfree86 server).

move the list of these platforms from xorg-server/Makefile.common to
bsd.own.mk, so that we can access it easily in distrib.

this should fix most of the current build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/mkvars.mk
cvs rdiff -u -r1.150 -r1.151 src/distrib/sets/sets.subr
cvs rdiff -u -r1.142 -r1.143 src/distrib/sets/lists/xcomp/mi
cvs rdiff -u -r1.7 -r1.8 src/external/mit/xorg/server/Makefile
cvs rdiff -u -r1.19 -r1.20 src/external/mit/xorg/server/xorg-server/Makefile
cvs rdiff -u -r1.25 -r1.26 \
src/external/mit/xorg/server/xorg-server/Makefile.common
cvs rdiff -u -r1.733 -r1.734 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/distrib/sets/mkvars.mk
diff -u src/distrib/sets/mkvars.mk:1.11 src/distrib/sets/mkvars.mk:1.12
--- src/distrib/sets/mkvars.mk:1.11	Mon Jun 10 05:04:00 2013
+++ src/distrib/sets/mkvars.mk	Wed Jun 12 21:35:29 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mkvars.mk,v 1.11 2013/06/10 05:04:00 mrg Exp $
+# $NetBSD: mkvars.mk,v 1.12 2013/06/12 21:35:29 mrg Exp $
 
 MKEXTRAVARS= \
 	MACHINE \
@@ -19,7 +19,7 @@ MKEXTRAVARS= \
 	MKSLJIT \
 	MKSOFTFLOAT \
 	MKXORG \
-	MKXORG_DRIVERS \
+	MKXORG_SERVER \
 	X11FLAVOR \
 	USE_INET6 \
 	USE_KERBEROS \

Index: src/distrib/sets/sets.subr
diff -u src/distrib/sets/sets.subr:1.150 src/distrib/sets/sets.subr:1.151
--- src/distrib/sets/sets.subr:1.150	Mon Jun 10 05:04:00 2013
+++ src/distrib/sets/sets.subr	Wed Jun 12 21:35:29 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.150 2013/06/10 05:04:00 mrg Exp $
+#	$NetBSD: sets.subr,v 1.151 2013/06/12 21:35:29 mrg Exp $
 #
 
 #
@@ -179,7 +179,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.150 2013/06/10 05:04:00 mrg Exp $
+# 	# $NetBSD: sets.subr,v 1.151 2013/06/12 21:35:29 mrg Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -257,7 +257,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 #	tpm			${MKTPM} != no
 #	x11			${MKX11} != no  ${X11FLAVOUR} != Xorg
 #	xorg			${MKX11} != no  ${X11FLAVOUR} == Xorg
-#	xorg_drivers		${MKXORG_DRIVERS} != no
+#	xorg_server		${MKXORG_SERVER} != no
 #	yp			${MKYP} != no
 #	zfs			${MKZFS} != no
 #

Index: src/distrib/sets/lists/xcomp/mi
diff -u src/distrib/sets/lists/xcomp/mi:1.142 src/distrib/sets/lists/xcomp/mi:1.143
--- src/distrib/sets/lists/xcomp/mi:1.142	Mon Jun 10 05:04:00 2013
+++ src/distrib/sets/lists/xcomp/mi	Wed Jun 12 21:35:30 2013
@@ -1,4 +1,4 @@
-#	 $NetBSD: mi,v 1.142 2013/06/10 05:04:00 mrg Exp $
+#	 $NetBSD: mi,v 1.143 2013/06/12 21:35:30 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -5934,7 +5934,7 @@
 ./usr/X11R7/include/xorg/xaarop.h			-unknown-	xorg
 ./usr/X11R7/include/xorg/xf1bpp.h			-unknown-	obsolete
 ./usr/X11R7/include/xorg/xf4bpp.h			-unknown-	obsolete
-./usr/X11R7/include/xorg/xf86-mouse-properties.h	-unknown-	xorg,xorg_drivers
+./usr/X11R7/include/xorg/xf86-mouse-properties.h	-unknown-	xorg,xorg_server
 ./usr/X11R7/include/xorg/xf86.h-unknown-	xorg
 ./usr/X11R7/include/xorg/xf86Crtc.h			-unknown-	xorg
 ./usr/X11R7/include/xorg/xf86Cursor.h			-unknown-	xorg
@@ -6371,7 +6371,7 @@
 ./usr/X11R7/lib/pkgconfig/xkeyboard-config.pc		-unknown-	xorg
 ./usr/X11R7/lib/pkgconfig/xmu.pc			-unknown-	xorg
 ./usr/X11R7/lib/pkgconfig/xmuu.pc			-unknown-	xorg
-./usr/X11R7/lib/pkgconfig/xorg-mouse.pc			-unknown-	xorg,xorg_drivers
+./usr/X11R7/lib/pkgconfig/xorg-mouse.pc			-unknown-	xorg,xorg_server
 ./usr/X11R7/lib/pkgconfig/xorg-server.pc		-unknown-	xorg
 ./usr/X11R7/lib/pkgconfig/xp.pc-obsolete-	obsolete
 ./usr/X11R7/lib/pkgconfig/xpm.pc			-unknown-	xorg

Index: src/external/mit/xorg/server/Makefile
diff -u src/external/mit/xorg/server/Makefile:1.7 src/external/mit/xorg/server/Makefile:1.8
--- src/external/mit/xorg/server/Makefile:1.7	Mon Jun 10 05:01:44 2013
+++ src/external/mit/xorg/server/Makefile	Wed Jun 12 21:35:29 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2013/06/10 05:01:44 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2013/06/12 21:35:29 mrg Exp $
 
 # Makefile for modular-xorg-server and drivers
 
@@ -7,7 +7,10 @@
 .include xorg-server/Makefile.common
 
 SUBDIR=	xorg-server
-.if ${MKXORG_DRIVERS} != no
+
+# We only make drivers if we make the actual Xorg server,
+# as opposed to Xvfb and Xnest.
+.if 

CVS commit: src/sys

2013-06-12 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Thu Jun 13 00:55:01 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_rng.c
src/sys/dev: rndpseudo.c
src/sys/dev/pci: amdpm.c amdpm_smbus.c amdpmvar.h hifn7751.c
hifn7751var.h ubsec.c ubsecvar.h
src/sys/dev/scsipi: sd.c
src/sys/kern: kern_rndpool.c kern_rndq.c subr_cprng.c
src/sys/sys: rnd.h

Log Message:
Convert the entropy pool framework from pseudo-callout-driven to
soft interrupt driven operation.

Add a polling mode of operation -- now we can ask hardware random number
generators to top us up just when we need it (bcm2835_rng and amdpm
converted as examples).

Fix a stall noticed with repeated reads from /dev/random while testing.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_rng.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/rndpseudo.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/amdpm.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/amdpm_smbus.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/amdpmvar.h \
src/sys/dev/pci/hifn7751var.h
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/hifn7751.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/ubsec.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ubsecvar.h
cvs rdiff -u -r1.300 -r1.301 src/sys/dev/scsipi/sd.c
cvs rdiff -u -r1.2 -r1.3 src/sys/kern/kern_rndpool.c
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/subr_cprng.c
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/rnd.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/broadcom/bcm2835_rng.c
diff -u src/sys/arch/arm/broadcom/bcm2835_rng.c:1.3 src/sys/arch/arm/broadcom/bcm2835_rng.c:1.4
--- src/sys/arch/arm/broadcom/bcm2835_rng.c:1.3	Fri Feb  1 16:10:16 2013
+++ src/sys/arch/arm/broadcom/bcm2835_rng.c	Thu Jun 13 00:55:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_rng.c,v 1.3 2013/02/01 16:10:16 skrll Exp $ */
+/*	$NetBSD: bcm2835_rng.c,v 1.4 2013/06/13 00:55:01 tls Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_rng.c,v 1.3 2013/02/01 16:10:16 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_rng.c,v 1.4 2013/06/13 00:55:01 tls Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, $NetBSD: bcm2835_rng.
 #include sys/kernel.h
 #include sys/bus.h
 #include sys/rnd.h
+#include sys/atomic.h
 
 #include arm/broadcom/bcm_amba.h
 #include arm/broadcom/bcm2835reg.h
@@ -59,16 +60,16 @@ struct bcm2835rng_softc {
 	bus_space_handle_t sc_ioh;
 
 	krndsource_t sc_rnd;
-	callout_t sc_tick;
+
+	kmutex_t sc_mutex;
 
 	uint32_t sc_data[RNG_DATA_MAX];
 };
 
+static void bcmrng_get(size_t, void *);
 static int bcmrng_match(device_t, cfdata_t, void *);
 static void bcmrng_attach(device_t, device_t, void *);
 
-static void bcmrng_tick(void *);
-
 CFATTACH_DECL_NEW(bcmrng_amba, sizeof(struct bcm2835rng_softc),
 bcmrng_match, bcmrng_attach, NULL, NULL);
 
@@ -103,11 +104,11 @@ bcmrng_attach(device_t parent, device_t 
 		return;
 	}
 
-	rnd_attach_source(sc-sc_rnd, device_xname(self), RND_TYPE_RNG,
-	RND_FLAG_NO_ESTIMATE);
+	mutex_init(sc-sc_mutex, MUTEX_DEFAULT, IPL_VM);
 
-	callout_init(sc-sc_tick, CALLOUT_MPSAFE);
-	callout_setfunc(sc-sc_tick, bcmrng_tick, sc);
+	rndsource_setcb(sc-sc_rnd, bcmrng_get, sc);
+	rnd_attach_source(sc-sc_rnd, device_xname(self), RND_TYPE_RNG,
+	RND_FLAG_NO_ESTIMATE|RND_FLAG_HASCB);
 
 	/* discard initial numbers, broadcom says they are less random */
 	bus_space_write_4(sc-sc_iot, sc-sc_ioh, RNG_STATUS, 0x4);
@@ -116,26 +117,34 @@ bcmrng_attach(device_t parent, device_t 
 	ctrl = bus_space_read_4(sc-sc_iot, sc-sc_ioh, RNG_CTRL);
 	ctrl |= RNG_CTRL_EN;
 	bus_space_write_4(sc-sc_iot, sc-sc_ioh, RNG_CTRL, ctrl);
-
-	/* start timer */
-	bcmrng_tick(sc);
 }
 
 static void
-bcmrng_tick(void *priv)
+bcmrng_get(size_t bytes, void *priv)
 {
-	struct bcm2835rng_softc *sc = priv;
+struct bcm2835rng_softc *sc = priv;
 	uint32_t status;
-	int cnt;
+	int need = bytes, cnt;
 
-	status = bus_space_read_4(sc-sc_iot, sc-sc_ioh, RNG_STATUS);
-	cnt = (status  RNG_STATUS_CNT_MASK)  RNG_STATUS_CNT_SHIFT;
-	if (cnt  0) {
-		bus_space_read_multi_4(sc-sc_iot, sc-sc_ioh, RNG_DATA,
-		sc-sc_data, cnt);
-		rnd_add_data(sc-sc_rnd, sc-sc_data,
-		cnt * 4, cnt * 4 * NBBY);
+mutex_spin_enter(sc-sc_mutex);
+
+printf(bcmrng: asked for %d bytes, (int)bytes);
+
+	if (__predict_false(need  1)) {
+		return;
 	}
 
-	callout_schedule(sc-sc_tick, 1);
+	while (need  0) {
+		status = bus_space_read_4(sc-sc_iot, sc-sc_ioh, RNG_STATUS);
+		cnt = (status  RNG_STATUS_CNT_MASK)  RNG_STATUS_CNT_SHIFT;
+		if (cnt  0) {
+			bus_space_read_multi_4(sc-sc_iot, sc-sc_ioh,
+	   RNG_DATA, sc-sc_data, cnt);
+			rnd_add_data(sc-sc_rnd, sc-sc_data,
+				 cnt * 4, cnt * 4 

CVS commit: src/sys/kern

2013-06-12 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Thu Jun 13 01:37:03 UTC 2013

Modified Files:
src/sys/kern: kern_rndq.c

Log Message:
Correct misunderstanding in previous: a mutex is not required to protect
the soft interrupt dispatches.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.11 src/sys/kern/kern_rndq.c:1.12
--- src/sys/kern/kern_rndq.c:1.11	Thu Jun 13 00:55:01 2013
+++ src/sys/kern/kern_rndq.c	Thu Jun 13 01:37:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.11 2013/06/13 00:55:01 tls Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.11 2013/06/13 00:55:01 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $);
 
 #include sys/param.h
 #include sys/ioctl.h
@@ -104,11 +104,6 @@ SIMPLEQ_HEAD(, _rnd_sample_t)	rnd_sample
 kmutex_t			rnd_mtx;
 
 /*
- * This lock protects dispatch of our soft interrupts.
- */
-kmutex_t			rndsoft_mtx;
-
-/*
  * Entropy sinks: usually other generators waiting to be rekeyed.
  *
  * A sink's callback MUST NOT re-add the sink to the list, or
@@ -207,9 +202,9 @@ rnd_counter(void)
 static inline void
 rnd_schedule_softint(void *softint)
 {
-	mutex_spin_enter(rndsoft_mtx);
+	kpreempt_disable();
 	softint_schedule(softint);
-	mutex_spin_exit(rndsoft_mtx);
+	kpreempt_enable();
 }
 
 /*
@@ -453,7 +448,6 @@ rnd_init(void)
 
 	mutex_init(rnd_mtx, MUTEX_DEFAULT, IPL_VM);
 	mutex_init(rndsink_mtx, MUTEX_DEFAULT, IPL_VM);
-	mutex_init(rndsoft_mtx, MUTEX_DEFAULT, IPL_VM);
 
 	/*
 	 * take a counter early, hoping that there's some variance in