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

2014-11-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Nov  8 08:01:34 UTC 2014

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

Log Message:
When allocing a l1page, if a page isn't available, use uvm_wait to wait
for one to become available.  Should fix PR/49364.


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 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.311 src/sys/arch/arm/arm32/pmap.c:1.312
--- src/sys/arch/arm/arm32/pmap.c:1.311	Fri Nov  7 12:44:58 2014
+++ src/sys/arch/arm/arm32/pmap.c	Sat Nov  8 08:01:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.311 2014/11/07 12:44:58 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.312 2014/11/08 08:01:34 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -215,7 +215,7 @@
 
 #include arm/locore.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.311 2014/11/07 12:44:58 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.312 2014/11/08 08:01:34 matt Exp $);
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -1282,13 +1282,18 @@ pmap_alloc_l1(pmap_t pm)
 {
 #ifdef ARM_MMU_EXTENDED
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+	struct vm_page *pg;
+	bool ok __diagused;
+	for (;;) {
 #ifdef PMAP_NEED_ALLOC_POOLPAGE
-	struct vm_page *pg = arm_pmap_alloc_poolpage(UVM_PGA_ZERO);
+		pg = arm_pmap_alloc_poolpage(UVM_PGA_ZERO);
 #else
-	struct vm_page *pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO);
+		pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO);
 #endif
-	bool ok __diagused;
-	KASSERT(pg != NULL);
+		if (pg != NULL)
+			break;
+		uvm_wait(pmapl1alloc);
+	}
 	pm-pm_l1_pa = VM_PAGE_TO_PHYS(pg);
 	vaddr_t va = pmap_direct_mapped_phys(pm-pm_l1_pa, ok, 0);
 	KASSERT(ok);



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

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 08:08:32 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf: RPI std.rpi

Log Message:
Move some options into std.rpi


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbarm/conf/RPI
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/std.rpi

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/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.58 src/sys/arch/evbarm/conf/RPI:1.59
--- src/sys/arch/evbarm/conf/RPI:1.58	Sun Oct 12 12:01:50 2014
+++ src/sys/arch/evbarm/conf/RPI	Sat Nov  8 08:08:32 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.58 2014/10/12 12:01:50 macallan Exp $
+#	$NetBSD: RPI,v 1.59 2014/11/08 08:08:32 skrll Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -17,10 +17,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 
 # CPU options
 
-options 	CPU_ARM1176
-options 	BCM2835
 options 	PMAPCOUNTERS
-options 	FPU_VFP
 
 # Architecture options
 

Index: src/sys/arch/evbarm/conf/std.rpi
diff -u src/sys/arch/evbarm/conf/std.rpi:1.15 src/sys/arch/evbarm/conf/std.rpi:1.16
--- src/sys/arch/evbarm/conf/std.rpi:1.15	Sun Aug 24 07:59:22 2014
+++ src/sys/arch/evbarm/conf/std.rpi	Sat Nov  8 08:08:32 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: std.rpi,v 1.15 2014/08/24 07:59:22 jnemeth Exp $
+#	$NetBSD: std.rpi,v 1.16 2014/11/08 08:08:32 skrll Exp $
 #
 # standard NetBSD/evbarm for Raspberry Pi options
 
@@ -10,6 +10,9 @@ include		arch/evbarm/conf/files.rpi
 
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
+options 	CPU_ARM1176
+options 	BCM2835
+options 	FPU_VFP
 options 	ARM11_COMPAT_MMU
 options 	__HAVE_CPU_COUNTER
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h



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

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 08:10:13 UTC 2014

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

Log Message:
Add __HAVE_MM_MD_CACHE_ALIASING


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/std.rpi

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.rpi
diff -u src/sys/arch/evbarm/conf/std.rpi:1.16 src/sys/arch/evbarm/conf/std.rpi:1.17
--- src/sys/arch/evbarm/conf/std.rpi:1.16	Sat Nov  8 08:08:32 2014
+++ src/sys/arch/evbarm/conf/std.rpi	Sat Nov  8 08:10:13 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: std.rpi,v 1.16 2014/11/08 08:08:32 skrll Exp $
+#	$NetBSD: std.rpi,v 1.17 2014/11/08 08:10:13 skrll Exp $
 #
 # standard NetBSD/evbarm for Raspberry Pi options
 
@@ -18,6 +18,7 @@ options 	__HAVE_CPU_COUNTER
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
+options 	__HAVE_MM_MD_CACHE_ALIASING
 options 	TPIDRPRW_IS_CURCPU
 options 	ARM_HAS_VBAR
 options 	KERNEL_BASE_EXT=0xc000



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

2014-11-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov  8 11:28:52 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_reg.h

Log Message:
add some more A31 soft reset bits


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/allwinner/awin_reg.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/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.44 src/sys/arch/arm/allwinner/awin_reg.h:1.45
--- src/sys/arch/arm/allwinner/awin_reg.h:1.44	Sat Nov  8 00:31:54 2014
+++ src/sys/arch/arm/allwinner/awin_reg.h	Sat Nov  8 11:28:52 2014
@@ -1888,7 +1888,21 @@ struct awin_mmc_idma_descriptor {
 #define AWIN_A31_AHB_RESET0_SS_RST		__BIT(5)
 #define AWIN_A31_AHB_RESET0_MIPIDSI_RST		__BIT(1)
 
+#define AWIN_A31_AHB_RESET1_DRC1_RST		__BIT(26)
+#define AWIN_A31_AHB_RESET1_DRC0_RST		__BIT(25)
+#define AWIN_A31_AHB_RESET1_DEU1_RST		__BIT(24)
+#define AWIN_A31_AHB_RESET1_DEU0_RST		__BIT(23)
+#define AWIN_A31_AHB_RESET1_GPU_RST		__BIT(20)
+#define AWIN_A31_AHB_RESET1_MP_RST		__BIT(18)
+#define AWIN_A31_AHB_RESET1_FE1_RST		__BIT(15)
+#define AWIN_A31_AHB_RESET1_FE0_RST		__BIT(14)
+#define AWIN_A31_AHB_RESET1_BE1_RST		__BIT(13)
+#define AWIN_A31_AHB_RESET1_BE0_RST		__BIT(12)
 #define AWIN_A31_AHB_RESET1_HDMI_RST		__BIT(11)
+#define AWIN_A31_AHB_RESET1_CSI_RST		__BIT(8)
+#define AWIN_A31_AHB_RESET1_LCD1_RST		__BIT(5)
+#define AWIN_A31_AHB_RESET1_LCD0_RST		__BIT(4)
+#define AWIN_A31_AHB_RESET1_VE_RST		__BIT(0)
 
 #define AWIN_A31_APB1_RESET_DAUDIO1_RST		__BIT(13)
 #define AWIN_A31_APB1_RESET_DAUDIO0_RST		__BIT(12)



CVS commit: [netbsd-5] src/distrib

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Nov  8 11:35:46 UTC 2014

Modified Files:
src/distrib/alpha/cdroms/installcd [netbsd-5]: Makefile
src/distrib/pmax/cdroms/installcd [netbsd-5]: Makefile
src/distrib/prep/cdroms/installcd [netbsd-5]: Makefile
src/distrib/sgimips/cdroms/installcd [netbsd-5]: Makefile
src/distrib/sparc/cdroms/installcd [netbsd-5]: Makefile
src/distrib/sparc64/cdroms/installcd [netbsd-5]: Makefile
src/distrib/sun3/cdroms/installcd [netbsd-5]: Makefile
src/distrib/vax/cdroms/installcd [netbsd-5]: Makefile

Log Message:
Pullup follwoing revisons to fix build break of ticket 1931 on some archs:

distrib/alpha/cdroms/installcd/Makefile 1.2
distrib/pmax/cdroms/installcd/Makefile  1.2
distrib/prep/cdroms/installcd/Makefile  1.3
distrib/sgimips/cdroms/installcd/Makefile   1.2
distrib/sparc/cdroms/installcd/Makefile 1.2
distrib/sparc64/cdroms/installcd/Makefile   1.14
distrib/sun3/cdroms/installcd/Makefile  1.2
distrib/vax/cdroms/installcd/Makefile   1.2

Use ${CDIMAGE} instead of ${CDBASE}.iso.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/alpha/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/pmax/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.2.4.1 src/distrib/prep/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/sgimips/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/sparc/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/sun3/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/vax/cdroms/installcd/Makefile

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

Modified files:

Index: src/distrib/alpha/cdroms/installcd/Makefile
diff -u src/distrib/alpha/cdroms/installcd/Makefile:1.1 src/distrib/alpha/cdroms/installcd/Makefile:1.1.22.1
--- src/distrib/alpha/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:56:49 2007
+++ src/distrib/alpha/cdroms/installcd/Makefile	Sat Nov  8 11:35:45 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:56:49 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.22.1 2014/11/08 11:35:45 msaitoh Exp $
 CDBASE=		alphacd		# gives ${CDBASE}.iso
 CDINSTKERNEL=	../../instkernel/instkernel
 CDKERNELS=	netbsd netbsd
@@ -6,7 +6,7 @@ CDRELEASE=	true			# include $RELEASEDIR/
 
 #make the CD bootable
 image_md_post:
-	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDBASE}.iso bootxx.${MACHINE}
+	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd
 

Index: src/distrib/pmax/cdroms/installcd/Makefile
diff -u src/distrib/pmax/cdroms/installcd/Makefile:1.1 src/distrib/pmax/cdroms/installcd/Makefile:1.1.22.1
--- src/distrib/pmax/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:16 2007
+++ src/distrib/pmax/cdroms/installcd/Makefile	Sat Nov  8 11:35:45 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:57:16 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.22.1 2014/11/08 11:35:45 msaitoh Exp $
 CDBASE=		pmaxcd			# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
 CDKERNELS=	netbsd-INSTALL.gz netbsd
@@ -6,6 +6,6 @@ CDINSTKERNEL=	../../instkernel
 
 #make the CD bootable
 image_md_post:
-	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDBASE}.iso bootxx.${MACHINE}
+	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd

Index: src/distrib/prep/cdroms/installcd/Makefile
diff -u src/distrib/prep/cdroms/installcd/Makefile:1.2 src/distrib/prep/cdroms/installcd/Makefile:1.2.4.1
--- src/distrib/prep/cdroms/installcd/Makefile:1.2	Wed Apr 30 08:08:32 2008
+++ src/distrib/prep/cdroms/installcd/Makefile	Sat Nov  8 11:35:45 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/04/30 08:08:32 garbled Exp $
+#	$NetBSD: Makefile,v 1.2.4.1 2014/11/08 11:35:45 msaitoh Exp $
 CDBASE=		prepcd		# gives ${CDBASE}.iso
 CDRELEASE=	true		# include $RELEASEDIR/$MACHINE
 CDMAKEFSOPTIONS=bootimage=powerpc;cdrom/prep/installation/floppy/sysinst_com0.fs
@@ -8,7 +8,7 @@ CDMAKEFSOPTIONS=bootimage=powerpc;cdrom/
 # it.
 
 image_md_post:
-	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -i ${CDBASE}.iso
-	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -u ${CDBASE}.iso
+	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -i ${CDIMAGE}
+	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -u ${CDIMAGE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd

Index: src/distrib/sgimips/cdroms/installcd/Makefile
diff -u src/distrib/sgimips/cdroms/installcd/Makefile:1.1 src/distrib/sgimips/cdroms/installcd/Makefile:1.1.22.1
--- src/distrib/sgimips/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:22 2007
+++ src/distrib/sgimips/cdroms/installcd/Makefile	Sat Nov  8 11:35:45 2014
@@ -1,4 +1,4 @@
-#	

CVS commit: [netbsd-5-2] src/distrib

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Nov  8 12:26:37 UTC 2014

Modified Files:
src/distrib/alpha/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/pmax/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/prep/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/sgimips/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/sparc/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/sparc64/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/sun3/cdroms/installcd [netbsd-5-2]: Makefile
src/distrib/vax/cdroms/installcd [netbsd-5-2]: Makefile

Log Message:
Pullup follwing revisions to fix build break of ticket 1931 on some archs.

distrib/alpha/cdroms/installcd/Makefile 1.2
distrib/pmax/cdroms/installcd/Makefile  1.2
distrib/prep/cdroms/installcd/Makefile  1.3
distrib/sgimips/cdroms/installcd/Makefile   1.2
distrib/sparc/cdroms/installcd/Makefile 1.2
distrib/sparc64/cdroms/installcd/Makefile   1.14
distrib/sun3/cdroms/installcd/Makefile  1.2
distrib/vax/cdroms/installcd/Makefile   1.2

Use ${CDIMAGE} instead of ${CDBASE}.iso.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.40.1 src/distrib/alpha/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.40.1 src/distrib/pmax/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.2.22.1 src/distrib/prep/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.40.1 src/distrib/sgimips/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.40.1 src/distrib/sparc/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.34.1 src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.40.1 src/distrib/sun3/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.40.1 src/distrib/vax/cdroms/installcd/Makefile

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

Modified files:

Index: src/distrib/alpha/cdroms/installcd/Makefile
diff -u src/distrib/alpha/cdroms/installcd/Makefile:1.1 src/distrib/alpha/cdroms/installcd/Makefile:1.1.40.1
--- src/distrib/alpha/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:56:49 2007
+++ src/distrib/alpha/cdroms/installcd/Makefile	Sat Nov  8 12:26:36 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:56:49 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.40.1 2014/11/08 12:26:36 msaitoh Exp $
 CDBASE=		alphacd		# gives ${CDBASE}.iso
 CDINSTKERNEL=	../../instkernel/instkernel
 CDKERNELS=	netbsd netbsd
@@ -6,7 +6,7 @@ CDRELEASE=	true			# include $RELEASEDIR/
 
 #make the CD bootable
 image_md_post:
-	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDBASE}.iso bootxx.${MACHINE}
+	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd
 

Index: src/distrib/pmax/cdroms/installcd/Makefile
diff -u src/distrib/pmax/cdroms/installcd/Makefile:1.1 src/distrib/pmax/cdroms/installcd/Makefile:1.1.40.1
--- src/distrib/pmax/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:16 2007
+++ src/distrib/pmax/cdroms/installcd/Makefile	Sat Nov  8 12:26:36 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:57:16 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.40.1 2014/11/08 12:26:36 msaitoh Exp $
 CDBASE=		pmaxcd			# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
 CDKERNELS=	netbsd-INSTALL.gz netbsd
@@ -6,6 +6,6 @@ CDINSTKERNEL=	../../instkernel
 
 #make the CD bootable
 image_md_post:
-	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDBASE}.iso bootxx.${MACHINE}
+	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd

Index: src/distrib/prep/cdroms/installcd/Makefile
diff -u src/distrib/prep/cdroms/installcd/Makefile:1.2 src/distrib/prep/cdroms/installcd/Makefile:1.2.22.1
--- src/distrib/prep/cdroms/installcd/Makefile:1.2	Wed Apr 30 08:08:32 2008
+++ src/distrib/prep/cdroms/installcd/Makefile	Sat Nov  8 12:26:37 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/04/30 08:08:32 garbled Exp $
+#	$NetBSD: Makefile,v 1.2.22.1 2014/11/08 12:26:37 msaitoh Exp $
 CDBASE=		prepcd		# gives ${CDBASE}.iso
 CDRELEASE=	true		# include $RELEASEDIR/$MACHINE
 CDMAKEFSOPTIONS=bootimage=powerpc;cdrom/prep/installation/floppy/sysinst_com0.fs
@@ -8,7 +8,7 @@ CDMAKEFSOPTIONS=bootimage=powerpc;cdrom/
 # it.
 
 image_md_post:
-	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -i ${CDBASE}.iso
-	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -u ${CDBASE}.iso
+	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -i ${CDIMAGE}
+	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -u ${CDIMAGE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd

Index: src/distrib/sgimips/cdroms/installcd/Makefile
diff -u src/distrib/sgimips/cdroms/installcd/Makefile:1.1 src/distrib/sgimips/cdroms/installcd/Makefile:1.1.40.1
--- src/distrib/sgimips/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:22 2007
+++ src/distrib/sgimips/cdroms/installcd/Makefile	Sat Nov  8 12:26:37 2014
@@ 

CVS commit: [netbsd-5-1] src/distrib

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Nov  8 12:27:25 UTC 2014

Modified Files:
src/distrib/alpha/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/pmax/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/prep/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/sgimips/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/sparc/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/sparc64/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/sun3/cdroms/installcd [netbsd-5-1]: Makefile
src/distrib/vax/cdroms/installcd [netbsd-5-1]: Makefile

Log Message:
Pullup follwing revisions to fix build break of ticket 1931 on some archs:

distrib/alpha/cdroms/installcd/Makefile 1.2
distrib/pmax/cdroms/installcd/Makefile  1.2
distrib/prep/cdroms/installcd/Makefile  1.3
distrib/sgimips/cdroms/installcd/Makefile   1.2
distrib/sparc/cdroms/installcd/Makefile 1.2
distrib/sparc64/cdroms/installcd/Makefile   1.14
distrib/sun3/cdroms/installcd/Makefile  1.2
distrib/vax/cdroms/installcd/Makefile   1.2

Use ${CDIMAGE} instead of ${CDBASE}.iso.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/alpha/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/pmax/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.2.12.1 src/distrib/prep/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/sgimips/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/sparc/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/sun3/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.1.30.1 src/distrib/vax/cdroms/installcd/Makefile

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

Modified files:

Index: src/distrib/alpha/cdroms/installcd/Makefile
diff -u src/distrib/alpha/cdroms/installcd/Makefile:1.1 src/distrib/alpha/cdroms/installcd/Makefile:1.1.30.1
--- src/distrib/alpha/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:56:49 2007
+++ src/distrib/alpha/cdroms/installcd/Makefile	Sat Nov  8 12:27:25 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:56:49 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.30.1 2014/11/08 12:27:25 msaitoh Exp $
 CDBASE=		alphacd		# gives ${CDBASE}.iso
 CDINSTKERNEL=	../../instkernel/instkernel
 CDKERNELS=	netbsd netbsd
@@ -6,7 +6,7 @@ CDRELEASE=	true			# include $RELEASEDIR/
 
 #make the CD bootable
 image_md_post:
-	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDBASE}.iso bootxx.${MACHINE}
+	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd
 

Index: src/distrib/pmax/cdroms/installcd/Makefile
diff -u src/distrib/pmax/cdroms/installcd/Makefile:1.1 src/distrib/pmax/cdroms/installcd/Makefile:1.1.30.1
--- src/distrib/pmax/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:16 2007
+++ src/distrib/pmax/cdroms/installcd/Makefile	Sat Nov  8 12:27:25 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2007/03/06 21:57:16 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.30.1 2014/11/08 12:27:25 msaitoh Exp $
 CDBASE=		pmaxcd			# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
 CDKERNELS=	netbsd-INSTALL.gz netbsd
@@ -6,6 +6,6 @@ CDINSTKERNEL=	../../instkernel
 
 #make the CD bootable
 image_md_post:
-	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDBASE}.iso bootxx.${MACHINE}
+	${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd

Index: src/distrib/prep/cdroms/installcd/Makefile
diff -u src/distrib/prep/cdroms/installcd/Makefile:1.2 src/distrib/prep/cdroms/installcd/Makefile:1.2.12.1
--- src/distrib/prep/cdroms/installcd/Makefile:1.2	Wed Apr 30 08:08:32 2008
+++ src/distrib/prep/cdroms/installcd/Makefile	Sat Nov  8 12:27:25 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/04/30 08:08:32 garbled Exp $
+#	$NetBSD: Makefile,v 1.2.12.1 2014/11/08 12:27:25 msaitoh Exp $
 CDBASE=		prepcd		# gives ${CDBASE}.iso
 CDRELEASE=	true		# include $RELEASEDIR/$MACHINE
 CDMAKEFSOPTIONS=bootimage=powerpc;cdrom/prep/installation/floppy/sysinst_com0.fs
@@ -8,7 +8,7 @@ CDMAKEFSOPTIONS=bootimage=powerpc;cdrom/
 # it.
 
 image_md_post:
-	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -i ${CDBASE}.iso
-	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -u ${CDBASE}.iso
+	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -i ${CDIMAGE}
+	${TOOL_FDISK} -F -f -b 1/255/16065 -0 -s 65/80/2799 -u ${CDIMAGE}
 
 .include ${.CURDIR}/../../../common/Makefile.bootcd

Index: src/distrib/sgimips/cdroms/installcd/Makefile
diff -u src/distrib/sgimips/cdroms/installcd/Makefile:1.1 src/distrib/sgimips/cdroms/installcd/Makefile:1.1.30.1
--- src/distrib/sgimips/cdroms/installcd/Makefile:1.1	Tue Mar  6 21:57:22 2007
+++ src/distrib/sgimips/cdroms/installcd/Makefile	Sat Nov  8 12:27:25 2014
@@ 

CVS commit: src/sys/dev/usb

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 16:20:23 UTC 2014

Modified Files:
src/sys/dev/usb: usb.h

Log Message:
Add more structs and defines from various sources including FreeBSD,
OpenBSD and Takahiro HAYASHI


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/usb/usb.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/usb/usb.h
diff -u src/sys/dev/usb/usb.h:1.110 src/sys/dev/usb/usb.h:1.111
--- src/sys/dev/usb/usb.h:1.110	Fri Sep 12 16:40:38 2014
+++ src/sys/dev/usb/usb.h	Sat Nov  8 16:20:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.h,v 1.110 2014/09/12 16:40:38 skrll Exp $	*/
+/*	$NetBSD: usb.h,v 1.111 2014/11/08 16:20:23 skrll Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $	*/
 
 /*
@@ -165,30 +165,52 @@ typedef struct {
 #define  UDESC_OTG		0x09
 #define  UDESC_DEBUG		0x0a
 #define  UDESC_INTERFACE_ASSOC	0x0b
+#define  UDESC_BOS		0x0f
+#define  UDESC_DEVICE_CAPABILITY 0x10
 #define  UDESC_CS_DEVICE	0x21	/* class specific */
 #define  UDESC_CS_CONFIG	0x22
 #define  UDESC_CS_STRING	0x23
 #define  UDESC_CS_INTERFACE	0x24
 #define  UDESC_CS_ENDPOINT	0x25
 #define  UDESC_HUB		0x29
-#define  UDESC_SSHUB		0x2a
+#define  UDESC_SS_HUB		0x2a	/* super speed */
+#define  UDESC_ENDPOINT_SS_COMP 0x30	/* super speed */
+#define  UDESC_ENDPOINT_ISOCH_SSP_COMP	0x31
 #define UR_SET_DESCRIPTOR	0x07
 #define UR_GET_CONFIG		0x08
 #define UR_SET_CONFIG		0x09
 #define UR_GET_INTERFACE	0x0a
 #define UR_SET_INTERFACE	0x0b
 #define UR_SYNCH_FRAME		0x0c
+#define UR_SET_ENCRYPTION	0x0d
+#define UR_GET_ENCRYPTION	0x0e
+#define UR_SET_HANDSHAKE	0x0f
+#define UR_GET_HANDSHAKE	0x10
+#define UR_SET_CONNECTION	0x11
+#define UR_SET_SECURITY_DATA	0x12
+#define UR_GET_SECURITY_DATA	0x13
+#define UR_SET_WUSB_DATA	0x14
+#define UR_LOOPBACK_DATA_WRITE	0x15
+#define UR_LOOPBACK_DATA_READ	0x16
+#define UR_SET_INTERFACE_DS	0x17
+#define UR_SET_SEL		0x30
+#define UR_SET_ISOCH_DELAY	0x31
 
 /*
  * Feature selectors. USB 2.0 spec, table 9-6 and OTG and EH suppliment,
  * table 6-2
  */
 #define UF_ENDPOINT_HALT	0
+#define UF_INTERFACE_FUNCTION_SUSPEND	0
 #define UF_DEVICE_REMOTE_WAKEUP	1
 #define UF_TEST_MODE		2
 #define UF_DEVICE_B_HNP_ENABLE	3
 #define UF_DEVICE_A_HNP_SUPPORT	4
 #define UF_DEVICE_A_ALT_HNP_SUPPORT 5
+#define UF_DEVICE_WUSB_DEVICE	6
+#define UF_U1_ENABLE		0x30
+#define UF_U2_ENABLE		0x31
+#define UF_LTM_ENABLE		0x32
 
 #define USB_MAX_IPACKET		8 /* maximum size of the initial packet */
 
@@ -207,7 +229,9 @@ typedef struct {
 	uByte		bDescriptorType;
 	uWord		bcdUSB;
 #define UD_USB_2_0		0x0200
+#define UD_USB_3_0		0x0300
 #define UD_IS_USB2(d) (UGETW((d)-bcdUSB) = UD_USB_2_0)
+#define UD_IS_USB3(d) (UGETW((d)-bcdUSB) = UD_USB_3_0)
 	uByte		bDeviceClass;
 	uByte		bDeviceSubClass;
 	uByte		bDeviceProtocol;
@@ -296,6 +320,105 @@ typedef struct {
 typedef struct {
 	uByte		bLength;
 	uByte		bDescriptorType;
+	uByte		bMaxBurst;
+	uByte		bmAttributes;
+#define UE_SSC_MAXSTREAMS(x)	__SHIFTOUT(x, __BITS(4,0))	/* bulk */
+#define UE_SSC_MULT(x)		__SHIFTOUT(x, __BITS(1,0))	/* isoch */
+#define UE_SSC_SSP_ISO(x) 	__SHIFTOUT(x, __BIT(7))		/* isoch */
+	/* The fields below are only valid for periodic endpoints */
+	uWord		wBytesPerInterval;
+} UPACKED usb_endpoint_ss_comp_descriptor_t;
+#define USB_ENDPOINT_SS_COMP_DESCRIPTOR_SIZE 6
+
+typedef struct {
+	uByte		bLength;
+	uByte		bDescriptorType;
+	uWord		wTotalLength;
+	uByte		bNumDeviceCaps;
+} UPACKED usb_bos_descriptor_t;
+#define USB_BOS_DESCRIPTOR_SIZE 5
+
+typedef struct {
+	uByte		bLength;
+	uByte		bDescriptorType;
+	uByte		bDevCapabilityType;
+#define USB_DEVCAP_RESERVED			0x00
+#define USB_DEVCAP_WUSB0x01
+#define USB_DEVCAP_USB2EXT			0x02
+#define USB_DEVCAP_SUPER_SPEED			0x03
+#define USB_DEVCAP_CONTAINER_ID			0x04
+#define USB_DEVCAP_PLATFORM			0x05
+#define USB_DEVCAP_POWER_DELIVERY_CAPABILITY	0x06
+#define USB_DEVCAP_BATTERY_INFO_CAPABILITY	0x07
+#define USB_DEVCAP_PD_CONSUMER_PORT_CAPABILITY	0x08
+#define USB_DEVCAP_PD_PROVIDER_PORT_CAPABILITY	0x09
+#define USB_DEVCAP_SUPERSPEED_PLUS		0x0a
+#define USB_DEVCAP_PRECISION_TIME_MEASUREMENT	0x0b
+#define USB_DEVCAP_WUSB_EXT			0x0c
+	/* data ... */
+} UPACKED usb_device_capability_descriptor_t;
+#define USB_DEVICE_CAPABILITY_DESCRIPTOR_SIZE 3 /* variable length */
+
+typedef struct {
+	uByte		bLength;
+	uByte		bDescriptorType;
+	uByte		bDevCapabilityType;
+	uDWord		bmAttributes;
+#define USB_DEVCAP_USB2EXT_LPM __BIT(1)
+} UPACKED usb_usb2ext_descriptor_t;
+#define USB_DEVCAP_USB2EXT_DESCRIPTOR_SIZE 7
+
+typedef struct {
+	uByte		bLength;
+	uByte		bDescriptorType;
+	uByte		bDevCapabilityType;
+	uByte		bmAttributes;
+#define USB_DEVCAP_SS_LTM __BIT(1)
+	uWord		wSpeedsSupported;
+#define USB_DEVCAP_SS_SPEED_SS __BIT(0)
+#define USB_DEVCAP_SS_SPEED_FS __BIT(1)
+#define USB_DEVCAP_SS_SPEED_HS __BIT(2)
+#define USB_DEVCAP_SS_SPEED_LS 

CVS commit: src/sys/dev/adb

2014-11-08 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Nov  8 16:52:35 UTC 2014

Modified Files:
src/sys/dev/adb: adb_kbd.c adb_keymap.h adb_usb_map.c

Log Message:
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/adb/adb_kbd.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/adb/adb_keymap.h
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/adb/adb_usb_map.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/adb/adb_kbd.c
diff -u src/sys/dev/adb/adb_kbd.c:1.22 src/sys/dev/adb/adb_kbd.c:1.23
--- src/sys/dev/adb/adb_kbd.c:1.22	Mon Nov 18 11:02:34 2013
+++ src/sys/dev/adb/adb_kbd.c	Sat Nov  8 16:52:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_kbd.c,v 1.22 2013/11/18 11:02:34 nisimura Exp $	*/
+/*	$NetBSD: adb_kbd.c,v 1.23 2014/11/08 16:52:35 macallan Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_kbd.c,v 1.22 2013/11/18 11:02:34 nisimura Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_kbd.c,v 1.23 2014/11/08 16:52:35 macallan Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -190,6 +190,7 @@ adbkbd_attach(device_t parent, device_t 
 #if NWSMOUSE  0
 	struct wsmousedev_attach_args am;
 #endif
+	uint8_t buffer[2];
 
 	sc-sc_dev = self;
 	sc-sc_ops = aaa-ops;
@@ -333,6 +334,27 @@ adbkbd_attach(device_t parent, device_t 
 		break;
 	}
 
+	/*
+	 * try to switch to extended protocol
+	 * as in, tell the keyboard to distinguish between left and right
+	 * Shift, Control and Alt keys
+	 */
+	cmd = ADBLISTEN(sc-sc_adbdev-current_addr, 3);
+	buffer[0] = sc-sc_adbdev-current_addr;
+	buffer[1] = 3;
+	sc-sc_msg_len = 0;
+	sc-sc_ops-send(sc-sc_ops-cookie, sc-sc_poll, cmd, 2, buffer);
+	adbkbd_wait(sc, 10);
+
+	cmd = ADBTALK(sc-sc_adbdev-current_addr, 3);
+	sc-sc_msg_len = 0;
+	sc-sc_ops-send(sc-sc_ops-cookie, sc-sc_poll, cmd, 0, NULL);
+	adbkbd_wait(sc, 10);
+	if ((sc-sc_msg_len == 4)  (sc-sc_buffer[3] == 3)) {
+		printf(%s: extended protocol enabled\n,
+		device_xname(sc-sc_dev));
+	}
+
 	if (adbkbd_is_console  (adbkbd_console_attached == 0)) {
 		wskbd_cnattach(adbkbd_consops, sc, adbkbd_keymapdata);
 		adbkbd_console_attached = 1;

Index: src/sys/dev/adb/adb_keymap.h
diff -u src/sys/dev/adb/adb_keymap.h:1.4 src/sys/dev/adb/adb_keymap.h:1.5
--- src/sys/dev/adb/adb_keymap.h:1.4	Wed Aug 29 02:44:07 2012
+++ src/sys/dev/adb/adb_keymap.h	Sat Nov  8 16:52:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_keymap.h,v 1.4 2012/08/29 02:44:07 macallan Exp $	*/
+/*	$NetBSD: adb_keymap.h,v 1.5 2014/11/08 16:52:35 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -148,7 +148,9 @@ static const keysym_t akbd_keydesc_us[] 
 KC(120),KS_Cmd_Screen1,	KS_f2,
 KC(121),KS_Cmd_ScrollFastDown, KS_Next,
 KC(122),KS_Cmd_Screen0,	KS_f1,
-
+KC(123),			KS_Shift_R,
+KC(124),			KS_Alt_R,
+KC(125),			KS_Control_R,
 KC(127),  KS_Cmd_Debugger,
 };
 

Index: src/sys/dev/adb/adb_usb_map.c
diff -u src/sys/dev/adb/adb_usb_map.c:1.1 src/sys/dev/adb/adb_usb_map.c:1.2
--- src/sys/dev/adb/adb_usb_map.c:1.1	Wed Aug 29 02:44:07 2012
+++ src/sys/dev/adb/adb_usb_map.c	Sat Nov  8 16:52:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_usb_map.c,v 1.1 2012/08/29 02:44:07 macallan Exp $ */
+/*	$NetBSD: adb_usb_map.c,v 1.2 2014/11/08 16:52:35 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_usb_map.c,v 1.1 2012/08/29 02:44:07 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_usb_map.c,v 1.2 2014/11/08 16:52:35 macallan Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -158,9 +158,9 @@ keysym_t adb_to_usb[] = {
 /* 120, KS_f2		*/		59,
 /* 121, KS_Next		*/		78,
 /* 122, KS_f1		*/		58,
-/* 123			*/		0,
-/* 124			*/		0,
-/* 125			*/		0,
+/* 123, KS_Shift_R	*/		229,
+/* 124, KS_Alt_R	*/		230,
+/* 125, KS_Control_R	*/		228,
 /* 126			*/		0,
 /* 127, KS_Cmd_Debugger	*/		102
 };



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

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 17:09:38 UTC 2014

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Include opt_multiprocessor.h


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/pic/pic.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/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.24 src/sys/arch/arm/pic/pic.c:1.25
--- src/sys/arch/arm/pic/pic.c:1.24	Wed Oct 29 14:41:57 2014
+++ src/sys/arch/arm/pic/pic.c	Sat Nov  8 17:09:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.24 2014/10/29 14:41:57 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.25 2014/11/08 17:09:38 skrll Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,9 +30,10 @@
 
 #define _INTR_PRIVATE
 #include opt_ddb.h
+#include opt_multiprocessor.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pic.c,v 1.24 2014/10/29 14:41:57 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pic.c,v 1.25 2014/11/08 17:09:38 skrll Exp $);
 
 #include sys/param.h
 #include sys/atomic.h



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

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 17:18:54 UTC 2014

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

Log Message:
Clarify/merge two comments


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/mutex.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/mutex.h
diff -u src/sys/arch/arm/include/mutex.h:1.18 src/sys/arch/arm/include/mutex.h:1.19
--- src/sys/arch/arm/include/mutex.h:1.18	Sun Oct 12 06:00:14 2014
+++ src/sys/arch/arm/include/mutex.h	Sat Nov  8 17:18:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.18 2014/10/12 06:00:14 skrll Exp $	*/
+/*	$NetBSD: mutex.h,v 1.19 2014/11/08 17:18:54 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -85,8 +85,8 @@ struct kmutex {
 #define	__HAVE_SIMPLE_MUTEXES		1
 
 /*
- * MUTEX_RECEIVE: no memory barrier required; we're synchronizing against
- * interrupts, not multiple processors.
+ * MUTEX_{GIVE,RECEIVE}: no memory barrier is required in the UP case;
+ * we're synchronizing against interrupts, not multiple processors.
  */
 #ifdef MULTIPROCESSOR
 #ifdef _ARM_ARCH_7
@@ -98,9 +98,6 @@ struct kmutex {
 #define	MUTEX_RECEIVE(mtx)		/* nothing */
 #endif
 
-/*
- * MUTEX_GIVE: no memory barrier required; same reason.
- */
 #ifdef MULTIPROCESSOR
 #ifdef _ARM_ARCH_7
 #define	MUTEX_GIVE(mtx)			__asm __volatile(dsb)



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

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 17:18:22 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 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/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.136 src/sys/arch/arm/include/arm32/pmap.h:1.137
--- src/sys/arch/arm/include/arm32/pmap.h:1.136	Wed Oct 29 14:14:14 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Nov  8 17:18:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.136 2014/10/29 14:14:14 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.137 2014/11/08 17:18:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -345,9 +345,9 @@ extern int		arm_poolpage_vmfreelist;
 
 #define pmap_phys_address(ppn)		(arm_ptob((ppn)))
 u_int arm32_mmap_flags(paddr_t);
-#define ARM32_MMAP_WRITECOMBINE	0x4000
+#define ARM32_MMAP_WRITECOMBINE		0x4000
 #define ARM32_MMAP_CACHEABLE		0x2000
-#define pmap_mmap_flags(ppn)			arm32_mmap_flags(ppn)
+#define pmap_mmap_flags(ppn)		arm32_mmap_flags(ppn)
 
 #define	PMAP_PTE			0x1000 /* kenter_pa */
 



CVS commit: src/sys/dev/adb

2014-11-08 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Nov  8 17:21:51 UTC 2014

Modified Files:
src/sys/dev/adb: adb_bus.c adb_kbd.c

Log Message:
aprint_*-ize


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/adb/adb_bus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/adb/adb_kbd.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/adb/adb_bus.c
diff -u src/sys/dev/adb/adb_bus.c:1.9 src/sys/dev/adb/adb_bus.c:1.10
--- src/sys/dev/adb/adb_bus.c:1.9	Tue May 12 14:07:01 2009
+++ src/sys/dev/adb/adb_bus.c	Sat Nov  8 17:21:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_bus.c,v 1.9 2009/05/12 14:07:01 cegger Exp $ */
+/*	$NetBSD: adb_bus.c,v 1.10 2014/11/08 17:21:51 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_bus.c,v 1.9 2009/05/12 14:07:01 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_bus.c,v 1.10 2014/11/08 17:21:51 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -171,7 +171,7 @@ nadb_init(device_t dev)
 			if (config_found(sc-sc_dev, aaa, nadb_devprint)) {
 devmask |= (1  i);
 			} else {
-printf( not configured\n);
+aprint_normal( not configured\n);
 			}
 		}
 	}
@@ -183,7 +183,7 @@ nadb_init(device_t dev)
 int
 nadb_print(void *aux, const char *what)
 {
-	printf(: Apple Desktop Bus\n);
+	aprint_normal(: Apple Desktop Bus\n);
 	return 0;
 }
 
@@ -197,13 +197,13 @@ nadb_devprint(void *aux, const char *wha
 
 	switch(aaa-dev-original_addr) {
 		case 2:
-			printf(%s: ADB Keyboard, what);
+			aprint_normal(%s: ADB Keyboard, what);
 			break;
 		case 3:
-			printf(%s: ADB relative pointing device, what);
+			aprint_normal(%s: ADB relative pointing device, what);
 			break;
 		default:
-			printf(%s: something from address %d:%02x,
+			aprint_normal(%s: something from address %d:%02x,
 			what,
 			aaa-dev-original_addr,
 			aaa-dev-handler_id);

Index: src/sys/dev/adb/adb_kbd.c
diff -u src/sys/dev/adb/adb_kbd.c:1.23 src/sys/dev/adb/adb_kbd.c:1.24
--- src/sys/dev/adb/adb_kbd.c:1.23	Sat Nov  8 16:52:35 2014
+++ src/sys/dev/adb/adb_kbd.c	Sat Nov  8 17:21:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_kbd.c,v 1.23 2014/11/08 16:52:35 macallan Exp $	*/
+/*	$NetBSD: adb_kbd.c,v 1.24 2014/11/08 17:21:51 macallan Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_kbd.c,v 1.23 2014/11/08 16:52:35 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_kbd.c,v 1.24 2014/11/08 17:21:51 macallan Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -232,14 +232,14 @@ adbkbd_attach(device_t parent, device_t 
 	sc-sc_timestamp = 0;
 	sc-sc_emul_usb = FALSE;
 
-	printf( addr %d: , sc-sc_adbdev-current_addr);
+	aprint_normal( addr %d: , sc-sc_adbdev-current_addr);
 
 	switch (sc-sc_adbdev-handler_id) {
 	case ADB_STDKBD:
-		printf(standard keyboard\n);
+		aprint_normal(standard keyboard\n);
 		break;
 	case ADB_ISOKBD:
-		printf(standard keyboard (ISO layout)\n);
+		aprint_normal(standard keyboard (ISO layout)\n);
 		break;
 	case ADB_EXTKBD:
 		cmd = ADBTALK(sc-sc_adbdev-current_addr, 1);
@@ -250,87 +250,87 @@ adbkbd_attach(device_t parent, device_t 
 		/* Ignore Logitech MouseMan/Trackman pseudo keyboard */
 		/* XXX needs testing */
 		if (sc-sc_buffer[2] == 0x9a  sc-sc_buffer[3] == 0x20) {
-			printf(Mouseman (non-EMP) pseudo keyboard\n);
+			aprint_normal(Mouseman (non-EMP) pseudo keyboard\n);
 			return;
 		} else if (sc-sc_buffer[2] == 0x9a  
 		sc-sc_buffer[3] == 0x21) {
-			printf(Trackman (non-EMP) pseudo keyboard\n);
+			aprint_normal(Trackman (non-EMP) pseudo keyboard\n);
 			return;
 		} else {
-			printf(extended keyboard\n);
+			aprint_normal(extended keyboard\n);
 			adbkbd_initleds(sc);
 		}
 		break;
 	case ADB_EXTISOKBD:
-		printf(extended keyboard (ISO layout)\n);
+		aprint_normal(extended keyboard (ISO layout)\n);
 		adbkbd_initleds(sc);
 		break;
 	case ADB_KBDII:
-		printf(keyboard II\n);
+		aprint_normal(keyboard II\n);
 		break;
 	case ADB_ISOKBDII:
-		printf(keyboard II (ISO layout)\n);
+		aprint_normal(keyboard II (ISO layout)\n);
 		break;
 	case ADB_PBKBD:
-		printf(PowerBook keyboard\n);
+		aprint_normal(PowerBook keyboard\n);
 		sc-sc_power = 0x7e;
 		sc-sc_power_button_delay = 1;
 		break;
 	case ADB_PBISOKBD:
-		printf(PowerBook keyboard (ISO layout)\n);
+		aprint_normal(PowerBook keyboard (ISO layout)\n);
 		sc-sc_power = 0x7e;
 		sc-sc_power_button_delay = 1;
 		break;
 	case ADB_ADJKPD:
-		printf(adjustable keypad\n);
+		aprint_normal(adjustable keypad\n);
 		break;
 	case ADB_ADJKBD:
-		printf(adjustable keyboard\n);
+		aprint_normal(adjustable keyboard\n);
 		break;
 	case ADB_ADJISOKBD:
-		printf(adjustable keyboard (ISO layout)\n);
+		aprint_normal(adjustable keyboard (ISO layout)\n);
 		break;
 	case ADB_ADJJAPKBD:
-		printf(adjustable keyboard 

CVS commit: src/sys/external/bsd/drm2/include/linux

2014-11-08 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Nov  8 19:27:40 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/include/linux: sched.h

Log Message:
return correct remaining jiffies.
fix X server hang when screen blank by DPMS.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/sched.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/linux/sched.h
diff -u src/sys/external/bsd/drm2/include/linux/sched.h:1.4 src/sys/external/bsd/drm2/include/linux/sched.h:1.5
--- src/sys/external/bsd/drm2/include/linux/sched.h:1.4	Wed Oct 22 11:41:34 2014
+++ src/sys/external/bsd/drm2/include/linux/sched.h	Sat Nov  8 19:27:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sched.h,v 1.4 2014/10/22 11:41:34 nonaka Exp $	*/
+/*	$NetBSD: sched.h,v 1.5 2014/11/08 19:27:40 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@ task_pid_nr(struct proc *p)
 static inline long
 schedule_timeout_uninterruptible(long timeout)
 {
+	long remain;
 	int start, end;
 
 	if (cold) {
@@ -61,7 +62,8 @@ schedule_timeout_uninterruptible(long ti
 	(void)kpause(loonix, false /*!intr*/, timeout, NULL);
 	end = hardclock_ticks;
 
-	return (end - start)  0 ? (end - start) : 0;
+	remain = timeout - (end - start);
+	return remain  0 ? remain : 0;
 }
 
 #endif  /* _LINUX_SCHED_H_ */



CVS commit: src/lib/librumpuser

2014-11-08 Thread Justin Cormack
Module Name:src
Committed By:   justin
Date:   Sat Nov  8 21:27:04 UTC 2014

Modified Files:
src/lib/librumpuser: rumpfiber.c

Log Message:
Fix some error handling cases.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/librumpuser/rumpfiber.c

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

Modified files:

Index: src/lib/librumpuser/rumpfiber.c
diff -u src/lib/librumpuser/rumpfiber.c:1.5 src/lib/librumpuser/rumpfiber.c:1.6
--- src/lib/librumpuser/rumpfiber.c:1.5	Wed Nov  5 01:39:40 2014
+++ src/lib/librumpuser/rumpfiber.c	Sat Nov  8 21:27:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfiber.c,v 1.5 2014/11/05 01:39:40 pooka Exp $	*/
+/*	$NetBSD: rumpfiber.c,v 1.6 2014/11/08 21:27:04 justin Exp $	*/
 
 /*
  * Copyright (c) 2007-2013 Antti Kantee.  All Rights Reserved.
@@ -68,7 +68,7 @@
 #include rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: rumpfiber.c,v 1.5 2014/11/05 01:39:40 pooka Exp $);
+__RCSID($NetBSD: rumpfiber.c,v 1.6 2014/11/08 21:27:04 justin Exp $);
 #endif /* !lint */
 
 #include sys/ioctl.h
@@ -199,11 +199,16 @@ create_thread(const char *name, void *co
 {
 	struct thread *thread = calloc(1, sizeof(struct thread));
 
+	if (!thread) {
+		return NULL;
+	}
+
 	if (!stack) {
 		assert(stack_size == 0);
 		stack = mmap(NULL, STACKSIZE, PROT_READ | PROT_WRITE,
 		MAP_SHARED | MAP_ANON, -1, 0);
 		if (stack == MAP_FAILED) {
+			free(thread);
 			return NULL;
 		}
 		stack_size = STACKSIZE;



CVS commit: src/lib/librumpuser

2014-11-08 Thread Justin Cormack
Module Name:src
Committed By:   justin
Date:   Sat Nov  8 23:20:24 UTC 2014

Modified Files:
src/lib/librumpuser: rumpfiber.c

Log Message:
Move makecontext into function with getcontext for consistency


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/librumpuser/rumpfiber.c

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

Modified files:

Index: src/lib/librumpuser/rumpfiber.c
diff -u src/lib/librumpuser/rumpfiber.c:1.6 src/lib/librumpuser/rumpfiber.c:1.7
--- src/lib/librumpuser/rumpfiber.c:1.6	Sat Nov  8 21:27:04 2014
+++ src/lib/librumpuser/rumpfiber.c	Sat Nov  8 23:20:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfiber.c,v 1.6 2014/11/08 21:27:04 justin Exp $	*/
+/*	$NetBSD: rumpfiber.c,v 1.7 2014/11/08 23:20:23 justin Exp $	*/
 
 /*
  * Copyright (c) 2007-2013 Antti Kantee.  All Rights Reserved.
@@ -68,7 +68,7 @@
 #include rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: rumpfiber.c,v 1.6 2014/11/08 21:27:04 justin Exp $);
+__RCSID($NetBSD: rumpfiber.c,v 1.7 2014/11/08 23:20:23 justin Exp $);
 #endif /* !lint */
 
 #include sys/ioctl.h
@@ -181,7 +181,8 @@ schedule(void)
 }
 
 static void
-create_ctx(ucontext_t *ctx, void *stack, size_t stack_size)
+create_ctx(ucontext_t *ctx, void *stack, size_t stack_size,
+	void (*f)(void *), void *data)
 {
 
 	getcontext(ctx);
@@ -189,9 +190,10 @@ create_ctx(ucontext_t *ctx, void *stack,
 	ctx-uc_stack.ss_size = stack_size;
 	ctx-uc_stack.ss_flags = 0;
 	ctx-uc_link = NULL; /* TODO may link to main thread */
+	/* may have to do bounce function to call, if args to makecontext are ints */
+	makecontext(ctx, (void (*)(void))f, 1, data);
 }
 
-/* may have to do bounce function to call, if args to makecontext are ints */
 /* TODO see notes in rumpuser_thread_create, have flags here */
 struct thread *
 create_thread(const char *name, void *cookie, void (*f)(void *), void *data,
@@ -215,8 +217,7 @@ create_thread(const char *name, void *co
 	} else {
 		thread-flags = THREAD_EXTSTACK;
 	}
-	create_ctx(thread-ctx, stack, stack_size);
-	makecontext(thread-ctx, (void (*)(void))f, 1, data);
+	create_ctx(thread-ctx, stack, stack_size, f, data);
 	
 	thread-name = strdup(name);
 	thread-cookie = cookie;



CVS commit: src/lib/librumpuser

2014-11-08 Thread Justin Cormack
Module Name:src
Committed By:   justin
Date:   Sat Nov  8 23:47:15 UTC 2014

Modified Files:
src/lib/librumpuser: rumpfiber.c

Log Message:
Remove superfluous getcontext()


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/librumpuser/rumpfiber.c

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

Modified files:

Index: src/lib/librumpuser/rumpfiber.c
diff -u src/lib/librumpuser/rumpfiber.c:1.7 src/lib/librumpuser/rumpfiber.c:1.8
--- src/lib/librumpuser/rumpfiber.c:1.7	Sat Nov  8 23:20:23 2014
+++ src/lib/librumpuser/rumpfiber.c	Sat Nov  8 23:47:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfiber.c,v 1.7 2014/11/08 23:20:23 justin Exp $	*/
+/*	$NetBSD: rumpfiber.c,v 1.8 2014/11/08 23:47:15 justin Exp $	*/
 
 /*
  * Copyright (c) 2007-2013 Antti Kantee.  All Rights Reserved.
@@ -68,7 +68,7 @@
 #include rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: rumpfiber.c,v 1.7 2014/11/08 23:20:23 justin Exp $);
+__RCSID($NetBSD: rumpfiber.c,v 1.8 2014/11/08 23:47:15 justin Exp $);
 #endif /* !lint */
 
 #include sys/ioctl.h
@@ -388,7 +388,6 @@ init_sched(void)
 {
 	struct thread *thread = calloc(1, sizeof(struct thread));
 
-	getcontext(thread-ctx);
 	thread-name = strdup(init);
 	thread-flags = 0;
 	thread-wakeup_time = -1;



CVS commit: src/sys/arch

2014-11-08 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Nov  9 00:05:06 UTC 2014

Modified Files:
src/sys/arch/macppc/macppc: locore.S
src/sys/arch/ofppc/ofppc: locore.S

Log Message:
in the initial asm code, save the interesting caller-saved registers
(containing arg and len) across function calls to C code.
fixes kernels built with gcc 4.8.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/macppc/macppc/locore.S
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/ofppc/ofppc/locore.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/macppc/macppc/locore.S
diff -u src/sys/arch/macppc/macppc/locore.S:1.71 src/sys/arch/macppc/macppc/locore.S:1.72
--- src/sys/arch/macppc/macppc/locore.S:1.71	Thu Apr 11 18:36:44 2013
+++ src/sys/arch/macppc/macppc/locore.S	Sun Nov  9 00:05:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.71 2013/04/11 18:36:44 macallan Exp $	*/
+/*	$NetBSD: locore.S,v 1.72 2014/11/09 00:05:06 chs Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -82,8 +82,10 @@ _C_LABEL(kernel_text):
 	.text
 	.globl	__start
 __start:
-	bl	_C_LABEL(cpu_model_init)	/* init oeacpufeat */
 	bl	_C_LABEL(ofwinit)		/* init OF */
+	mr	13,6
+	mr	14,7
+	bl	_C_LABEL(cpu_model_init)	/* init oeacpufeat */
 
 	li	0,0
 	mtmsr	0			/* Disable FPU/MMU/exceptions */
@@ -99,6 +101,8 @@ __start:
 	addi	4,4,_C_LABEL(end)@l
 #if NKSYMS || defined(DDB) || defined(MODULAR)
 	/* skip symbol table */
+	mr	6,13
+	mr	7,14
 	cmpwi	6,0
 	beq	1f
 	add	9,6,7			/* r9 = args + l */

Index: src/sys/arch/ofppc/ofppc/locore.S
diff -u src/sys/arch/ofppc/ofppc/locore.S:1.48 src/sys/arch/ofppc/ofppc/locore.S:1.49
--- src/sys/arch/ofppc/ofppc/locore.S:1.48	Mon Jun 20 19:56:12 2011
+++ src/sys/arch/ofppc/ofppc/locore.S	Sun Nov  9 00:05:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.48 2011/06/20 19:56:12 matt Exp $	*/
+/*	$NetBSD: locore.S,v 1.49 2014/11/09 00:05:06 chs Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -80,6 +80,8 @@ _C_LABEL(kernel_text):
 	.text
 	.globl	__start
 __start:
+	mr	%r13,%r6
+	mr	%r14,%r7
 	bl	_C_LABEL(ofwinit)	/* init our OF hooks */
 
 	li	%r0,0
@@ -104,6 +106,8 @@ __start:
 addi	%r4,%r4,_C_LABEL(end)@l
 #if NKSYMS || defined(DDB) || defined(MODULAR)
 	/* skip symbol table */
+	mr	%r6,%r13
+	mr	%r7,%r14
 	cmpwi	%r6,0
 	beq	1f
 	add	%r9,%r6,%r7			/* r9 = args + l */



CVS commit: [netbsd-5-2] src/doc

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 05:28:52 UTC 2014

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

Log Message:
Add some files for ticket 1931.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-5.2.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.2.3
diff -u src/doc/CHANGES-5.2.3:1.1.2.24 src/doc/CHANGES-5.2.3:1.1.2.25
--- src/doc/CHANGES-5.2.3:1.1.2.24	Fri Nov  7 08:04:42 2014
+++ src/doc/CHANGES-5.2.3	Sun Nov  9 05:28:52 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.3,v 1.1.2.24 2014/11/07 08:04:42 msaitoh Exp $
+# $NetBSD: CHANGES-5.2.3,v 1.1.2.25 2014/11/09 05:28:52 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.2.2 release to the NetBSD 5.2.3
 release:
@@ -362,6 +362,14 @@ distrib/common/Makefile.bootcd			1.18
 distrib/notes/common/main			1.484
 distrib/notes/macppc/prep.OPENFIRMWARE		1.15
 distrib/notes/sparc/install			1.57
+distrib/alpha/cdroms/installcd/Makefile		1.2
+distrib/pmax/cdroms/installcd/Makefile		1.2
+distrib/prep/cdroms/installcd/Makefile		1.3
+distrib/sgimips/cdroms/installcd/Makefile	1.2
+distrib/sparc/cdroms/installcd/Makefile		1.2
+distrib/sparc64/cdroms/installcd/Makefile	1.14
+distrib/sun3/cdroms/installcd/Makefile		1.2
+distrib/vax/cdroms/installcd/Makefile		1.2
 etc/Makefile	1.394
 share/man/man7/release.7			1.32
 



CVS commit: [netbsd-5-1] src/doc

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 05:29:47 UTC 2014

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

Log Message:
Add some files for ticket 1931.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/CHANGES-5.1.5

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.1.5
diff -u src/doc/CHANGES-5.1.5:1.1.2.23 src/doc/CHANGES-5.1.5:1.1.2.24
--- src/doc/CHANGES-5.1.5:1.1.2.23	Fri Nov  7 08:05:34 2014
+++ src/doc/CHANGES-5.1.5	Sun Nov  9 05:29:46 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.5,v 1.1.2.23 2014/11/07 08:05:34 msaitoh Exp $
+# $NetBSD: CHANGES-5.1.5,v 1.1.2.24 2014/11/09 05:29:46 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.1.4 release to the NetBSD 5.1.5
 release:
@@ -362,6 +362,14 @@ distrib/common/Makefile.bootcd			1.18
 distrib/notes/common/main			1.484
 distrib/notes/macppc/prep.OPENFIRMWARE		1.15
 distrib/notes/sparc/install			1.57
+distrib/alpha/cdroms/installcd/Makefile		1.2
+distrib/pmax/cdroms/installcd/Makefile		1.2
+distrib/prep/cdroms/installcd/Makefile		1.3
+distrib/sgimips/cdroms/installcd/Makefile	1.2
+distrib/sparc/cdroms/installcd/Makefile		1.2
+distrib/sparc64/cdroms/installcd/Makefile	1.14
+distrib/sun3/cdroms/installcd/Makefile		1.2
+distrib/vax/cdroms/installcd/Makefile		1.2
 etc/Makefile	1.394
 share/man/man7/release.7			1.32
 



CVS commit: [netbsd-5] src/doc

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 05:29:20 UTC 2014

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

Log Message:
Add some files for ticket 1931.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.77 -r1.1.2.78 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.77 src/doc/CHANGES-5.3:1.1.2.78
--- src/doc/CHANGES-5.3:1.1.2.77	Fri Nov  7 08:02:16 2014
+++ src/doc/CHANGES-5.3	Sun Nov  9 05:29:20 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.77 2014/11/07 08:02:16 msaitoh Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.78 2014/11/09 05:29:20 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -1134,6 +1134,14 @@ distrib/common/Makefile.bootcd			1.18
 distrib/notes/common/main			1.484
 distrib/notes/macppc/prep.OPENFIRMWARE		1.15
 distrib/notes/sparc/install			1.57
+distrib/alpha/cdroms/installcd/Makefile		1.2
+distrib/pmax/cdroms/installcd/Makefile		1.2
+distrib/prep/cdroms/installcd/Makefile		1.3
+distrib/sgimips/cdroms/installcd/Makefile	1.2
+distrib/sparc/cdroms/installcd/Makefile		1.2
+distrib/sparc64/cdroms/installcd/Makefile	1.14
+distrib/sun3/cdroms/installcd/Makefile		1.2
+distrib/vax/cdroms/installcd/Makefile		1.2
 etc/Makefile	1.394
 share/man/man7/release.7			1.32
 



CVS commit: [netbsd-6] src/lib/libperfuse

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:16:50 UTC 2014

Modified Files:
src/lib/libperfuse [netbsd-6]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1165):
lib/libperfuse/ops.c: revision 1.75
Do not trust the filesystem's readdir to give us nul-terminated file
names


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.13 -r1.50.2.14 src/lib/libperfuse/ops.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.50.2.13 src/lib/libperfuse/ops.c:1.50.2.14
--- src/lib/libperfuse/ops.c:1.50.2.13	Tue Nov  4 01:52:53 2014
+++ src/lib/libperfuse/ops.c	Sun Nov  9 06:16:50 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.50.2.13 2014/11/04 01:52:53 msaitoh Exp $ */
+/*  $NetBSD: ops.c,v 1.50.2.14 2014/11/09 06:16:50 msaitoh Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -597,6 +597,7 @@ fuse_to_dirent(struct puffs_usermount *p
 	do {
 		char *ndp;
 		size_t reclen;
+		char name[MAXPATHLEN];
 
 		reclen = _DIRENT_RECLEN(dents, fd-namelen);
 
@@ -629,6 +630,9 @@ fuse_to_dirent(struct puffs_usermount *p
 			dents = (struct dirent *)(void *)ndp;
 		}
 		
+		strncpy(name, fd-name, fd-namelen);
+		name[fd-namelen] = '\0';
+
 		/*
 		 * Filesystem was mounted without -o use_ino
 		 * Perform a lookup to find it.
@@ -641,13 +645,17 @@ fuse_to_dirent(struct puffs_usermount *p
 			 * Avoid breaking out of fs 
 			 * by lookup to .. on root
 			 */
-			if ((strcmp(fd-name, ..) == 0)  
+			if ((strcmp(name, ..) == 0)  
 			(pnd-pnd_nodeid == FUSE_ROOT_ID)) {
 fd-ino = FUSE_ROOT_ID;
 			} else {
-if (node_lookup_common(pu, opc, NULL, fd-name,
-		   NULL, pn) != 0) {
-	DWARNX(node_lookup_common failed);
+int error;
+
+error = node_lookup_common(pu, opc, NULL, 
+			   name, NULL, pn);
+if (error != 0) {
+	DWARNX(node_lookup_common %s 
+	   failed: %d, name, error);
 } else {
 	fd-ino = pn-pn_va.va_fileid;
 	(void)perfuse_node_reclaim(pu, pn);
@@ -659,7 +667,7 @@ fuse_to_dirent(struct puffs_usermount *p
 		dents-d_reclen = (unsigned short)reclen;
 		dents-d_namlen = fd-namelen;
 		dents-d_type = fd-type;
-		strlcpy(dents-d_name, fd-name, fd-namelen + 1);
+		strlcpy(dents-d_name, name, fd-namelen + 1);
 
 #ifdef PERFUSE_DEBUG
 		if (perfuse_diagflags  PDF_READDIR)
@@ -710,7 +718,7 @@ fuse_to_dirent(struct puffs_usermount *p
 	 */
 	if (written != -1)
 		PERFUSE_NODE_DATA(opc)-pnd_dirent_len = written;
-	
+
 	return written;
 }
 



CVS commit: [netbsd-6] src/sys/fs/puffs

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:28:03 UTC 2014

Modified Files:
src/sys/fs/puffs [netbsd-6]: puffs_vnops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1166):
sys/fs/puffs/puffs_vnops.c: revision 1.188-1.194
- If we truncate the file, make sure we zero-fill the end of the last
  page, otherwise if the file is later truncated to a larger size
  (creating a hole), that area will not return zeroes as it should.
- Use PRIx64 for printing offsets
- Improve zero-fill of last page after shrink fix:
  1) do it only if the file is open for writing, otherwise we send write
  requests to the FS on a file that has never been open.
  2) do it inside existing if (vap-va_size != VNOVAL) block
- Retore LP64 fix that was removed by mistake
- Make this build again without debugging enabled; DPRINTF() can end up
  as empty, and in an if conditional, you then need braces if that's the
  only potential body.
- As is evidenced by several of our 32-bit MIPS ports, it's wrong to
  print vsize_t with PRIx64 -- instead use our own PRIxVSIZE macro.
- Do the previous correctly...


To generate a diff of this commit:
cvs rdiff -u -r1.163.2.7 -r1.163.2.8 src/sys/fs/puffs/puffs_vnops.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/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.163.2.7 src/sys/fs/puffs/puffs_vnops.c:1.163.2.8
--- src/sys/fs/puffs/puffs_vnops.c:1.163.2.7	Mon Nov  3 19:51:36 2014
+++ src/sys/fs/puffs/puffs_vnops.c	Sun Nov  9 06:28:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.163.2.7 2014/11/03 19:51:36 msaitoh Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.163.2.8 2014/11/09 06:28:03 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.163.2.7 2014/11/03 19:51:36 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.163.2.8 2014/11/09 06:28:03 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -1117,12 +1117,50 @@ puffs_vnop_getattr(void *v)
 	return error;
 }
 
+static void
+zerofill_lastpage(struct vnode *vp, voff_t off)
+{
+	char zbuf[PAGE_SIZE];
+	struct iovec iov;
+	struct uio uio;
+	vsize_t len;
+	int error;
+
+	if (trunc_page(off) == off)
+		return;
+ 
+	if (vp-v_writecount == 0)
+		return;
+
+	len = round_page(off) - off;
+	memset(zbuf, 0, len);
+
+	iov.iov_base = zbuf;
+	iov.iov_len = len;
+	UIO_SETUP_SYSSPACE(uio);
+	uio.uio_iov = iov;
+	uio.uio_iovcnt = 1;
+	uio.uio_offset = off;
+	uio.uio_resid = len;
+	uio.uio_rw = UIO_WRITE;
+
+	error = ubc_uiomove(vp-v_uobj, uio, len,
+			UVM_ADV_SEQUENTIAL, UBC_WRITE|UBC_UNMAP_FLAG(vp));
+	if (error) {
+		DPRINTF((zero-fill 0x% PRIxVSIZE @0x% PRIx64 
+			  failed: error = %d\n, len, off, error));
+	}
+
+	return;
+}
+
 static int
 dosetattr(struct vnode *vp, struct vattr *vap, kauth_cred_t cred, int flags)
 {
 	PUFFS_MSG_VARS(vn, setattr);
 	struct puffs_mount *pmp = MPTOPUFFSMP(vp-v_mount);
 	struct puffs_node *pn = vp-v_data;
+	vsize_t oldsize = vp-v_size;
 	int error = 0;
 
 	KASSERT(!(flags  SETATTR_CHSIZE) || mutex_owned(pn-pn_sizemtx));
@@ -1195,6 +1233,17 @@ dosetattr(struct vnode *vp, struct vattr
 	}
 
 	if (vap-va_size != VNOVAL) {
+		/*
+		 * If we truncated the file, make sure the data beyond 
+		 * EOF in last page does not remain in cache, otherwise 
+		 * if the file is later truncated to a larger size (creating
+		 * a hole), that area will not return zeroes as it
+		 * should. 
+		 */
+		if ((flags  SETATTR_CHSIZE)  PUFFS_USE_PAGECACHE(pmp)  
+		(vap-va_size  oldsize))
+			zerofill_lastpage(vp, vap-va_size);
+
 		pn-pn_serversize = vap-va_size;
 		if (flags  SETATTR_CHSIZE)
 			uvm_vnp_setsize(vp, vap-va_size);



CVS commit: [netbsd-6] src/lib/libperfuse

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:29:22 UTC 2014

Modified Files:
src/lib/libperfuse [netbsd-6]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1167):
lib/libperfuse/ops.c: revision 1.76
Report allocated bytes on FS correctly, instead of using file size
(which is wrong for sparse files)


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.14 -r1.50.2.15 src/lib/libperfuse/ops.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.50.2.14 src/lib/libperfuse/ops.c:1.50.2.15
--- src/lib/libperfuse/ops.c:1.50.2.14	Sun Nov  9 06:16:50 2014
+++ src/lib/libperfuse/ops.c	Sun Nov  9 06:29:22 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.50.2.14 2014/11/09 06:16:50 msaitoh Exp $ */
+/*  $NetBSD: ops.c,v 1.50.2.15 2014/11/09 06:29:22 msaitoh Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -321,7 +321,7 @@ fuse_attr_to_vap(struct perfuse_state *p
 	vap-va_gen = 0; 
 	vap-va_flags = 0;
 	vap-va_rdev = fa-rdev;
-	vap-va_bytes = fa-size;
+	vap-va_bytes = fa-blocks * S_BLKSIZE;
 	vap-va_filerev = (u_quad_t)PUFFS_VNOVAL;
 	vap-va_vaflags = 0;
 



CVS commit: [netbsd-6] src/sys/fs/msdosfs

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:37:01 UTC 2014

Modified Files:
src/sys/fs/msdosfs [netbsd-6]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1171):
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.110 via patch
- From me, FreeBSD, OpenBSD and the FAT specification. Ok christos@
  - Perform sanity checks not just for GEMDOSFS, but for all FAT devices. This
also fixes a division-by-zero bug that could crash the system.
  - Define GEMDOSFS_BSIZE instead of a hard-coded 512 value, and remove 'bsize'.
  - Rename 'tmp' to 'BlkPerSec'.
- Remove 'secsize==0' and added 'secsizeDEV_BSIZE'


To generate a diff of this commit:
cvs rdiff -u -r1.93.6.2 -r1.93.6.3 src/sys/fs/msdosfs/msdosfs_vfsops.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/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.2 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.3
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.2	Mon Apr 21 10:14:19 2014
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sun Nov  9 06:37:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.93.6.2 2014/04/21 10:14:19 bouyer Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.93.6.3 2014/11/09 06:37:00 msaitoh Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.93.6.2 2014/04/21 10:14:19 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.93.6.3 2014/11/09 06:37:00 msaitoh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -93,6 +93,8 @@ MODULE(MODULE_CLASS_VFS, msdos, NULL);
 #define DPRINTF(a)
 #endif
 
+#define GEMDOSFS_BSIZE	512
+
 #define MSDOSFS_NAMEMAX(pmp) \
 	(pmp)-pm_flags  MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12
 
@@ -474,8 +476,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 	struct byte_bpb50 *b50;
 	struct byte_bpb710 *b710;
 	uint8_t SecPerClust;
-	int	ronly, error, tmp;
-	int	bsize;
+	int	ronly, error, BlkPerSec;
 	uint64_t psize;
 	unsigned secsize;
 
@@ -493,7 +494,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 		goto error_exit;
 
 	error = getdisksize(devvp, psize, secsize);
-	if (error || secsize == 0) {
+	if (error) {
 		if (argp-flags  MSDOSFSMNT_GEMDOSFS)
 			goto error_exit;
 
@@ -502,16 +503,19 @@ msdosfs_mountfs(struct vnode *devvp, str
 		psize = 0;
 		error = 0;
 	}
+	if (secsize  DEV_BSIZE) {
+		DPRINTF((Invalid block secsize (%d  DEV_BSIZE), secsize));
+		error = EINVAL;
+		goto error_exit;
+	}
 
 	if (argp-flags  MSDOSFSMNT_GEMDOSFS) {
-		bsize = secsize;
-		if (bsize != 512) {
-			DPRINTF((Invalid block bsize %d for gemdos\n, bsize));
+		if (secsize != GEMDOSFS_BSIZE) {
+			DPRINTF((Invalid block secsize %d for GEMDOS\n, secsize));
 			error = EINVAL;
 			goto error_exit;
 		}
-	} else
-		bsize = 0;
+	}
 
 	/*
 	 * Read the boot sector of the filesystem, and then check the
@@ -555,19 +559,6 @@ msdosfs_mountfs(struct vnode *devvp, str
 	pmp-pm_Heads = getushort(b50-bpbHeads);
 	pmp-pm_Media = b50-bpbMedia;
 
-	if (!(argp-flags  MSDOSFSMNT_GEMDOSFS)) {
-		/* XXX - We should probably check more values here */
-		if (!pmp-pm_BytesPerSec || !SecPerClust
-			|| pmp-pm_SecPerTrack  63) {
-			DPRINTF((bytespersec %d secperclust %d 
-			secpertrack %d\n, 
-			pmp-pm_BytesPerSec, SecPerClust,
-			pmp-pm_SecPerTrack));
-			error = EINVAL;
-			goto error_exit;
-		}
-	}
-
 	if (pmp-pm_Sectors == 0) {
 		pmp-pm_HiddenSects = getulong(b50-bpbHiddenSecs);
 		pmp-pm_HugeSectors = getulong(b50-bpbHugeSectors);
@@ -576,6 +567,29 @@ msdosfs_mountfs(struct vnode *devvp, str
 		pmp-pm_HugeSectors = pmp-pm_Sectors;
 	}
 
+	/*
+	 * Sanity checks, from the FAT specification:
+	 * - sectors per cluster: = 1, power of 2
+	 * - logical sector size: = 1, power of 2
+	 * - cluster size:= max FS block size
+	 * - number of sectors:   = 1
+	 */
+	if ((SecPerClust == 0) || !powerof2(SecPerClust) ||
+	(pmp-pm_BytesPerSec == 0) || !powerof2(pmp-pm_BytesPerSec) ||
+	(SecPerClust * pmp-pm_BytesPerSec  MAXBSIZE) ||
+	(pmp-pm_HugeSectors == 0)) {
+		DPRINTF((consistency checks\n));
+		error = EINVAL;
+		goto error_exit;
+	}
+
+	if (!(argp-flags  MSDOSFSMNT_GEMDOSFS) 
+	(pmp-pm_SecPerTrack  63)) {
+		DPRINTF((SecPerTrack %d\n, pmp-pm_SecPerTrack));
+		error = EINVAL;
+		goto error_exit;
+	}
+
 	if (pmp-pm_RootDirEnts == 0) {
 		unsigned short vers = getushort(b710-bpbFSVers);
 		/*
@@ -614,17 +628,12 @@ msdosfs_mountfs(struct vnode *devvp, str
 
 		/*
 		 * Check a few values (could do some more):
-		 * - logical sector size: power of 2, = block size
-		 * - sectors per cluster: power of 2, = 1
-		 * - number of sectors:   = 1, = size of partition
+		 * - logical sector size: = block size
+		 * - number of sectors:   = size of partition
 		 */
-		if ( (SecPerClust == 0)
-		  || (SecPerClust  

CVS commit: [netbsd-6-0] src/sys/fs/msdosfs

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:39:13 UTC 2014

Modified Files:
src/sys/fs/msdosfs [netbsd-6-0]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1171):
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.110 via patch
- From me, FreeBSD, OpenBSD and the FAT specification. Ok christos@
  - Perform sanity checks not just for GEMDOSFS, but for all FAT devices. This
also fixes a division-by-zero bug that could crash the system.
  - Define GEMDOSFS_BSIZE instead of a hard-coded 512 value, and remove 'bsize'.
  - Rename 'tmp' to 'BlkPerSec'.
- Remove 'secsize==0' and added 'secsizeDEV_BSIZE'


To generate a diff of this commit:
cvs rdiff -u -r1.93.6.1.4.1 -r1.93.6.1.4.2 \
src/sys/fs/msdosfs/msdosfs_vfsops.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/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.1.4.1 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.1.4.2
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.1.4.1	Mon Apr 21 10:15:37 2014
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sun Nov  9 06:39:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.93.6.1.4.1 2014/04/21 10:15:37 bouyer Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.93.6.1.4.2 2014/11/09 06:39:12 msaitoh Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.93.6.1.4.1 2014/04/21 10:15:37 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.93.6.1.4.2 2014/11/09 06:39:12 msaitoh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -93,6 +93,8 @@ MODULE(MODULE_CLASS_VFS, msdos, NULL);
 #define DPRINTF(a)
 #endif
 
+#define GEMDOSFS_BSIZE	512
+
 #define MSDOSFS_NAMEMAX(pmp) \
 	(pmp)-pm_flags  MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12
 
@@ -474,8 +476,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 	struct byte_bpb50 *b50;
 	struct byte_bpb710 *b710;
 	uint8_t SecPerClust;
-	int	ronly, error, tmp;
-	int	bsize;
+	int	ronly, error, BlkPerSec;
 	uint64_t psize;
 	unsigned secsize;
 
@@ -493,7 +494,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 		goto error_exit;
 
 	error = getdisksize(devvp, psize, secsize);
-	if (error || secsize == 0) {
+	if (error) {
 		if (argp-flags  MSDOSFSMNT_GEMDOSFS)
 			goto error_exit;
 
@@ -502,16 +503,19 @@ msdosfs_mountfs(struct vnode *devvp, str
 		psize = 0;
 		error = 0;
 	}
+	if (secsize  DEV_BSIZE) {
+		DPRINTF((Invalid block secsize (%d  DEV_BSIZE), secsize));
+		error = EINVAL;
+		goto error_exit;
+	}
 
 	if (argp-flags  MSDOSFSMNT_GEMDOSFS) {
-		bsize = secsize;
-		if (bsize != 512) {
-			DPRINTF((Invalid block bsize %d for gemdos\n, bsize));
+		if (secsize != GEMDOSFS_BSIZE) {
+			DPRINTF((Invalid block secsize %d for GEMDOS\n, secsize));
 			error = EINVAL;
 			goto error_exit;
 		}
-	} else
-		bsize = 0;
+	}
 
 	/*
 	 * Read the boot sector of the filesystem, and then check the
@@ -555,19 +559,6 @@ msdosfs_mountfs(struct vnode *devvp, str
 	pmp-pm_Heads = getushort(b50-bpbHeads);
 	pmp-pm_Media = b50-bpbMedia;
 
-	if (!(argp-flags  MSDOSFSMNT_GEMDOSFS)) {
-		/* XXX - We should probably check more values here */
-		if (!pmp-pm_BytesPerSec || !SecPerClust
-			|| pmp-pm_SecPerTrack  63) {
-			DPRINTF((bytespersec %d secperclust %d 
-			secpertrack %d\n, 
-			pmp-pm_BytesPerSec, SecPerClust,
-			pmp-pm_SecPerTrack));
-			error = EINVAL;
-			goto error_exit;
-		}
-	}
-
 	if (pmp-pm_Sectors == 0) {
 		pmp-pm_HiddenSects = getulong(b50-bpbHiddenSecs);
 		pmp-pm_HugeSectors = getulong(b50-bpbHugeSectors);
@@ -576,6 +567,29 @@ msdosfs_mountfs(struct vnode *devvp, str
 		pmp-pm_HugeSectors = pmp-pm_Sectors;
 	}
 
+	/*
+	 * Sanity checks, from the FAT specification:
+	 * - sectors per cluster: = 1, power of 2
+	 * - logical sector size: = 1, power of 2
+	 * - cluster size:= max FS block size
+	 * - number of sectors:   = 1
+	 */
+	if ((SecPerClust == 0) || !powerof2(SecPerClust) ||
+	(pmp-pm_BytesPerSec == 0) || !powerof2(pmp-pm_BytesPerSec) ||
+	(SecPerClust * pmp-pm_BytesPerSec  MAXBSIZE) ||
+	(pmp-pm_HugeSectors == 0)) {
+		DPRINTF((consistency checks\n));
+		error = EINVAL;
+		goto error_exit;
+	}
+
+	if (!(argp-flags  MSDOSFSMNT_GEMDOSFS) 
+	(pmp-pm_SecPerTrack  63)) {
+		DPRINTF((SecPerTrack %d\n, pmp-pm_SecPerTrack));
+		error = EINVAL;
+		goto error_exit;
+	}
+
 	if (pmp-pm_RootDirEnts == 0) {
 		unsigned short vers = getushort(b710-bpbFSVers);
 		/*
@@ -614,17 +628,12 @@ msdosfs_mountfs(struct vnode *devvp, str
 
 		/*
 		 * Check a few values (could do some more):
-		 * - logical sector size: power of 2, = block size
-		 * - sectors per cluster: power of 2, = 1
-		 * - number of sectors:   = 1, = size of partition
+		 * - logical sector size: = block size
+		 * - number of sectors:   = size of partition
 		 */
-		if ( 

CVS commit: [netbsd-6-1] src/sys/fs/msdosfs

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:38:55 UTC 2014

Modified Files:
src/sys/fs/msdosfs [netbsd-6-1]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1171):
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.110 via patch
- From me, FreeBSD, OpenBSD and the FAT specification. Ok christos@
  - Perform sanity checks not just for GEMDOSFS, but for all FAT devices. This
also fixes a division-by-zero bug that could crash the system.
  - Define GEMDOSFS_BSIZE instead of a hard-coded 512 value, and remove 'bsize'.
  - Rename 'tmp' to 'BlkPerSec'.
- Remove 'secsize==0' and added 'secsizeDEV_BSIZE'


To generate a diff of this commit:
cvs rdiff -u -r1.93.6.1.6.1 -r1.93.6.1.6.2 \
src/sys/fs/msdosfs/msdosfs_vfsops.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/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.1.6.1 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.1.6.2
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.93.6.1.6.1	Mon Apr 21 10:17:48 2014
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sun Nov  9 06:38:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.93.6.1.6.1 2014/04/21 10:17:48 bouyer Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.93.6.1.6.2 2014/11/09 06:38:55 msaitoh Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.93.6.1.6.1 2014/04/21 10:17:48 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.93.6.1.6.2 2014/11/09 06:38:55 msaitoh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -93,6 +93,8 @@ MODULE(MODULE_CLASS_VFS, msdos, NULL);
 #define DPRINTF(a)
 #endif
 
+#define GEMDOSFS_BSIZE	512
+
 #define MSDOSFS_NAMEMAX(pmp) \
 	(pmp)-pm_flags  MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12
 
@@ -474,8 +476,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 	struct byte_bpb50 *b50;
 	struct byte_bpb710 *b710;
 	uint8_t SecPerClust;
-	int	ronly, error, tmp;
-	int	bsize;
+	int	ronly, error, BlkPerSec;
 	uint64_t psize;
 	unsigned secsize;
 
@@ -493,7 +494,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 		goto error_exit;
 
 	error = getdisksize(devvp, psize, secsize);
-	if (error || secsize == 0) {
+	if (error) {
 		if (argp-flags  MSDOSFSMNT_GEMDOSFS)
 			goto error_exit;
 
@@ -502,16 +503,19 @@ msdosfs_mountfs(struct vnode *devvp, str
 		psize = 0;
 		error = 0;
 	}
+	if (secsize  DEV_BSIZE) {
+		DPRINTF((Invalid block secsize (%d  DEV_BSIZE), secsize));
+		error = EINVAL;
+		goto error_exit;
+	}
 
 	if (argp-flags  MSDOSFSMNT_GEMDOSFS) {
-		bsize = secsize;
-		if (bsize != 512) {
-			DPRINTF((Invalid block bsize %d for gemdos\n, bsize));
+		if (secsize != GEMDOSFS_BSIZE) {
+			DPRINTF((Invalid block secsize %d for GEMDOS\n, secsize));
 			error = EINVAL;
 			goto error_exit;
 		}
-	} else
-		bsize = 0;
+	}
 
 	/*
 	 * Read the boot sector of the filesystem, and then check the
@@ -555,19 +559,6 @@ msdosfs_mountfs(struct vnode *devvp, str
 	pmp-pm_Heads = getushort(b50-bpbHeads);
 	pmp-pm_Media = b50-bpbMedia;
 
-	if (!(argp-flags  MSDOSFSMNT_GEMDOSFS)) {
-		/* XXX - We should probably check more values here */
-		if (!pmp-pm_BytesPerSec || !SecPerClust
-			|| pmp-pm_SecPerTrack  63) {
-			DPRINTF((bytespersec %d secperclust %d 
-			secpertrack %d\n, 
-			pmp-pm_BytesPerSec, SecPerClust,
-			pmp-pm_SecPerTrack));
-			error = EINVAL;
-			goto error_exit;
-		}
-	}
-
 	if (pmp-pm_Sectors == 0) {
 		pmp-pm_HiddenSects = getulong(b50-bpbHiddenSecs);
 		pmp-pm_HugeSectors = getulong(b50-bpbHugeSectors);
@@ -576,6 +567,29 @@ msdosfs_mountfs(struct vnode *devvp, str
 		pmp-pm_HugeSectors = pmp-pm_Sectors;
 	}
 
+	/*
+	 * Sanity checks, from the FAT specification:
+	 * - sectors per cluster: = 1, power of 2
+	 * - logical sector size: = 1, power of 2
+	 * - cluster size:= max FS block size
+	 * - number of sectors:   = 1
+	 */
+	if ((SecPerClust == 0) || !powerof2(SecPerClust) ||
+	(pmp-pm_BytesPerSec == 0) || !powerof2(pmp-pm_BytesPerSec) ||
+	(SecPerClust * pmp-pm_BytesPerSec  MAXBSIZE) ||
+	(pmp-pm_HugeSectors == 0)) {
+		DPRINTF((consistency checks\n));
+		error = EINVAL;
+		goto error_exit;
+	}
+
+	if (!(argp-flags  MSDOSFSMNT_GEMDOSFS) 
+	(pmp-pm_SecPerTrack  63)) {
+		DPRINTF((SecPerTrack %d\n, pmp-pm_SecPerTrack));
+		error = EINVAL;
+		goto error_exit;
+	}
+
 	if (pmp-pm_RootDirEnts == 0) {
 		unsigned short vers = getushort(b710-bpbFSVers);
 		/*
@@ -614,17 +628,12 @@ msdosfs_mountfs(struct vnode *devvp, str
 
 		/*
 		 * Check a few values (could do some more):
-		 * - logical sector size: power of 2, = block size
-		 * - sectors per cluster: power of 2, = 1
-		 * - number of sectors:   = 1, = size of partition
+		 * - logical sector size: = block size
+		 * - number of sectors:   = size of partition
 		 */
-		if ( 

CVS commit: [netbsd-6] src/sys/arch/sparc64/sparc64

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:53:32 UTC 2014

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6]: machdep.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1176):
sys/arch/sparc64/sparc64/machdep.c: revision 1.280
sys/arch/sparc64/sparc64/machdep.c: revision 1.274
Remove duplicate/unused declarations.
Sync cpu_reboot with i386:
- avoid sync and unmount after panic.
- remove vfs_shutdown, we call vfs_sync_all and vfs_unmount* instead.
- resurrect doshutdownhooks since some drivers still use it (eg. sab(4)).


To generate a diff of this commit:
cvs rdiff -u -r1.265.2.1 -r1.265.2.2 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1 src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.2
--- src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1	Mon May 21 15:25:56 2012
+++ src/sys/arch/sparc64/sparc64/machdep.c	Sun Nov  9 06:53:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.265.2.1 2012/05/21 15:25:56 riz Exp $ */
+/*	$NetBSD: machdep.c,v 1.265.2.2 2014/11/09 06:53:32 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.265.2.1 2012/05/21 15:25:56 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.265.2.2 2014/11/09 06:53:32 msaitoh Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -156,13 +156,10 @@ extern vaddr_t avail_end;
 #ifdef MODULAR
 vaddr_t module_start, module_end;
 static struct vm_map module_map_store;
-extern struct vm_map *module_map;
 #endif
 
 int	physmem;
 
-extern	void *msgbufaddr;
-
 /*
  * Maximum number of DMA segments we'll allow in dmamem_load()
  * routines.  Can be overridden in config files, etc.
@@ -609,12 +606,13 @@ cpu_reboot(int howto, char *user_boot_st
 	 */
 	maybe_dump(howto);
 
-	if ((howto  RB_NOSYNC) == 0  !syncdone) {
-		extern struct lwp lwp0;
-
+	/*
+	 * If we've panic'd, don't make the situation potentially
+	 * worse by syncing or unmounting the file systems.
+	 */
+	if ((howto  RB_NOSYNC) == 0  panicstr == NULL) {
 		if (!syncdone) {
-		syncdone = true;
-		vfs_shutdown();
+			syncdone = true;
 			/* XXX used to force unmount as well, here */
 			vfs_sync_all(l);
 			/*
@@ -642,6 +640,7 @@ cpu_reboot(int howto, char *user_boot_st
 	splhigh();
 
 haltsys:
+	doshutdownhooks();
 
 #ifdef MULTIPROCESSOR
 	/* Stop all secondary cpus */



CVS commit: [netbsd-6-0] src/sys/arch/sparc64/sparc64

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:55:34 UTC 2014

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-0]: machdep.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1176):
sys/arch/sparc64/sparc64/machdep.c: revision 1.280
sys/arch/sparc64/sparc64/machdep.c: revision 1.274
Remove duplicate/unused declarations.
Sync cpu_reboot with i386:
- avoid sync and unmount after panic.
- remove vfs_shutdown, we call vfs_sync_all and vfs_unmount* instead.
- resurrect doshutdownhooks since some drivers still use it (eg. sab(4)).


To generate a diff of this commit:
cvs rdiff -u -r1.265.2.1 -r1.265.2.1.4.1 \
src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1 src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1.4.1
--- src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1	Mon May 21 15:25:56 2012
+++ src/sys/arch/sparc64/sparc64/machdep.c	Sun Nov  9 06:55:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.265.2.1 2012/05/21 15:25:56 riz Exp $ */
+/*	$NetBSD: machdep.c,v 1.265.2.1.4.1 2014/11/09 06:55:34 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.265.2.1 2012/05/21 15:25:56 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.265.2.1.4.1 2014/11/09 06:55:34 msaitoh Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -156,13 +156,10 @@ extern vaddr_t avail_end;
 #ifdef MODULAR
 vaddr_t module_start, module_end;
 static struct vm_map module_map_store;
-extern struct vm_map *module_map;
 #endif
 
 int	physmem;
 
-extern	void *msgbufaddr;
-
 /*
  * Maximum number of DMA segments we'll allow in dmamem_load()
  * routines.  Can be overridden in config files, etc.
@@ -609,12 +606,13 @@ cpu_reboot(int howto, char *user_boot_st
 	 */
 	maybe_dump(howto);
 
-	if ((howto  RB_NOSYNC) == 0  !syncdone) {
-		extern struct lwp lwp0;
-
+	/*
+	 * If we've panic'd, don't make the situation potentially
+	 * worse by syncing or unmounting the file systems.
+	 */
+	if ((howto  RB_NOSYNC) == 0  panicstr == NULL) {
 		if (!syncdone) {
-		syncdone = true;
-		vfs_shutdown();
+			syncdone = true;
 			/* XXX used to force unmount as well, here */
 			vfs_sync_all(l);
 			/*
@@ -642,6 +640,7 @@ cpu_reboot(int howto, char *user_boot_st
 	splhigh();
 
 haltsys:
+	doshutdownhooks();
 
 #ifdef MULTIPROCESSOR
 	/* Stop all secondary cpus */



CVS commit: [netbsd-6-1] src/sys/arch/sparc64/sparc64

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 06:55:14 UTC 2014

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-1]: machdep.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1176):
sys/arch/sparc64/sparc64/machdep.c: revision 1.280
sys/arch/sparc64/sparc64/machdep.c: revision 1.274
Remove duplicate/unused declarations.
Sync cpu_reboot with i386:
- avoid sync and unmount after panic.
- remove vfs_shutdown, we call vfs_sync_all and vfs_unmount* instead.
- resurrect doshutdownhooks since some drivers still use it (eg. sab(4)).


To generate a diff of this commit:
cvs rdiff -u -r1.265.2.1 -r1.265.2.1.6.1 \
src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1 src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1.6.1
--- src/sys/arch/sparc64/sparc64/machdep.c:1.265.2.1	Mon May 21 15:25:56 2012
+++ src/sys/arch/sparc64/sparc64/machdep.c	Sun Nov  9 06:55:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.265.2.1 2012/05/21 15:25:56 riz Exp $ */
+/*	$NetBSD: machdep.c,v 1.265.2.1.6.1 2014/11/09 06:55:14 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.265.2.1 2012/05/21 15:25:56 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.265.2.1.6.1 2014/11/09 06:55:14 msaitoh Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -156,13 +156,10 @@ extern vaddr_t avail_end;
 #ifdef MODULAR
 vaddr_t module_start, module_end;
 static struct vm_map module_map_store;
-extern struct vm_map *module_map;
 #endif
 
 int	physmem;
 
-extern	void *msgbufaddr;
-
 /*
  * Maximum number of DMA segments we'll allow in dmamem_load()
  * routines.  Can be overridden in config files, etc.
@@ -609,12 +606,13 @@ cpu_reboot(int howto, char *user_boot_st
 	 */
 	maybe_dump(howto);
 
-	if ((howto  RB_NOSYNC) == 0  !syncdone) {
-		extern struct lwp lwp0;
-
+	/*
+	 * If we've panic'd, don't make the situation potentially
+	 * worse by syncing or unmounting the file systems.
+	 */
+	if ((howto  RB_NOSYNC) == 0  panicstr == NULL) {
 		if (!syncdone) {
-		syncdone = true;
-		vfs_shutdown();
+			syncdone = true;
 			/* XXX used to force unmount as well, here */
 			vfs_sync_all(l);
 			/*
@@ -642,6 +640,7 @@ cpu_reboot(int howto, char *user_boot_st
 	splhigh();
 
 haltsys:
+	doshutdownhooks();
 
 #ifdef MULTIPROCESSOR
 	/* Stop all secondary cpus */



CVS commit: [netbsd-6] src/lib/libperfuse

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:02:57 UTC 2014

Modified Files:
src/lib/libperfuse [netbsd-6]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1177):
lib/libperfuse/ops.c: revision 1.77
Fix invalid free in deletextattr FUSE handler
Do not free FUSE message on error as it was not allocated.


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.15 -r1.50.2.16 src/lib/libperfuse/ops.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.50.2.15 src/lib/libperfuse/ops.c:1.50.2.16
--- src/lib/libperfuse/ops.c:1.50.2.15	Sun Nov  9 06:29:22 2014
+++ src/lib/libperfuse/ops.c	Sun Nov  9 07:02:57 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.50.2.15 2014/11/09 06:29:22 msaitoh Exp $ */
+/*  $NetBSD: ops.c,v 1.50.2.16 2014/11/09 07:02:57 msaitoh Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -3623,9 +3623,11 @@ perfuse_node_deleteextattr(struct puffs_
 	(void)strlcpy(np, attrname, attrnamelen);
 	
 	error = xchg_msg(pu, opc, pm, NO_PAYLOAD_REPLY_LEN, wait_reply);
+	if (error != 0)
+		goto out;
 	
 	ps-ps_destroy_msg(pm);
-
+out:
 	node_rele(opc);
 	return error;
 }



CVS commit: [netbsd-6] src/sys/compat/netbsd32

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:09:17 UTC 2014

Modified Files:
src/sys/compat/netbsd32 [netbsd-6]: netbsd32_compat_50.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1179):
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.28
fix multiple mistakes:
- error from copyout was ignored
- the wrong size was specified in copyin
- missing locking.


To generate a diff of this commit:
cvs rdiff -u -r1.20.6.1 -r1.20.6.2 \
src/sys/compat/netbsd32/netbsd32_compat_50.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/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.6.1 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.6.2
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.6.1	Mon Jun 30 12:09:40 2014
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sun Nov  9 07:09:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.20.6.1 2014/06/30 12:09:40 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.20.6.2 2014/11/09 07:09:17 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.20.6.1 2014/06/30 12:09:40 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.20.6.2 2014/11/09 07:09:17 msaitoh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_sysv.h
@@ -248,30 +248,31 @@ compat_50_netbsd32_adjtime(struct lwp *l
 		return (error);
 
 	if (SCARG_P32(uap, olddelta)) {
+		mutex_spin_enter(timecounter_lock);
 		atv.tv_sec = time_adjtime / 100;
 		atv.tv_usec = time_adjtime % 100;
 		if (atv.tv_usec  0) {
 			atv.tv_usec += 100;
 			atv.tv_sec--;
 		}
-		(void) copyout(atv,
-			   SCARG_P32(uap, olddelta), 
-			   sizeof(atv));
+		mutex_spin_exit(timecounter_lock);
+
+		error = copyout(atv, SCARG_P32(uap, olddelta), sizeof(atv));
 		if (error)
 			return (error);
 	}
 	
 	if (SCARG_P32(uap, delta)) {
-		error = copyin(SCARG_P32(uap, delta), atv,
-			   sizeof(struct timeval));
+		error = copyin(SCARG_P32(uap, delta), atv, sizeof(atv));
 		if (error)
 			return (error);
 
+		mutex_spin_enter(timecounter_lock);
 		time_adjtime = (int64_t)atv.tv_sec * 100 + atv.tv_usec;
-
 		if (time_adjtime)
 			/* We need to save the system time during shutdown */
 			time_adjusted |= 1;
+		mutex_spin_exit(timecounter_lock);
 	}
 
 	return 0;



CVS commit: [netbsd-6-0] src/sys/compat/netbsd32

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:10:23 UTC 2014

Modified Files:
src/sys/compat/netbsd32 [netbsd-6-0]: netbsd32_compat_50.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1179):
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.28
fix multiple mistakes:
- error from copyout was ignored
- the wrong size was specified in copyin
- missing locking.


To generate a diff of this commit:
cvs rdiff -u -r1.20.12.1 -r1.20.12.2 \
src/sys/compat/netbsd32/netbsd32_compat_50.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/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.12.1 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.12.2
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.12.1	Mon Jun 30 12:10:25 2014
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sun Nov  9 07:10:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.20.12.1 2014/06/30 12:10:25 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.20.12.2 2014/11/09 07:10:23 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.20.12.1 2014/06/30 12:10:25 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.20.12.2 2014/11/09 07:10:23 msaitoh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_sysv.h
@@ -248,30 +248,31 @@ compat_50_netbsd32_adjtime(struct lwp *l
 		return (error);
 
 	if (SCARG_P32(uap, olddelta)) {
+		mutex_spin_enter(timecounter_lock);
 		atv.tv_sec = time_adjtime / 100;
 		atv.tv_usec = time_adjtime % 100;
 		if (atv.tv_usec  0) {
 			atv.tv_usec += 100;
 			atv.tv_sec--;
 		}
-		(void) copyout(atv,
-			   SCARG_P32(uap, olddelta), 
-			   sizeof(atv));
+		mutex_spin_exit(timecounter_lock);
+
+		error = copyout(atv, SCARG_P32(uap, olddelta), sizeof(atv));
 		if (error)
 			return (error);
 	}
 	
 	if (SCARG_P32(uap, delta)) {
-		error = copyin(SCARG_P32(uap, delta), atv,
-			   sizeof(struct timeval));
+		error = copyin(SCARG_P32(uap, delta), atv, sizeof(atv));
 		if (error)
 			return (error);
 
+		mutex_spin_enter(timecounter_lock);
 		time_adjtime = (int64_t)atv.tv_sec * 100 + atv.tv_usec;
-
 		if (time_adjtime)
 			/* We need to save the system time during shutdown */
 			time_adjusted |= 1;
+		mutex_spin_exit(timecounter_lock);
 	}
 
 	return 0;



CVS commit: [netbsd-6-1] src/sys/compat/netbsd32

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:10:08 UTC 2014

Modified Files:
src/sys/compat/netbsd32 [netbsd-6-1]: netbsd32_compat_50.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1179):
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.28
fix multiple mistakes:
- error from copyout was ignored
- the wrong size was specified in copyin
- missing locking.


To generate a diff of this commit:
cvs rdiff -u -r1.20.14.1 -r1.20.14.2 \
src/sys/compat/netbsd32/netbsd32_compat_50.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/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.14.1 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.14.2
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.20.14.1	Mon Jun 30 12:10:05 2014
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sun Nov  9 07:10:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.20.14.1 2014/06/30 12:10:05 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.20.14.2 2014/11/09 07:10:08 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.20.14.1 2014/06/30 12:10:05 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.20.14.2 2014/11/09 07:10:08 msaitoh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_sysv.h
@@ -248,30 +248,31 @@ compat_50_netbsd32_adjtime(struct lwp *l
 		return (error);
 
 	if (SCARG_P32(uap, olddelta)) {
+		mutex_spin_enter(timecounter_lock);
 		atv.tv_sec = time_adjtime / 100;
 		atv.tv_usec = time_adjtime % 100;
 		if (atv.tv_usec  0) {
 			atv.tv_usec += 100;
 			atv.tv_sec--;
 		}
-		(void) copyout(atv,
-			   SCARG_P32(uap, olddelta), 
-			   sizeof(atv));
+		mutex_spin_exit(timecounter_lock);
+
+		error = copyout(atv, SCARG_P32(uap, olddelta), sizeof(atv));
 		if (error)
 			return (error);
 	}
 	
 	if (SCARG_P32(uap, delta)) {
-		error = copyin(SCARG_P32(uap, delta), atv,
-			   sizeof(struct timeval));
+		error = copyin(SCARG_P32(uap, delta), atv, sizeof(atv));
 		if (error)
 			return (error);
 
+		mutex_spin_enter(timecounter_lock);
 		time_adjtime = (int64_t)atv.tv_sec * 100 + atv.tv_usec;
-
 		if (time_adjtime)
 			/* We need to save the system time during shutdown */
 			time_adjusted |= 1;
+		mutex_spin_exit(timecounter_lock);
 	}
 
 	return 0;



CVS commit: [netbsd-6] xsrc/external/mit/libXt/dist/src

2014-11-08 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Nov  9 07:17:51 UTC 2014

Modified Files:
xsrc/external/mit/libXt/dist/src [netbsd-6]: ResConfig.c

Log Message:
Pull up following revision(s) (requested by snj in ticket #1181):
xsrc/external/mit/libXt/dist/src/ResConfig.cpatch

Fix DEBUG build of libXt.  From Sandro Millien in PR xsrc/48863.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.2.1 -r1.1.1.4.2.2 \
xsrc/external/mit/libXt/dist/src/ResConfig.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/libXt/dist/src/ResConfig.c
diff -u xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.2.1 xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.2.2
--- xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.2.1	Thu Jun  6 03:44:26 2013
+++ xsrc/external/mit/libXt/dist/src/ResConfig.c	Sun Nov  9 07:17:51 2014
@@ -988,7 +988,7 @@ _XtResourceConfigurationEH (
 resource = XtNewString (data_ptr);
 value = XtNewString (data_value);
 #ifdef DEBUG
-fprintf (stderr, resource_len=%d\n
+fprintf (stderr, resource_len=%d\n,
 	 resource_len);
 fprintf (stderr, resource = %s\t value = %s\n,
 	 resource, value);



CVS commit: [netbsd-6-1] xsrc/external/mit/libXt/dist/src

2014-11-08 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Nov  9 07:18:25 UTC 2014

Modified Files:
xsrc/external/mit/libXt/dist/src [netbsd-6-1]: ResConfig.c

Log Message:
Pull up following revision(s) (requested by snj in ticket #1181):
xsrc/external/mit/libXt/dist/src/ResConfig.cpatch

Fix DEBUG build of libXt.  From Sandro Millien in PR xsrc/48863.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.6.1 -r1.1.1.4.6.2 \
xsrc/external/mit/libXt/dist/src/ResConfig.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/libXt/dist/src/ResConfig.c
diff -u xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.6.1 xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.6.2
--- xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.6.1	Thu Jun  6 03:50:17 2013
+++ xsrc/external/mit/libXt/dist/src/ResConfig.c	Sun Nov  9 07:18:25 2014
@@ -988,7 +988,7 @@ _XtResourceConfigurationEH (
 resource = XtNewString (data_ptr);
 value = XtNewString (data_value);
 #ifdef DEBUG
-fprintf (stderr, resource_len=%d\n
+fprintf (stderr, resource_len=%d\n,
 	 resource_len);
 fprintf (stderr, resource = %s\t value = %s\n,
 	 resource, value);



CVS commit: [netbsd-6-0] xsrc/external/mit/libXt/dist/src

2014-11-08 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Nov  9 07:19:01 UTC 2014

Modified Files:
xsrc/external/mit/libXt/dist/src [netbsd-6-0]: ResConfig.c

Log Message:
Pull up following revision(s) (requested by snj in ticket #1181):
xsrc/external/mit/libXt/dist/src/ResConfig.cpatch

Fix DEBUG build of libXt.  From Sandro Millien in PR xsrc/48863.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.4.1 -r1.1.1.4.4.2 \
xsrc/external/mit/libXt/dist/src/ResConfig.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/libXt/dist/src/ResConfig.c
diff -u xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.4.1 xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.4.2
--- xsrc/external/mit/libXt/dist/src/ResConfig.c:1.1.1.4.4.1	Thu Jun  6 03:52:05 2013
+++ xsrc/external/mit/libXt/dist/src/ResConfig.c	Sun Nov  9 07:19:01 2014
@@ -988,7 +988,7 @@ _XtResourceConfigurationEH (
 resource = XtNewString (data_ptr);
 value = XtNewString (data_value);
 #ifdef DEBUG
-fprintf (stderr, resource_len=%d\n
+fprintf (stderr, resource_len=%d\n,
 	 resource_len);
 fprintf (stderr, resource = %s\t value = %s\n,
 	 resource, value);



CVS commit: [netbsd-6] src/sys/arch/luna68k

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:34:12 UTC 2014

Modified Files:
src/sys/arch/luna68k/conf [netbsd-6]: GENERIC files.luna68k
src/sys/arch/luna68k/dev [netbsd-6]: lunafb.c lunaws.c omrasops.c
omrasopsvar.h
Added Files:
src/sys/arch/luna68k/dev [netbsd-6]: omkbdmap.c omkbdmap.h

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1182):
sys/arch/luna68k/conf/files.luna68k: revision 1.24
sys/arch/luna68k/conf/GENERIC: revision 1.113 via patch
sys/arch/luna68k/dev/omrasops.c: revision 1.17-1.19
sys/arch/luna68k/dev/lunaws.c: revision 1.30
sys/arch/luna68k/dev/omkbdmap.c: revision 1.1-1.2
sys/arch/luna68k/dev/omkbdmap.h: revision 1.1
sys/arch/luna68k/dev/lunafb.c: revision 1.31-1.36
sys/arch/luna68k/dev/omrasopsvar.h: revision 1.3
- Setup Bt458 color palette to support ANSI color text on 8bpp framebuffer.
  Mostly taken from OpenBSD/luna88k.  Also sync some comments.
  Tested on LUNA-II, and mlterm-fb with 8bpp wallpaper also works fine.
  Thanks to Kenji Aoyama (OpenBSD/luna88k maintainer) for providing
  his spare 8bpp board.
- Use C99 struct initialization for wsdisplay_accessops.
- Use kmem(9) instead of malloc(9).
- Pull LUNA's keyboard driver changes from OpenBSD/luna88k. Now LUNA's
  keyboard works on Xorg server without tweaks by xmodmap(1) etc.
  - split keyboard mapping definitions to new files, omkbdmap.[ch]
  - add WSDISPLAY_COMPAT_RAWKBD support
(actually the name is wrong; it doesn't emit raw keycode but
 converts MD code into PS/2 one as raw keycode on x86 for Xorg server)
  - allow to enter into ddb by CTRL+ALT(zenmen)+ESC
  - remove unnecessary return values
- Add consistent prefix to a softc member name.
- Implement WSDISPLAYIO_SMODE ioctl for proper mmap and colormap handling.
  Tested on LUNA with 4bpp framebuffer.
  - allow mmap framebuffer memories only in WSDISPLAYIO_DUMBFB
  - initialize palette for ANSI text colors on back to WSDISPLAYIO_MODE_EMUL
- Pull readability changes from OpenBSD/luna88k.
  Tested on LUNA-II with 8bpp framebuffer.
  - prepare and use unpack_attr() function to get fg and bg from attribute
  - use proper variable names to clarify meanings
- Put dumb optimizations to avoid conditionals in putchar drawing loops.
  ~10% improvements of time cat results on LUNA-II 8bpp framebuffer.
- Fix unintended RCS Id substitution.
- Pull LUNA's framebuffer improvements by Kenji Aoyama from OpenBSD/luna88k.
  This Makes 4bpp wscons putchar ~30% on LUNA-II.
  http://marc.info/?l=openbsd-cvsm=141199909120631w=2
   Use raster(logic) operation, or ROP, function on LUNA frame buffer.
   It makes 4bpp wscons putchar ~20% faster.
  Also use the similar ROP in 1bpp putchar and cursor functions
  and the 1bpp putchar is also ~5% faster.
  While here, reduce diffs from OpenBSD a bit.
  Tested on all 1bpp/4bpp/8bpp framebuffers.
- Add options WSDISPLAY_COMPAT_RAWKBD for Xorg server.


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.2 -r1.97.2.3 src/sys/arch/luna68k/conf/GENERIC
cvs rdiff -u -r1.23 -r1.23.6.1 src/sys/arch/luna68k/conf/files.luna68k
cvs rdiff -u -r1.25.8.2 -r1.25.8.3 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -u -r1.23.8.2 -r1.23.8.3 src/sys/arch/luna68k/dev/lunaws.c
cvs rdiff -u -r0 -r1.2.2.2 src/sys/arch/luna68k/dev/omkbdmap.c
cvs rdiff -u -r0 -r1.1.8.2 src/sys/arch/luna68k/dev/omkbdmap.h
cvs rdiff -u -r1.11.8.2 -r1.11.8.3 src/sys/arch/luna68k/dev/omrasops.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/luna68k/dev/omrasopsvar.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/luna68k/conf/GENERIC
diff -u src/sys/arch/luna68k/conf/GENERIC:1.97.2.2 src/sys/arch/luna68k/conf/GENERIC:1.97.2.3
--- src/sys/arch/luna68k/conf/GENERIC:1.97.2.2	Sun Jan 12 12:08:36 2014
+++ src/sys/arch/luna68k/conf/GENERIC	Sun Nov  9 07:34:12 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.97.2.2 2014/01/12 12:08:36 bouyer Exp $
+# $NetBSD: GENERIC,v 1.97.2.3 2014/11/09 07:34:12 msaitoh Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		arch/luna68k/conf/std.luna68k
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.97.2.2 $
+#ident 		GENERIC-$Revision: 1.97.2.3 $
 
 maxusers	8
 
@@ -138,6 +138,7 @@ options 	NFS_BOOT_DHCP	# superset of BOO
 
 # WS console uses SUN or VT100 terminal emulation
 options 	WSEMUL_VT100
+options 	WSDISPLAY_COMPAT_RAWKBD
 options 	FONT_OMRON12x20
 
 config		netbsd root on ? type ?

Index: src/sys/arch/luna68k/conf/files.luna68k
diff -u src/sys/arch/luna68k/conf/files.luna68k:1.23 src/sys/arch/luna68k/conf/files.luna68k:1.23.6.1
--- src/sys/arch/luna68k/conf/files.luna68k:1.23	Tue Nov 15 13:25:44 2011
+++ src/sys/arch/luna68k/conf/files.luna68k	Sun Nov  9 07:34:12 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: files.luna68k,v 1.23 

CVS commit: [netbsd-6] xsrc/external/mit/xf86-video-wsfb/dist/src

2014-11-08 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Nov  9 07:40:31 UTC 2014

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src [netbsd-6]: wsfb_driver.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1183):
external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c: revision 1.22
external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c: revision 1.23
external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c: revision 1.25
Fix wrong VRAM size calculation on old drivers without GET_FBINFO ioctl.
The linebytes is a byte number of width so it should be
(linebytes * height), not (width * linebytes).
XXX: I'm not sure where WSDISPLAYIO_GET_FBINFO implementation was discussed
 but I wonder if we should use proper ifdef or macro to share this
 third party Xorg driver with OpenBSD...
No need to handle colormap ioctls if cmsize == 0 even in WSFB_CI case.
Add kludge to use luna68k 4/8bpp framebuffers as a monochrome server.
The idea is taken from mlterm-fb --depth option implementation.
This change should not affect other framebuffer types.
Tested on 4bpp on LUNA and 1bpp/8bpp on LUNA-II.


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.3 -r1.13.2.4 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.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/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.13.2.3 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.13.2.4
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.13.2.3	Thu Aug  7 09:07:36 2014
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c	Sun Nov  9 07:40:31 2014
@@ -406,7 +406,7 @@ static Bool
 WsfbPreInit(ScrnInfoPtr pScrn, int flags)
 {
 	WsfbPtr fPtr;
-	int default_depth, wstype;
+	int default_depth, bitsperpixel, wstype;
 	char *dev, *s;
 	char *mod = NULL;
 	const char *reqSym = NULL;
@@ -498,13 +498,14 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 			fbi-fbi_subtype.fbi_cmapinfo.cmap_entries = info.cmsize;
 		}
 		fbi-fbi_flags = 0;
-		fbi-fbi_fbsize = info.width * lb;
+		fbi-fbi_fbsize = lb * info.height;
 
 	}
 	/*
 	 * Allocate room for saving the colormap.
 	 */
-	if (fPtr-fbi.fbi_pixeltype == WSFB_CI) {
+	if (fPtr-fbi.fbi_pixeltype == WSFB_CI 
+	fPtr-fbi.fbi_subtype.fbi_cmapinfo.cmap_entries  0) {
 		fPtr-saved_cmap.red =
 		(unsigned char *)xalloc(fPtr-fbi.fbi_subtype.fbi_cmapinfo.cmap_entries);
 		if (fPtr-saved_cmap.red == NULL) {
@@ -536,17 +537,34 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 
 	/* Handle depth */
 	default_depth = fPtr-fbi.fbi_bitsperpixel = 24 ? fPtr-fbi.fbi_bitsperpixel : 24;
+	bitsperpixel = fPtr-fbi.fbi_bitsperpixel;
+#if defined(__NetBSD__)  defined(WSDISPLAY_TYPE_LUNA)
+	if (wstype == WSDISPLAY_TYPE_LUNA) {
+		/*
+		 * XXX
+		 * LUNA's color framebuffers support 4bpp or 8bpp
+		 * but they have multiple 1bpp VRAM planes like ancient VGA.
+		 * For now, Xorg server supports only the first one plane
+		 * as 1bpp monochrome server.
+		 *
+		 * Note OpenBSD/luna88k workarounds this by switching depth
+		 * and palette settings by WSDISPLAYIO_SETGFXMODE ioctl.
+		 */
+		default_depth = 1;
+		bitsperpixel = 1;
+	}
+#endif
 	if (!xf86SetDepthBpp(pScrn, default_depth, default_depth,
-		fPtr-fbi.fbi_bitsperpixel,
-		fPtr-fbi.fbi_bitsperpixel = 24 ? Support24bppFb|Support32bppFb : 0))
+		bitsperpixel,
+		bitsperpixel = 24 ? Support24bppFb|Support32bppFb : 0))
 		return FALSE;
 
 	/* Check consistency. */
-	if (pScrn-bitsPerPixel != fPtr-fbi.fbi_bitsperpixel) {
+	if (pScrn-bitsPerPixel != bitsperpixel) {
 		xf86DrvMsg(pScrn-scrnIndex, X_ERROR,
 		specified depth (%d) or bpp (%d) doesn't match 
 		framebuffer depth (%d)\n, pScrn-depth, 
-		pScrn-bitsPerPixel, fPtr-fbi.fbi_bitsperpixel);
+		pScrn-bitsPerPixel, bitsperpixel);
 		return FALSE;
 	}
 	xf86PrintDepthBpp(pScrn);
@@ -1026,6 +1044,35 @@ WsfbScreenInit(int scrnIndex, ScreenPtr 
 NULL, flags))
 		return FALSE;
 
+#if defined(__NetBSD__)  defined(WSDISPLAY_TYPE_LUNA)
+	if (wstype == WSDISPLAY_TYPE_LUNA) {
+		ncolors = fPtr-fbi.fbi_subtype.fbi_cmapinfo.cmap_entries;
+		if (ncolors  0) {
+			/*
+			 * Override palette to use 4bpp/8bpp framebuffers as
+			 * monochrome server by using only the first plane.
+			 * See also comment in WsfbPreInit().
+			 */
+			struct wsdisplay_cmap cmap;
+			uint8_t r[256], g[256], b[256];
+			int p;
+
+			for (p = 0; p  ncolors; p++)
+r[p] = g[p] = b[p] = (p  1) ? 0xff : 0;
+			cmap.index = 0;
+			cmap.count = ncolors;
+			cmap.red   = r;
+			cmap.green = g;
+			cmap.blue  = b;
+			if (ioctl(fPtr-fd, WSDISPLAYIO_PUTCMAP, cmap) == -1) {
+xf86DrvMsg(pScrn-scrnIndex, X_ERROR,
+   ioctl WSDISPLAYIO_PUTCMAP: %s\n,
+   strerror(errno));
+			}
+		}
+	}
+#endif
+
 	pScreen-SaveScreen = WsfbSaveScreen;
 
 #ifdef XvExtension
@@ 

CVS commit: [netbsd-6] src/sys/fs/puffs

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:50:12 UTC 2014

Modified Files:
src/sys/fs/puffs [netbsd-6]: puffs_vnops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1184):
sys/fs/puffs/puffs_vnops.c: revision 1.195
According to pooka@'s comment, a long time ago, VOP_STRATEGY could not
fail without taking down the kernel. It seems this is not the case
anymore,
hence we can stop dropping errors in puffs_vnop_strategy()
Approved by pooka@


To generate a diff of this commit:
cvs rdiff -u -r1.163.2.8 -r1.163.2.9 src/sys/fs/puffs/puffs_vnops.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/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.163.2.8 src/sys/fs/puffs/puffs_vnops.c:1.163.2.9
--- src/sys/fs/puffs/puffs_vnops.c:1.163.2.8	Sun Nov  9 06:28:03 2014
+++ src/sys/fs/puffs/puffs_vnops.c	Sun Nov  9 07:50:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.163.2.8 2014/11/09 06:28:03 msaitoh Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.163.2.9 2014/11/09 07:50:12 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.163.2.8 2014/11/09 06:28:03 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.163.2.9 2014/11/09 07:50:12 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -2762,13 +2762,6 @@ puffs_vnop_strategy(void *v)
 		if (dobiodone == 0)
 			goto out;
 
-		/*
-		 * : wrong, but kernel can't survive strategy
-		 * failure currently.  Here, have one more X: X.
-		 */
-		if (error != ENOMEM)
-			error = 0;
-
 		error = checkerr(pmp, error, __func__);
 		if (error)
 			goto out;



CVS commit: [netbsd-6] src/lib/libperfuse

2014-11-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov  9 07:53:39 UTC 2014

Modified Files:
src/lib/libperfuse [netbsd-6]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1185):
lib/libperfuse/ops.c: revision 1.79
Avoid deadlocks on write errors
On write errors, we failed to dequeue some operations, leading to
rare but unpleasant deadlocks


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.16 -r1.50.2.17 src/lib/libperfuse/ops.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.50.2.16 src/lib/libperfuse/ops.c:1.50.2.17
--- src/lib/libperfuse/ops.c:1.50.2.16	Sun Nov  9 07:02:57 2014
+++ src/lib/libperfuse/ops.c	Sun Nov  9 07:53:39 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.50.2.16 2014/11/09 07:02:57 msaitoh Exp $ */
+/*  $NetBSD: ops.c,v 1.50.2.17 2014/11/09 07:53:39 msaitoh Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -3289,6 +3289,7 @@ perfuse_node_write2(struct puffs_usermou
 	if (*resid != 0)
 		error = EFBIG;
 
+out:
 #ifdef PERFUSE_DEBUG
 	if (perfuse_diagflags  PDF_RESIZE) {
 		if (offset  (off_t)vap-va_size)
@@ -3305,16 +3306,6 @@ perfuse_node_write2(struct puffs_usermou
 	if (offset  (off_t)vap-va_size) 
 		vap-va_size = offset;
 
-	if (inresize) {
-#ifdef PERFUSE_DEBUG
-		if (!(pnd-pnd_flags  PND_INRESIZE))
-			DERRX(EX_SOFTWARE, file write grow without resize);
-#endif
-		pnd-pnd_flags = ~PND_INRESIZE;
-		(void)dequeue_requests(opc, PCQ_RESIZE, DEQUEUE_ALL);
-	}
-
-
 	/*
 	 * Statistics
 	 */
@@ -3334,7 +3325,15 @@ perfuse_node_write2(struct puffs_usermou
 			__func__, (void*)opc, perfuse_node_path(ps, opc));
 #endif
 
-out:
+	if (inresize) {
+#ifdef PERFUSE_DEBUG
+		if (!(pnd-pnd_flags  PND_INRESIZE))
+			DERRX(EX_SOFTWARE, file write grow without resize);
+#endif
+		pnd-pnd_flags = ~PND_INRESIZE;
+		(void)dequeue_requests(opc, PCQ_RESIZE, DEQUEUE_ALL);
+	}
+
 	/*
 	 * VOP_PUTPAGE causes FAF write where kernel does not 
 	 * check operation result. At least warn if it failed.