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

2013-12-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec 14 09:52:33 UTC 2013

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Sprinkle __unused.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/evbarm/dev/plcom.c

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

Modified files:

Index: src/sys/arch/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.46 src/sys/arch/evbarm/dev/plcom.c:1.47
--- src/sys/arch/evbarm/dev/plcom.c:1.46	Thu Sep  5 07:09:14 2013
+++ src/sys/arch/evbarm/dev/plcom.c	Sat Dec 14 09:52:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.46 2013/09/05 07:09:14 skrll Exp $	*/
+/*	$NetBSD: plcom.c,v 1.47 2013/12/14 09:52:33 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.46 2013/09/05 07:09:14 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.47 2013/12/14 09:52:33 skrll Exp $);
 
 #include opt_plcom.h
 #include opt_ddb.h
@@ -2288,7 +2288,7 @@ plcom_common_getc(dev_t dev, struct plco
 
 	c = PREAD1(pi, PL01XCOM_DR);
 	{
-		int cn_trapped = 0; /* unused */
+		int cn_trapped __unused = 0;
 #ifdef DDB
 		extern int db_active;
 		if (!db_active)
@@ -2308,7 +2308,7 @@ plcom_common_putc(dev_t dev, struct plco
 	int cin, stat;
 	if (plcom_readaheadcount  MAX_READAHEAD
 	  !ISSET(stat = PREAD1(pi, PL01XCOM_FR), PL01X_FR_RXFE)) {
-		int cn_trapped = 0;
+		int cn_trapped __unused = 0;
 		cin = PREAD1(pi, PL01XCOM_DR);
 		cn_check_magic(dev, cin, plcom_cnm_state);
 		plcom_readahead[plcom_readaheadcount++] = cin;



CVS commit: src/sys/external/bsd/dwc2/dist

2013-12-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec 14 09:58:03 UTC 2013

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcdddma.c

Log Message:
Remove unused variables.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c

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

Modified files:

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.4 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.5
--- src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.4	Sat Oct  5 06:51:43 2013
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c	Sat Dec 14 09:58:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcdddma.c,v 1.4 2013/10/05 06:51:43 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcdddma.c,v 1.5 2013/12/14 09:58:03 skrll Exp $	*/
 
 /*
  * hcd_ddma.c - DesignWare HS OTG Controller descriptor DMA routines
@@ -40,7 +40,7 @@
  * This file contains the Descriptor DMA implementation for Host mode
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dwc2_hcdddma.c,v 1.4 2013/10/05 06:51:43 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: dwc2_hcdddma.c,v 1.5 2013/12/14 09:58:03 skrll Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -164,8 +164,7 @@ static int dwc2_frame_list_alloc(struct 
 
 static void dwc2_frame_list_free(struct dwc2_hsotg *hsotg)
 {
-	u32 *frame_list;
-	dma_addr_t frame_list_dma;
+	usb_dma_t frame_list_usbdma;
 	unsigned long flags;
 
 	spin_lock_irqsave(hsotg-lock, flags);
@@ -175,13 +174,12 @@ static void dwc2_frame_list_free(struct 
 		return;
 	}
 
-	frame_list = hsotg-frame_list;
-	frame_list_dma = hsotg-frame_list_dma;
+	frame_list_usbdma = hsotg-frame_list_usbdma;
 	hsotg-frame_list = NULL;
 
 	spin_unlock_irqrestore(hsotg-lock, flags);
 
-	usb_freemem(hsotg-hsotg_sc-sc_bus, hsotg-frame_list_usbdma);
+	usb_freemem(hsotg-hsotg_sc-sc_bus, frame_list_usbdma);
 }
 
 static void dwc2_per_sched_enable(struct dwc2_hsotg *hsotg, u32 fr_list_en)



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2013-12-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec 14 09:58:43 UTC 2013

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_arm.c

Log Message:
Remove unused variables.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c

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

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.7 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.8
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.7	Sun Oct 13 07:46:26 2013
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c	Sat Dec 14 09:58:43 2013
@@ -2358,7 +2358,6 @@ vchiq_release_internal(VCHIQ_STATE_T *st
 	VCHIQ_STATUS_T ret = VCHIQ_SUCCESS;
 	char entity[16];
 	int *entity_uc;
-	int local_uc, local_entity_uc;
 
 	if (!arm_state)
 		goto out;
@@ -2383,8 +2382,8 @@ vchiq_release_internal(VCHIQ_STATE_T *st
 		ret = VCHIQ_ERROR;
 		goto unlock;
 	}
-	local_uc = --arm_state-videocore_use_count;
-	local_entity_uc = --(*entity_uc);
+	--arm_state-videocore_use_count;
+	--(*entity_uc);
 
 	if (!vchiq_videocore_wanted(state)) {
 		if (vchiq_platform_use_suspend_timer() 



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2013-12-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec 14 10:00:42 UTC 2013

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_core.c

Log Message:
Comment out unsed variable. Left for reference.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c

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

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c:1.7 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c:1.8
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c:1.7	Sun Dec  1 02:57:43 2013
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c	Sat Dec 14 10:00:42 2013
@@ -1462,12 +1462,11 @@ parse_open(VCHIQ_STATE_T *state, VCHIQ_H
 {
 	VCHIQ_SERVICE_T *service = NULL;
 	int msgid, size;
-	int type;
 	unsigned int localport, remoteport;
 
 	msgid = header-msgid;
 	size = header-size;
-	type = VCHIQ_MSG_TYPE(msgid);
+	//int type = VCHIQ_MSG_TYPE(msgid);
 	localport = VCHIQ_MSG_DSTPORT(msgid);
 	remoteport = VCHIQ_MSG_SRCPORT(msgid);
 	if (size = sizeof(struct vchiq_open_payload)) {



CVS commit: src/sys/rump/kern/lib/libsys_linux

2013-12-14 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Dec 14 10:29:45 UTC 2013

Modified Files:
src/sys/rump/kern/lib/libsys_linux: Makefile syscalls.master
Added Files:
src/sys/rump/kern/lib/libsys_linux: linux_rump.c

Log Message:
Add syscall wrapper for mknodat(2) to deal with PAD argument difference
between rump and linux versions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/kern/lib/libsys_linux/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsys_linux/linux_rump.c
cvs rdiff -u -r1.8 -r1.9 src/sys/rump/kern/lib/libsys_linux/syscalls.master

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

Modified files:

Index: src/sys/rump/kern/lib/libsys_linux/Makefile
diff -u src/sys/rump/kern/lib/libsys_linux/Makefile:1.2 src/sys/rump/kern/lib/libsys_linux/Makefile:1.3
--- src/sys/rump/kern/lib/libsys_linux/Makefile:1.2	Thu Mar  7 18:53:39 2013
+++ src/sys/rump/kern/lib/libsys_linux/Makefile	Sat Dec 14 10:29:45 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/03/07 18:53:39 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2013/12/14 10:29:45 njoly Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../compat/linux/common
@@ -10,7 +10,7 @@ SRCS=	linux_blkio.c linux_cdrom.c linux_
 	linux_mtio.c linux_signal.c linux_signo.c linux_socket.c	\
 	linux_sysctl.c linux_termios.c linux_time.c linux_file64.c
 
-SRCS+=	rump_linux_sysent.c component.c
+SRCS+=	rump_linux_sysent.c component.c linux_rump.c
 
 # XXX
 CPPFLAGS+= -I${.CURDIR} -I${RUMPTOP}/librump/rumpkern

Index: src/sys/rump/kern/lib/libsys_linux/syscalls.master
diff -u src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.8 src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.9
--- src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.8	Sun Dec  8 08:54:48 2013
+++ src/sys/rump/kern/lib/libsys_linux/syscalls.master	Sat Dec 14 10:29:45 2013
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.8 2013/12/08 08:54:48 njoly Exp $
+	$NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -589,8 +589,8 @@
 458	NOARGS		{ int|sys||renameat(int fromfd, const char *from, \
 			int tofd, const char *to); }
 459	UNIMPL		mkfifoat
-460	NODEF		{ int|linux_sys||mknodat(int fd, const char *path, \
-			mode_t mode, unsigned dev); }
+460	STD		{ int|rump_linux_sys||mknodat(int fd, const char *path, \
+			mode_t mode, int PAD, unsigned dev); }
 461	NOARGS		{ int|sys||mkdirat(int fd, const char *path, \
 			mode_t mode); }
 462	NODEF		{ int|linux_sys||faccessat(int fd, const char *path, \

Added files:

Index: src/sys/rump/kern/lib/libsys_linux/linux_rump.c
diff -u /dev/null src/sys/rump/kern/lib/libsys_linux/linux_rump.c:1.1
--- /dev/null	Sat Dec 14 10:29:45 2013
+++ src/sys/rump/kern/lib/libsys_linux/linux_rump.c	Sat Dec 14 10:29:45 2013
@@ -0,0 +1,45 @@
+/*	$NetBSD: linux_rump.c,v 1.1 2013/12/14 10:29:45 njoly Exp $	*/
+
+#include sys/param.h
+
+#include compat/linux/common/linux_types.h
+#include compat/linux/common/linux_signal.h
+
+#include rump_linux_syscallargs.h
+
+/*
+compat/linux/arch/.../syscallargs.h and rump_linux_syscallargs.h
+define the same syscall arguments and prototypes, thus cannot be
+both used. Just copy needed linux stuff for now to avoid conflicts.
+*/
+
+struct linux_sys_mknodat_args {
+syscallarg(int) fd;
+syscallarg(const char *) path;
+syscallarg(mode_t) mode;
+syscallarg(unsigned) dev;
+};
+check_syscall_args(linux_sys_mknodat)
+
+int linux_sys_mknodat(struct lwp *, const struct linux_sys_mknodat_args *, register_t *);
+
+int
+rump_linux_sys_mknodat(struct lwp *l,
+const struct rump_linux_sys_mknodat_args *uap, register_t *retval)
+{
+	/* {
+		syscallarg(int) fd;
+		syscallarg(const char *) path;
+		syscallarg(mode_t) mode;
+		syscallarg(int) PAD;
+		syscallarg(dev_t) dev;
+	} */
+	struct linux_sys_mknodat_args ua;
+
+	SCARG(ua, fd) = SCARG(uap, fd);
+	SCARG(ua, path) = SCARG(uap, path);
+	SCARG(ua, mode) = SCARG(uap, mode);
+	SCARG(ua, dev) = SCARG(uap, dev);
+
+	return linux_sys_mknodat(l, ua, retval);
+}



CVS commit: src/sys/rump/kern/lib/libsys_linux

2013-12-14 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Dec 14 10:30:50 UTC 2013

Modified Files:
src/sys/rump/kern/lib/libsys_linux: rump_linux_syscall.h
rump_linux_syscallargs.h rump_linux_syscalls.c rump_linux_sysent.c

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h
cvs rdiff -u -r1.9 -r1.10 \
src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h \
src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c \
src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c

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

Modified files:

Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.6 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.7
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.6	Sun Dec  8 08:55:27 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h	Sat Dec 14 10:30:50 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_linux_syscall.h,v 1.6 2013/12/08 08:55:27 njoly Exp $ */
+/* $NetBSD: rump_linux_syscall.h,v 1.7 2013/12/14 10:30:50 njoly Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.8 2013/12/08 08:54:48 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp
  */
 
 #ifndef _RUMP_LINUX_SYS_SYSCALL_H_
@@ -171,6 +171,9 @@
 /* syscall: renameat ret: int args: int const char * int const char * */
 #define	RUMP_LINUX_SYS_renameat	458
 
+/* syscall: mknodat ret: int args: int const char * mode_t int unsigned */
+#define	RUMP_LINUX_SYS_mknodat	460
+
 /* syscall: mkdirat ret: int args: int const char * mode_t */
 #define	RUMP_LINUX_SYS_mkdirat	461
 

Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.9 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.10
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.9	Sun Dec  8 08:55:27 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h	Sat Dec 14 10:30:50 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_linux_syscallargs.h,v 1.9 2013/12/08 08:55:27 njoly Exp $ */
+/* $NetBSD: rump_linux_syscallargs.h,v 1.10 2013/12/14 10:30:50 njoly Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.8 2013/12/08 08:54:48 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp
  */
 
 #ifndef _RUMP_LINUX_SYS_SYSCALLARGS_H_
@@ -353,13 +353,14 @@ check_syscall_args(linux_sys_linkat)
 
 struct sys_renameat_args;
 
-struct linux_sys_mknodat_args {
+struct rump_linux_sys_mknodat_args {
 	syscallarg(int) fd;
 	syscallarg(const char *) path;
 	syscallarg(mode_t) mode;
+	syscallarg(int) PAD;
 	syscallarg(unsigned) dev;
 };
-check_syscall_args(linux_sys_mknodat)
+check_syscall_args(rump_linux_sys_mknodat)
 
 struct sys_mkdirat_args;
 
@@ -595,7 +596,7 @@ int	linux_sys_linkat(struct lwp *, const
 
 int	sys_renameat(struct lwp *, const struct sys_renameat_args *, register_t *);
 
-int	linux_sys_mknodat(struct lwp *, const struct linux_sys_mknodat_args *, register_t *);
+int	rump_linux_sys_mknodat(struct lwp *, const struct rump_linux_sys_mknodat_args *, register_t *);
 
 int	sys_mkdirat(struct lwp *, const struct sys_mkdirat_args *, register_t *);
 
Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.9 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.10
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.9	Sun Dec  8 08:55:27 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c	Sat Dec 14 10:30:50 2013
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_linux_syscalls.c,v 1.9 2013/12/08 08:55:27 njoly Exp $ */
+/* $NetBSD: rump_linux_syscalls.c,v 1.10 2013/12/14 10:30:50 njoly Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.8 2013/12/08 08:54:48 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_linux_syscalls.c,v 1.9 2013/12/08 08:55:27 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_linux_syscalls.c,v 1.10 2013/12/14 10:30:50 njoly Exp $);
 
 #if defined(_KERNEL_OPT)
 #include sys/param.h
Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c:1.9 src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c:1.10
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c:1.9	Sun Dec  8 08:55:27 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c	Sat Dec 14 

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

2013-12-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Dec 14 15:47:18 UTC 2013

Modified Files:
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
If we can't enable VFP/VFP2 via the CPACCESS register, bail since there
isn't a VFP.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/vfp/vfp_init.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/vfp/vfp_init.c
diff -u src/sys/arch/arm/vfp/vfp_init.c:1.27 src/sys/arch/arm/vfp/vfp_init.c:1.28
--- src/sys/arch/arm/vfp/vfp_init.c:1.27	Mon Nov 18 18:02:01 2013
+++ src/sys/arch/arm/vfp/vfp_init.c	Sat Dec 14 15:47:18 2013
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfp_init.c,v 1.27 2013/11/18 18:02:01 matt Exp $ */
+/*  $NetBSD: vfp_init.c,v 1.28 2013/12/14 15:47:18 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -261,7 +261,6 @@ vfp_attach(void)
 {
 	struct cpu_info * const ci = curcpu();
 	const char *model = NULL;
-	bool vfp_p = false;
 
 	if (CPU_ID_ARM11_P(curcpu()-ci_arm_cpuid)
 	|| CPU_ID_CORTEX_P(curcpu()-ci_arm_cpuid)) {
@@ -289,8 +288,14 @@ vfp_attach(void)
 		 * If we could enable them, then they exist.
 		 */
 		cpacr = armreg_cpacr_read();
-		vfp_p = __SHIFTOUT(cpacr, cpacr_vfp2) != CPACR_NOACCESS
+		bool vfp_p = __SHIFTOUT(cpacr, cpacr_vfp2) != CPACR_NOACCESS
 		|| __SHIFTOUT(cpacr, cpacr_vfp) != CPACR_NOACCESS;
+		if (!vfp_p) {
+			aprint_normal_dev(ci-ci_dev, No VFP detected\n);
+			install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+			ci-ci_vfp_id = 0;
+			return;
+		}
 	}
 
 	void *uh = install_coproc_handler(VFP_COPROC, vfp_test);



CVS commit: src/sys/nfs

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 14 16:19:28 UTC 2013

Modified Files:
src/sys/nfs: nfs_export.c nfs_serv.c nfs_var.h

Log Message:
don't allow the nfs server module to unload if it has exported filesystems.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/nfs/nfs_export.c
cvs rdiff -u -r1.166 -r1.167 src/sys/nfs/nfs_serv.c
cvs rdiff -u -r1.90 -r1.91 src/sys/nfs/nfs_var.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/nfs/nfs_export.c
diff -u src/sys/nfs/nfs_export.c:1.57 src/sys/nfs/nfs_export.c:1.58
--- src/sys/nfs/nfs_export.c:1.57	Sat Nov 23 09:20:46 2013
+++ src/sys/nfs/nfs_export.c	Sat Dec 14 11:19:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_export.c,v 1.57 2013/11/23 14:20:46 christos Exp $	*/
+/*	$NetBSD: nfs_export.c,v 1.58 2013/12/14 16:19:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2008 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_export.c,v 1.57 2013/11/23 14:20:46 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_export.c,v 1.58 2013/12/14 16:19:28 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -877,3 +877,10 @@ netexport_wrunlock(void)
 
 	rw_exit(netexport_lock);
 }
+
+bool
+netexport_hasexports(void)
+{
+	
+	return nfs_pub.np_valid || !TAILQ_EMPTY(netexport_list);
+}

Index: src/sys/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.166 src/sys/nfs/nfs_serv.c:1.167
--- src/sys/nfs/nfs_serv.c:1.166	Sat Sep 14 18:29:08 2013
+++ src/sys/nfs/nfs_serv.c	Sat Dec 14 11:19:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.166 2013/09/14 22:29:08 martin Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.166 2013/09/14 22:29:08 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -125,6 +125,8 @@ nfsserver_modcmd(modcmd_t cmd, void *arg
 		nfs_timer_srvinit(nfsrv_timer);
 		return 0;
 	case MODULE_CMD_FINI:
+		if (netexport_hasexports())
+			return EBUSY;
 		error = syscall_disestablish(NULL, nfsserver_syscalls);
 		if (error != 0) {
 			return error;

Index: src/sys/nfs/nfs_var.h
diff -u src/sys/nfs/nfs_var.h:1.90 src/sys/nfs/nfs_var.h:1.91
--- src/sys/nfs/nfs_var.h:1.90	Tue Mar  2 18:19:09 2010
+++ src/sys/nfs/nfs_var.h	Sat Dec 14 11:19:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_var.h,v 1.90 2010/03/02 23:19:09 pooka Exp $	*/
+/*	$NetBSD: nfs_var.h,v 1.91 2013/12/14 16:19:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -349,4 +349,5 @@ void netexport_rdlock(void);
 void netexport_rdunlock(void);
 void netexport_init(void);
 void netexport_fini(void);
+bool netexport_hasexports(void);
 #endif /* _KERNEL */



CVS commit: src/sys/rump/kern/lib/libsys_linux

2013-12-14 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Dec 14 17:34:47 UTC 2013

Modified Files:
src/sys/rump/kern/lib/libsys_linux: syscalls.master

Log Message:
Use native/rump syscalls for pread/pwrite instead of linux ones
which only exist to deal with PAD argument.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/kern/lib/libsys_linux/syscalls.master

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

Modified files:

Index: src/sys/rump/kern/lib/libsys_linux/syscalls.master
diff -u src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.9 src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.10
--- src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.9	Sat Dec 14 10:29:45 2013
+++ src/sys/rump/kern/lib/libsys_linux/syscalls.master	Sat Dec 14 17:34:47 2013
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp $
+	$NetBSD: syscalls.master,v 1.10 2013/12/14 17:34:47 njoly Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -249,9 +249,9 @@
 170	UNIMPL		1.0 msgsys
 171	UNIMPL		1.0 shmsys
 172	UNIMPL
-173	NODEF 	 	{ ssize_t|linux_sys||pread(int fd, char *buf, \
+173	NOARGS 	 	{ ssize_t|sys||pread(int fd, char *buf, \
 			size_t nbyte, int PAD, linux_off_t offset); }
-174	NODEF 	 	{ ssize_t|linux_sys||pwrite(int fd, char *buf, \
+174	NOARGS 	 	{ ssize_t|sys||pwrite(int fd, char *buf, \
 			size_t nbyte, int PAD, linux_off_t offset); }
 175	UNIMPL		ntp_gettime
 176	UNIMPL		ntp_adjtime



CVS commit: src/sys/rump/kern/lib/libsys_linux

2013-12-14 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Dec 14 17:35:11 UTC 2013

Modified Files:
src/sys/rump/kern/lib/libsys_linux: rump_linux_syscall.h
rump_linux_syscallargs.h rump_linux_syscalls.c rump_linux_sysent.c

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h
cvs rdiff -u -r1.10 -r1.11 \
src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h \
src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c \
src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c

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

Modified files:

Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.7 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.8
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.7	Sat Dec 14 10:30:50 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h	Sat Dec 14 17:35:11 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_linux_syscall.h,v 1.7 2013/12/14 10:30:50 njoly Exp $ */
+/* $NetBSD: rump_linux_syscall.h,v 1.8 2013/12/14 17:35:11 njoly Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.10 2013/12/14 17:34:47 njoly Exp
  */
 
 #ifndef _RUMP_LINUX_SYS_SYSCALL_H_
@@ -135,6 +135,12 @@
 /* syscall: setsid ret: int args: */
 #define	RUMP_LINUX_SYS_setsid	147
 
+/* syscall: pread ret: ssize_t args: int char * size_t int linux_off_t */
+#define	RUMP_LINUX_SYS_pread	173
+
+/* syscall: pwrite ret: ssize_t args: int char * size_t int linux_off_t */
+#define	RUMP_LINUX_SYS_pwrite	174
+
 /* syscall: setgid ret: int args: gid_t */
 #define	RUMP_LINUX_SYS_setgid	181
 

Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.10 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.11
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.10	Sat Dec 14 10:30:50 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h	Sat Dec 14 17:35:11 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_linux_syscallargs.h,v 1.10 2013/12/14 10:30:50 njoly Exp $ */
+/* $NetBSD: rump_linux_syscallargs.h,v 1.11 2013/12/14 17:35:11 njoly Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.10 2013/12/14 17:34:47 njoly Exp
  */
 
 #ifndef _RUMP_LINUX_SYS_SYSCALLARGS_H_
@@ -216,23 +216,9 @@ struct sys_mkdir_args;
 
 struct sys_rmdir_args;
 
-struct linux_sys_pread_args {
-	syscallarg(int) fd;
-	syscallarg(char *) buf;
-	syscallarg(size_t) nbyte;
-	syscallarg(int) PAD;
-	syscallarg(linux_off_t) offset;
-};
-check_syscall_args(linux_sys_pread)
+struct sys_pread_args;
 
-struct linux_sys_pwrite_args {
-	syscallarg(int) fd;
-	syscallarg(char *) buf;
-	syscallarg(size_t) nbyte;
-	syscallarg(int) PAD;
-	syscallarg(linux_off_t) offset;
-};
-check_syscall_args(linux_sys_pwrite)
+struct sys_pwrite_args;
 
 struct sys_setgid_args;
 
@@ -540,9 +526,9 @@ int	sys_rmdir(struct lwp *, const struct
 
 int	sys_setsid(struct lwp *, const void *, register_t *);
 
-int	linux_sys_pread(struct lwp *, const struct linux_sys_pread_args *, register_t *);
+int	sys_pread(struct lwp *, const struct sys_pread_args *, register_t *);
 
-int	linux_sys_pwrite(struct lwp *, const struct linux_sys_pwrite_args *, register_t *);
+int	sys_pwrite(struct lwp *, const struct sys_pwrite_args *, register_t *);
 
 int	sys_setgid(struct lwp *, const struct sys_setgid_args *, register_t *);
 
Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c
diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.10 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.11
--- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.10	Sat Dec 14 10:30:50 2013
+++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c	Sat Dec 14 17:35:11 2013
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_linux_syscalls.c,v 1.10 2013/12/14 10:30:50 njoly Exp $ */
+/* $NetBSD: rump_linux_syscalls.c,v 1.11 2013/12/14 17:35:11 njoly Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.10 2013/12/14 17:34:47 njoly Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_linux_syscalls.c,v 1.10 2013/12/14 10:30:50 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_linux_syscalls.c,v 1.11 2013/12/14 17:35:11 njoly Exp $);
 
 #if defined(_KERNEL_OPT)
 #include sys/param.h
Index: 

CVS commit: src/lib/libc/db/mpool

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 14 18:04:00 UTC 2013

Modified Files:
src/lib/libc/db/mpool: mpool.c

Log Message:
knf, reduce pointer gymnastics


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/db/mpool/mpool.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/libc/db/mpool/mpool.c
diff -u src/lib/libc/db/mpool/mpool.c:1.20 src/lib/libc/db/mpool/mpool.c:1.21
--- src/lib/libc/db/mpool/mpool.c:1.20	Fri Nov 22 11:25:51 2013
+++ src/lib/libc/db/mpool/mpool.c	Sat Dec 14 13:04:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpool.c,v 1.20 2013/11/22 16:25:51 christos Exp $	*/
+/*	$NetBSD: mpool.c,v 1.21 2013/12/14 18:04:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: mpool.c,v 1.20 2013/11/22 16:25:51 christos Exp $);
+__RCSID($NetBSD: mpool.c,v 1.21 2013/12/14 18:04:00 christos Exp $);
 
 #include namespace.h
 #include sys/queue.h
@@ -84,14 +84,14 @@ mpool_open(void *key, int fd, pgno_t pag
 	 * We don't currently handle pipes, although we should.
 	 */
 	if (fstat(fd, sb))
-		return (NULL);
+		return NULL;
 	if (!S_ISREG(sb.st_mode)) {
 		errno = ESPIPE;
-		return (NULL);
+		return NULL;
 	}
 
 	/* Allocate and initialize the MPOOL cookie. */
-	if ((mp = (MPOOL *)calloc(1, sizeof(MPOOL))) == NULL)
+	if ((mp = calloc(1, sizeof(*mp))) == NULL)
 		return (NULL);
 	TAILQ_INIT(mp-lqh);
 	for (entry = 0; entry  HASHSIZE; ++entry)
@@ -100,7 +100,7 @@ mpool_open(void *key, int fd, pgno_t pag
 	mp-npages = (pgno_t)(sb.st_size / pagesize);
 	mp-pagesize = pagesize;
 	mp-fd = fd;
-	return (mp);
+	return mp;
 }
 
 /*
@@ -139,14 +139,14 @@ mpool_new( MPOOL *mp, pgno_t *pgnoaddr)
 	 * and return.
 	 */
 	if ((bp = mpool_bkt(mp)) == NULL)
-		return (NULL);
+		return NULL;
 	*pgnoaddr = bp-pgno = mp-npages++;
 	bp-flags = MPOOL_PINNED;
 
 	head = mp-hqh[HASHKEY(bp-pgno)];
 	TAILQ_INSERT_HEAD(head, bp, hq);
 	TAILQ_INSERT_TAIL(mp-lqh, bp, q);
-	return (bp-page);
+	return bp-page;
 }
 
 /*
@@ -165,7 +165,7 @@ mpool_get(MPOOL *mp, pgno_t pgno, u_int 
 	/* Check for attempt to retrieve a non-existent page. */
 	if (pgno = mp-npages) {
 		errno = EINVAL;
-		return (NULL);
+		return NULL;
 	}
 
 #ifdef STATISTICS
@@ -193,12 +193,12 @@ mpool_get(MPOOL *mp, pgno_t pgno, u_int 
 
 		/* Return a pinned page. */
 		bp-flags |= MPOOL_PINNED;
-		return (bp-page);
+		return bp-page;
 	}
 
 	/* Get a page from the cache. */
 	if ((bp = mpool_bkt(mp)) == NULL)
-		return (NULL);
+		return NULL;
 
 	/* Read in the contents. */
 #ifdef STATISTICS
@@ -208,7 +208,7 @@ mpool_get(MPOOL *mp, pgno_t pgno, u_int 
 	if ((nr = pread(mp-fd, bp-page, (size_t)mp-pagesize, off)) != (int)mp-pagesize) {
 		if (nr = 0)
 			errno = EFTYPE;
-		return (NULL);
+		return NULL;
 	}
 
 	/* Set the page number, pin the page. */
@@ -227,7 +227,7 @@ mpool_get(MPOOL *mp, pgno_t pgno, u_int 
 	if (mp-pgin != NULL)
 		(mp-pgin)(mp-pgcookie, bp-pgno, bp-page);
 
-	return (bp-page);
+	return bp-page;
 }
 
 /*
@@ -243,7 +243,7 @@ mpool_put(MPOOL *mp, void *page, u_int f
 #ifdef STATISTICS
 	++mp-pageput;
 #endif
-	bp = (BKT *)(void *)((char *)page - sizeof(BKT));
+	bp = (void *)((intptr_t)page - sizeof(BKT));
 #ifdef DEBUG
 	if (!(bp-flags  MPOOL_PINNED)) {
 		(void)fprintf(stderr,
@@ -274,7 +274,7 @@ mpool_close(MPOOL *mp)
 
 	/* Free the MPOOL cookie. */
 	free(mp);
-	return (RET_SUCCESS);
+	return RET_SUCCESS;
 }
 
 /*
@@ -290,10 +290,10 @@ mpool_sync(MPOOL *mp)
 	TAILQ_FOREACH(bp, mp-lqh, q)
 		if (bp-flags  MPOOL_DIRTY 
 		mpool_write(mp, bp) == RET_ERROR)
-			return (RET_ERROR);
+			return RET_ERROR;
 
 	/* Sync the file descriptor. */
-	return (fsync(mp-fd) ? RET_ERROR : RET_SUCCESS);
+	return fsync(mp-fd) ? RET_ERROR : RET_SUCCESS;
 }
 
 /*
@@ -321,7 +321,7 @@ mpool_bkt(MPOOL *mp)
 			/* Flush if dirty. */
 			if (bp-flags  MPOOL_DIRTY 
 			mpool_write(mp, bp) == RET_ERROR)
-return (NULL);
+return NULL;
 #ifdef STATISTICS
 			++mp-pageflush;
 #endif
@@ -337,20 +337,20 @@ mpool_bkt(MPOOL *mp)
 bp-page = spage;
 			}
 #endif
-			return (bp);
+			return bp;
 		}
 
 new:	if ((bp = calloc(1, (size_t)(sizeof(BKT) + mp-pagesize))) == NULL)
-		return (NULL);
+		return NULL;
 #ifdef STATISTICS
 	++mp-pagealloc;
 #endif
 #if defined(DEBUG) || defined(PURIFY)
 	(void)memset(bp, 0xff, (size_t)(sizeof(BKT) + mp-pagesize));
 #endif
-	bp-page = (char *)(void *)bp + sizeof(BKT);
+	bp-page = (void *)((intptr_t)bp + sizeof(BKT));
 	++mp-curcache;
-	return (bp);
+	return bp;
 }
 
 /*
@@ -371,8 +371,9 @@ mpool_write(MPOOL *mp, BKT *bp)
 		(mp-pgout)(mp-pgcookie, bp-pgno, bp-page);
 
 	off = mp-pagesize * bp-pgno;
-	if (pwrite(mp-fd, bp-page, (size_t)mp-pagesize, off) != (int)mp-pagesize)
-		return (RET_ERROR);
+	if (pwrite(mp-fd, bp-page, (size_t)mp-pagesize, off) !=
+	(ssize_t)mp-pagesize)
+		return RET_ERROR;
 
 	/*
 	 * 

CVS commit: src/lib/libc/db

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 14 18:04:56 UTC 2013

Modified Files:
src/lib/libc/db/btree: bt_overflow.c bt_utils.c
src/lib/libc/db/recno: rec_get.c rec_put.c rec_utils.c

Log Message:
It's been many years since realloc(NULL, size) == malloc(size). Also don't
destroy pointers on allocation errors so someone can free them later.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/db/btree/bt_overflow.c
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/db/btree/bt_utils.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/db/recno/rec_get.c
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/db/recno/rec_put.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/db/recno/rec_utils.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/libc/db/btree/bt_overflow.c
diff -u src/lib/libc/db/btree/bt_overflow.c:1.19 src/lib/libc/db/btree/bt_overflow.c:1.20
--- src/lib/libc/db/btree/bt_overflow.c:1.19	Sat Nov 30 19:22:48 2013
+++ src/lib/libc/db/btree/bt_overflow.c	Sat Dec 14 13:04:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_overflow.c,v 1.19 2013/12/01 00:22:48 christos Exp $	*/
+/*	$NetBSD: bt_overflow.c,v 1.20 2013/12/14 18:04:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: bt_overflow.c,v 1.19 2013/12/01 00:22:48 christos Exp $);
+__RCSID($NetBSD: bt_overflow.c,v 1.20 2013/12/14 18:04:56 christos Exp $);
 
 #include namespace.h
 #include sys/param.h
@@ -97,9 +97,10 @@ __ovfl_get(BTREE *t, void *p, size_t *ss
 #endif
 	/* Make the buffer bigger as necessary. */
 	if (*bufsz  sz) {
-		*buf = *buf == NULL ? malloc(sz) : realloc(*buf, sz);
-		if (*buf == NULL)
+		void *nbuf = realloc(*buf, sz);
+		if (nbuf == NULL)
 			return (RET_ERROR);
+		*buf = nbuf;
 		*bufsz = sz;
 	}
 

Index: src/lib/libc/db/btree/bt_utils.c
diff -u src/lib/libc/db/btree/bt_utils.c:1.15 src/lib/libc/db/btree/bt_utils.c:1.16
--- src/lib/libc/db/btree/bt_utils.c:1.15	Sat Nov 30 19:22:48 2013
+++ src/lib/libc/db/btree/bt_utils.c	Sat Dec 14 13:04:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_utils.c,v 1.15 2013/12/01 00:22:48 christos Exp $	*/
+/*	$NetBSD: bt_utils.c,v 1.16 2013/12/14 18:04:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: bt_utils.c,v 1.15 2013/12/01 00:22:48 christos Exp $);
+__RCSID($NetBSD: bt_utils.c,v 1.16 2013/12/14 18:04:56 christos Exp $);
 
 #include sys/param.h
 
@@ -88,8 +88,7 @@ __bt_ret(BTREE *t, EPG *e, DBT *key, DBT
 		key-data = rkey-data;
 	} else if (copy || F_ISSET(t, B_DB_LOCK)) {
 		if (bl-ksize  rkey-size) {
-			p = rkey-data == NULL ?
-			malloc(bl-ksize) : realloc(rkey-data, bl-ksize);
+			p = realloc(rkey-data, bl-ksize);
 			if (p == NULL)
 return (RET_ERROR);
 			rkey-data = p;
@@ -115,9 +114,7 @@ dataonly:
 	} else if (copy || F_ISSET(t, B_DB_LOCK)) {
 		/* Use +1 in case the first record retrieved is 0 length. */
 		if (bl-dsize + 1  rdata-size) {
-			p = rdata-data == NULL ?
-			malloc(bl-dsize + 1) :
-			realloc(rdata-data, bl-dsize + 1);
+			p = realloc(rdata-data, bl-dsize + 1);
 			if (p == NULL)
 return (RET_ERROR);
 			rdata-data = p;

Index: src/lib/libc/db/recno/rec_get.c
diff -u src/lib/libc/db/recno/rec_get.c:1.16 src/lib/libc/db/recno/rec_get.c:1.17
--- src/lib/libc/db/recno/rec_get.c:1.16	Thu Sep 11 08:58:00 2008
+++ src/lib/libc/db/recno/rec_get.c	Sat Dec 14 13:04:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rec_get.c,v 1.16 2008/09/11 12:58:00 joerg Exp $	*/
+/*	$NetBSD: rec_get.c,v 1.17 2013/12/14 18:04:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rec_get.c,v 1.16 2008/09/11 12:58:00 joerg Exp $);
+__RCSID($NetBSD: rec_get.c,v 1.17 2013/12/14 18:04:56 christos Exp $);
 
 #include namespace.h
 #include sys/types.h
@@ -127,11 +127,10 @@ __rec_fpipe(BTREE *t, recno_t top)
 	uint8_t *p;
 
 	if (t-bt_rdata.size  t-bt_reclen) {
-		t-bt_rdata.data = t-bt_rdata.data == NULL ?
-		malloc(t-bt_reclen) :
-		realloc(t-bt_rdata.data, t-bt_reclen);
-		if (t-bt_rdata.data == NULL)
+		void *np = realloc(t-bt_rdata.data, t-bt_reclen);
+		if (np == NULL)
 			return (RET_ERROR);
+		t-bt_rdata.data = np;
 		t-bt_rdata.size = t-bt_reclen;
 	}
 	data.data = t-bt_rdata.data;
@@ -196,13 +195,14 @@ __rec_vpipe(BTREE *t, recno_t top)
 break;
 			}
 			if (sz == 0) {
+void *np;
 len = p - (uint8_t *)t-bt_rdata.data;
-t-bt_rdata.size += (sz = 256);
-t-bt_rdata.data = t-bt_rdata.data == NULL ?
-malloc(t-bt_rdata.size) :
-realloc(t-bt_rdata.data, t-bt_rdata.size);
-if (t-bt_rdata.data == NULL)
+sz = t-bt_rdata.size + 256;
+np = realloc(t-bt_rdata.data, sz);
+if (np == NULL)
 	return (RET_ERROR);
+t-bt_rdata.size = sz;
+t-bt_rdata.data = np;
 p = (uint8_t 

CVS commit: [netbsd-6] src/sys/dev/usb

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:26:39 UTC 2013

Modified Files:
src/sys/dev/usb [netbsd-6]: ehci.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #990):
sys/dev/usb/ehci.c: revision 1.221
In ehci_check_qh_intr don't treat a short control transfer as done if the
status phase is still inflight.  Let the hardware complete it.
PR/48358: Repeated low-speed USB control transfers returning short data
  fail on EHCI
PR/46696: uhub disables port where USB keyboard attached


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.1 -r1.183.2.2 src/sys/dev/usb/ehci.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/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.183.2.1 src/sys/dev/usb/ehci.c:1.183.2.2
--- src/sys/dev/usb/ehci.c:1.183.2.1	Thu Sep 26 01:51:47 2013
+++ src/sys/dev/usb/ehci.c	Sat Dec 14 19:26:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.183.2.1 2013/09/26 01:51:47 riz Exp $ */
+/*	$NetBSD: ehci.c,v 1.183.2.2 2013/12/14 19:26:39 bouyer Exp $ */
 
 /*
  * Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.183.2.1 2013/09/26 01:51:47 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.183.2.2 2013/12/14 19:26:39 bouyer Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -784,9 +784,26 @@ ehci_check_qh_intr(ehci_softc_t *sc, str
 			/* Any kind of error makes the xfer done. */
 			if (status  EHCI_QTD_HALTED)
 goto done;
-			/* We want short packets, and it is short: it's done */
-			if (EHCI_QTD_GET_BYTES(status) != 0)
+			/* Handle short packets */
+			if (EHCI_QTD_GET_BYTES(status) != 0) {
+usbd_pipe_handle pipe = ex-xfer.pipe;
+usb_endpoint_descriptor_t *ed =
+pipe-endpoint-edesc;
+uint8_t xt = UE_GET_XFERTYPE(ed-bmAttributes);
+
+/*
+ * If we get here for a control transfer then
+ * we need to let the hardware complete the
+ * status phase.  That is, we're not done
+ * quite yet.
+ *
+ * Otherwise, we're done.
+ */
+if (xt == UE_CONTROL) {
+	break;
+}
 goto done;
+			}
 		}
 		DPRINTFN(12, (ehci_check_intr: ex=%p std=%p still active\n,
 			  ex, ex-sqtdstart));



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

2013-12-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 14 19:27:41 UTC 2013

Modified Files:
src/sys/arch/luna68k/dev: omrasops.c

Log Message:
Make omrasops copycols() op work even if columns are not 32 bit aligned.

This means command line editing works properly in any cases.

The bitcopy strategies for 1bpp copycols() op are taken from
recently fixed MI sys/dev/rasops/rasops_bitops.h.
GETBITS() and PUTBITS() m68k asm macro are taken from hp300.

Tested on both 1bpp (on LUNA-II) and 4bpp (on LUNA) framebuffers.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/dev/omrasops.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/luna68k/dev/omrasops.c
diff -u src/sys/arch/luna68k/dev/omrasops.c:1.14 src/sys/arch/luna68k/dev/omrasops.c:1.15
--- src/sys/arch/luna68k/dev/omrasops.c:1.14	Mon Dec  2 13:45:40 2013
+++ src/sys/arch/luna68k/dev/omrasops.c	Sat Dec 14 19:27:41 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: omrasops.c,v 1.14 2013/12/02 13:45:40 tsutsui Exp $ */
+/* $NetBSD: omrasops.c,v 1.15 2013/12/14 19:27:41 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,14 +31,14 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: omrasops.c,v 1.14 2013/12/02 13:45:40 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: omrasops.c,v 1.15 2013/12/14 19:27:41 tsutsui Exp $);
 
 /*
  * Designed speficically for 'm68k bitorder';
  *	- most significant byte is stored at lower address,
  *	- most significant bit is displayed at left most on screen.
  * Implementation relies on;
- *	- every memory references is done in aligned 32bit chunk,
+ *	- first column is at 32bit aligned address,
  *	- font glyphs are stored in 32bit padded.
  */
 
@@ -72,6 +72,34 @@ static int	om_allocattr(void *, int, int
 #define	R(p) (*(uint32_t *)((uint8_t *)(p) + 0x4))
 
 /*
+ * macros to handle unaligned bit copy ops.
+ * See src/sys/dev/rasops/rasops_mask.h for MI version.
+ * Also refer src/sys/arch/hp300/dev/maskbits.h.
+ * (which was implemented for ancient src/sys/arch/hp300/dev/grf_hy.c)
+ */
+
+/* luna68k version GETBITS() that gets w bits from bit x at psrc memory */
+#define	FASTGETBITS(psrc, x, w, dst)	\
+	asm(bfextu %3{%1:%2},%0	\
+	: =d (dst) 		\
+	: di (x), di (w), o R(psrc))
+
+/* luna68k version PUTBITS() that puts w bits from bit x at pdst memory */
+/* XXX this macro assumes (x + w) = 32 to handle unaligned residual bits */
+#define	FASTPUTBITS(src, x, w, pdst)	\
+do {	\
+	uint32_t __tmp;			\
+	__tmp = R(pdst);		\
+	asm(bfins %3,%0{%1:%2}	\
+	: +d (__tmp)		\
+	: di (x), di (w), d (src));\
+	W(pdst) = __tmp;		\
+} while (/* CONSTCOND */0)
+
+#define	GETBITS(psrc, x, w, dst)	FASTGETBITS(psrc, x, w, dst)
+#define	PUTBITS(src, x, w, pdst)	FASTPUTBITS(src, x, w, pdst)
+
+/*
  * Blit a character at the specified co-ordinates.
  */
 static void
@@ -256,9 +284,11 @@ static void
 om_copycols(void *cookie, int startrow, int srccol, int dstcol, int ncols)
 {
 	struct rasops_info *ri = cookie;
-	uint8_t *sp, *dp, *basep;
-	int scanspan, height, width, align, shift, w, y, srcx, dstx;
-	uint32_t lmask, rmask;
+	uint8_t *sp, *dp, *sq, *dq, *basep;
+	int scanspan, height, w, y, srcx, dstx;
+	int sb, eb, db, sboff, full, cnt, lnum, rnum;
+	uint32_t lmask, rmask, tmp;
+	bool sbover;
 
 	scanspan = ri-ri_stride;
 	y = ri-ri_font-fontheight * startrow;
@@ -268,82 +298,116 @@ om_copycols(void *cookie, int startrow, 
 	w = ri-ri_font-fontwidth * ncols;
 	basep = (uint8_t *)ri-ri_bits + y * scanspan;
 
-	align = shift = srcx  ALIGNMASK;
-	width = w + align;
-	align = dstx  ALIGNMASK;
-	lmask = ALL1BITS  align;
-	rmask = ALL1BITS  (-(w + align)  ALIGNMASK);
-	shift = align - shift;
-	sp = basep + (srcx / 32) * 4;
-	dp = basep + (dstx / 32) * 4;
+	sb = srcx  ALIGNMASK;
+	db = dstx  ALIGNMASK;
 
-	if (shift != 0)
-		goto hardluckalignment;
+	if (db + w = BLITWIDTH) {
+		/* Destination is contained within a single word */
+		sp = basep + (srcx / 32) * 4;
+		dp = basep + (dstx / 32) * 4;
 
-	/* alignments comfortably match */
-	if (width = BLITWIDTH) {
-		lmask = rmask;
 		while (height  0) {
-			W(dp) = (R(dp)  ~lmask) | (R(sp)  lmask);
+			GETBITS(sp, sb, w, tmp);
+			PUTBITS(tmp, db, w, dp);
 			dp += scanspan;
 			sp += scanspan;
 			height--;
 		}
+		return;
 	}
-	/* copy forward (left-to-right) */
-	else if (dstcol  srccol || srccol + ncols  dstcol) {
-		uint8_t *sq = sp, *dq = dp;
 
-		w = width;
+	lmask = (db == 0) ? 0 : ALL1BITS  db;
+	eb = (db + w)  ALIGNMASK;
+	rmask = (eb == 0) ? 0 : ALL1BITS  (32 - eb); 
+	lnum = (32 - db)  ALIGNMASK;
+	rnum = (dstx + w)  ALIGNMASK;
+
+	if (lmask != 0)
+		full = (w - (32 - db)) / 32;
+	else
+		full = w / 32;
+
+	sbover = (sb + lnum) = 32;
+
+	if (dstcol  srccol || srccol + ncols  dstcol) {
+		/* copy forward (left-to-right) */
+		

CVS commit: [netbsd-6] src/sys/netinet

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:29:29 UTC 2013

Modified Files:
src/sys/netinet [netbsd-6]: tcp_usrreq.c

Log Message:
Pull up following revision(s) (requested by kefren in ticket #992):
sys/netinet/tcp_usrreq.c: revision 1.170
Update TCP CB with new values on rfc1323 and mssdflt sysctl updates
=46rom yasuoka-cj7txg5mjn14eiagz67...@public.gmane.org in kern/44254


To generate a diff of this commit:
cvs rdiff -u -r1.162.2.2 -r1.162.2.3 src/sys/netinet/tcp_usrreq.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/netinet/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.162.2.2 src/sys/netinet/tcp_usrreq.c:1.162.2.3
--- src/sys/netinet/tcp_usrreq.c:1.162.2.2	Sun Oct 20 13:29:37 2013
+++ src/sys/netinet/tcp_usrreq.c	Sat Dec 14 19:29:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.162.2.2 2013/10/20 13:29:37 bouyer Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.162.2.3 2013/12/14 19:29:29 bouyer Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -95,7 +95,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.162.2.2 2013/10/20 13:29:37 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.162.2.3 2013/12/14 19:29:29 bouyer Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -1048,10 +1048,43 @@ sysctl_net_inet_tcp_mssdflt(SYSCTLFN_ARG
 		return (EINVAL);
 	tcp_mssdflt = mssdflt;
 
+	mutex_enter(softnet_lock);
+	tcp_tcpcb_template();
+	mutex_exit(softnet_lock);
+
 	return (0);
 }
 
 /*
+ * sysctl helper for TCP CB template update
+ */
+static int
+sysctl_update_tcpcb_template(SYSCTLFN_ARGS)
+{
+	int t, error;
+	struct sysctlnode node;
+
+	/* follow procedures in sysctl(9) manpage */
+	t = *(int *)rnode-sysctl_data;
+	node = *rnode;
+	node.sysctl_data = t;
+	error = sysctl_lookup(SYSCTLFN_CALL(node));
+	if (error || newp == NULL)
+		return error;
+
+	if (t  0)
+		return EINVAL;
+
+	*(int *)rnode-sysctl_data = t;
+
+	mutex_enter(softnet_lock);
+	tcp_tcpcb_template();
+	mutex_exit(softnet_lock);
+
+	return 0;
+}
+
+/*
  * sysctl helper routine for setting port related values under
  * net.inet.ip and net.inet6.ip6.  does basic range checking and does
  * additional checks for each type.  this code has placed in
@@ -1676,7 +1709,7 @@ sysctl_net_inet_tcp_setup2(struct sysctl
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, rfc1323,
 		   SYSCTL_DESCR(Enable RFC1323 TCP extensions),
-		   NULL, 0, tcp_do_rfc1323, 0,
+		   sysctl_update_tcpcb_template, 0, tcp_do_rfc1323, 0,
 		   CTL_NET, pf, IPPROTO_TCP, TCPCTL_RFC1323, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
@@ -1776,13 +1809,13 @@ sysctl_net_inet_tcp_setup2(struct sysctl
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, win_scale,
 		   SYSCTL_DESCR(Use RFC1323 window scale options),
-		   NULL, 0, tcp_do_win_scale, 0,
+		   sysctl_update_tcpcb_template, 0, tcp_do_win_scale, 0,
 		   CTL_NET, pf, IPPROTO_TCP, TCPCTL_WSCALE, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, timestamps,
 		   SYSCTL_DESCR(Use RFC1323 time stamp options),
-		   NULL, 0, tcp_do_timestamps, 0,
+		   sysctl_update_tcpcb_template, 0, tcp_do_timestamps, 0,
 		   CTL_NET, pf, IPPROTO_TCP, TCPCTL_TSTAMP, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:31:17 UTC 2013

Modified Files:
src/sys/compat/linux/common [netbsd-6]: linux_misc.c

Log Message:
Pull up following revision(s) (requested by hauke in ticket #993):
sys/compat/linux/common/linux_misc.c: revision 1.227
On linux_sys_getdents, insert d_type at the end of each record.
Fixes PR kern/47806.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.219.8.1 src/sys/compat/linux/common/linux_misc.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/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.219 src/sys/compat/linux/common/linux_misc.c:1.219.8.1
--- src/sys/compat/linux/common/linux_misc.c:1.219	Fri Oct 14 09:23:28 2011
+++ src/sys/compat/linux/common/linux_misc.c	Sat Dec 14 19:31:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.219.8.1 2013/12/14 19:31:17 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_misc.c,v 1.219.8.1 2013/12/14 19:31:17 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -780,9 +780,10 @@ again:
 			}
 			idb.d_off = (linux_off_t)off;
 			idb.d_reclen = (u_short)linux_reclen;
+			/* Linux puts d_type at the end of each record */
+			*((char *)idb + idb.d_reclen - 1) = bdp-d_type;
 		}
 		strcpy(idb.d_name, bdp-d_name);
-		idb.d_name[strlen(idb.d_name) + 1] = bdp-d_type;
 		if ((error = copyout((void *)idb, outp, linux_reclen)))
 			goto out;
 		/* advance past this real entry */



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:33:28 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6]: locore.s

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #994):
sys/arch/sparc64/sparc64/locore.s: revision 1.350
Increase an interrupt depth only in the case of hardware interrupts,
and remove the ci_idepth trick in softint_fastintr.
Fixes the following diagnostic panic reported in port-sparc64.
  panic: kernel diagnostic assertion !cpu_intr_p() failed: file
  ../../../../kern/subr_xcall.c, line 351


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.4 -r1.338.8.5 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4 src/sys/arch/sparc64/sparc64/locore.s:1.338.8.5
--- src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4	Fri Feb  8 20:58:17 2013
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Dec 14 19:33:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.338.8.4 2013/02/08 20:58:17 riz Exp $	*/
+/*	$NetBSD: locore.s,v 1.338.8.5 2013/12/14 19:33:28 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -3284,12 +3284,6 @@ ENTRY_NOPROFILE(sparc_interrupt)
 	 LDPTR	[%g3 + %lo(CPUINFO_VA+CI_TICK_IH)], %g5
 0:
 
-	! Increment the per-cpu interrupt level
-	sethi	%hi(CPUINFO_VA+CI_IDEPTH), %g1
-	ld	[%g1 + %lo(CPUINFO_VA+CI_IDEPTH)], %g2
-	inc	%g2
-	st	%g2, [%g1 + %lo(CPUINFO_VA+CI_IDEPTH)]
-
 #ifdef TRAPSTATS
 	sethi	%hi(_C_LABEL(kintrcnt)), %g1
 	sethi	%hi(_C_LABEL(uintrcnt)), %g2
@@ -3378,6 +3372,17 @@ ENTRY_NOPROFILE(sparc_interrupt)
 	
 	wrpr	%l6, %pil
 
+#define SOFTINT_INT \
+	(1IPL_SOFTCLOCK|1IPL_SOFTBIO|1IPL_SOFTNET|1IPL_SOFTSERIAL)
+
+	! Increment the per-cpu interrupt depth in case of hardintrs
+	btst	SOFTINT_INT, %l3
+	bnz,pn	%icc, sparc_intr_retry
+	 sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l1
+	ld	[%l1 + %lo(CPUINFO_VA+CI_IDEPTH)], %l2
+	inc	%l2
+	st	%l2, [%l1 + %lo(CPUINFO_VA+CI_IDEPTH)]
+
 sparc_intr_retry:
 	wr	%l3, 0, CLEAR_SOFTINT	! (don't clear possible %tick IRQ)
 	sethi	%hi(CPUINFO_VA+CI_INTRPENDING), %l4
@@ -3477,11 +3482,14 @@ intrcmplt:
 	bnz,pn	%icc, sparc_intr_retry
 	 mov	1, %l5			! initialize intr count for next run
 
-	! Decrement this cpu's interrupt depth
-	sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l4
+	! Decrement this cpu's interrupt depth in case of hardintrs
+	btst	SOFTINT_INT, %l3
+	bnz,pn	%icc, 1f
+	 sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l4
 	ld	[%l4 + %lo(CPUINFO_VA+CI_IDEPTH)], %l5
 	dec	%l5
 	st	%l5, [%l4 + %lo(CPUINFO_VA+CI_IDEPTH)]
+1:
 
 #ifdef NOT_DEBUG
 	set	_C_LABEL(intrdebug), %o2
@@ -5233,11 +5241,8 @@ ENTRY(softint_fastintr)
 	set	CPUINFO_VA, %l0			! l0 = curcpu()
 	rdpr	%pil, %l7			! l7 = splhigh()
 	wrpr	%g0, PIL_HIGH, %pil
-	ld	[%l0 + CI_IDEPTH], %l1
 	LDPTR	[%l0 + CI_EINTSTACK], %l6	! l6 = ci_eintstack
-	dec	%l1
 	add	%sp, -CC64FSZ, %l2		! ci_eintstack = sp - CC64FSZ
-	st	%l1, [%l0 + CI_IDEPTH]		! adjust ci_idepth
 	STPTR	%l2, [%l0 + CI_EINTSTACK]	! save intstack for nexted intr
 
 	mov	%i0, %o0			! o0/i0 = softint lwp
@@ -5282,10 +5287,7 @@ ENTRY(softint_fastintr)
 
 	restore	! rewind register window
 
-	ld	[%l0 + CI_IDEPTH], %l1
 	STPTR	%l6, [%l0 + CI_EINTSTACK]	! restore ci_eintstack
-	inc	%l1
-	st	%l1, [%l0 + CI_IDEPTH]		! re-adjust ci_idepth
 	wrpr	%g0, %l7, %pil			! restore ipl
 	ret
 	 restore	%g0, 1, %o0
@@ -5309,10 +5311,7 @@ softint_fastintr_ret:
 	st	%o1, [%l0 + CI_MTX_COUNT]
 	st	%g0, [%o0 + L_CTXSWTCH]		! prev-l_ctxswtch = 0
 
-	ld	[%l0 + CI_IDEPTH], %l1
 	STPTR	%l6, [%l0 + CI_EINTSTACK]	! restore ci_eintstack
-	inc	%l1
-	st	%l1, [%l0 + CI_IDEPTH]		! re-adjust ci_idepth
 	wrpr	%g0, %l7, %pil			! restore ipl
 	ret
 	 restore	%g0, 1, %o0



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:33:45 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-0]: locore.s

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #994):
sys/arch/sparc64/sparc64/locore.s: revision 1.350
Increase an interrupt depth only in the case of hardware interrupts,
and remove the ci_idepth trick in softint_fastintr.
Fixes the following diagnostic panic reported in port-sparc64.
  panic: kernel diagnostic assertion !cpu_intr_p() failed: file
  ../../../../kern/subr_xcall.c, line 351


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.2 -r1.338.8.2.4.1 \
src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.338.8.2 src/sys/arch/sparc64/sparc64/locore.s:1.338.8.2.4.1
--- src/sys/arch/sparc64/sparc64/locore.s:1.338.8.2	Wed Mar 21 16:10:21 2012
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Dec 14 19:33:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.338.8.2 2012/03/21 16:10:21 riz Exp $	*/
+/*	$NetBSD: locore.s,v 1.338.8.2.4.1 2013/12/14 19:33:45 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -3281,12 +3281,6 @@ ENTRY_NOPROFILE(sparc_interrupt)
 	 LDPTR	[%g3 + %lo(CPUINFO_VA+CI_TICK_IH)], %g5
 0:
 
-	! Increment the per-cpu interrupt level
-	sethi	%hi(CPUINFO_VA+CI_IDEPTH), %g1
-	ld	[%g1 + %lo(CPUINFO_VA+CI_IDEPTH)], %g2
-	inc	%g2
-	st	%g2, [%g1 + %lo(CPUINFO_VA+CI_IDEPTH)]
-
 #ifdef TRAPSTATS
 	sethi	%hi(_C_LABEL(kintrcnt)), %g1
 	sethi	%hi(_C_LABEL(uintrcnt)), %g2
@@ -3375,6 +3369,17 @@ ENTRY_NOPROFILE(sparc_interrupt)
 	
 	wrpr	%l6, %pil
 
+#define SOFTINT_INT \
+	(1IPL_SOFTCLOCK|1IPL_SOFTBIO|1IPL_SOFTNET|1IPL_SOFTSERIAL)
+
+	! Increment the per-cpu interrupt depth in case of hardintrs
+	btst	SOFTINT_INT, %l3
+	bnz,pn	%icc, sparc_intr_retry
+	 sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l1
+	ld	[%l1 + %lo(CPUINFO_VA+CI_IDEPTH)], %l2
+	inc	%l2
+	st	%l2, [%l1 + %lo(CPUINFO_VA+CI_IDEPTH)]
+
 sparc_intr_retry:
 	wr	%l3, 0, CLEAR_SOFTINT	! (don't clear possible %tick IRQ)
 	sethi	%hi(CPUINFO_VA+CI_INTRPENDING), %l4
@@ -3474,11 +3479,14 @@ intrcmplt:
 	bnz,pn	%icc, sparc_intr_retry
 	 mov	1, %l5			! initialize intr count for next run
 
-	! Decrement this cpu's interrupt depth
-	sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l4
+	! Decrement this cpu's interrupt depth in case of hardintrs
+	btst	SOFTINT_INT, %l3
+	bnz,pn	%icc, 1f
+	 sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l4
 	ld	[%l4 + %lo(CPUINFO_VA+CI_IDEPTH)], %l5
 	dec	%l5
 	st	%l5, [%l4 + %lo(CPUINFO_VA+CI_IDEPTH)]
+1:
 
 #ifdef NOT_DEBUG
 	set	_C_LABEL(intrdebug), %o2
@@ -5230,11 +5238,8 @@ ENTRY(softint_fastintr)
 	set	CPUINFO_VA, %l0			! l0 = curcpu()
 	rdpr	%pil, %l7			! l7 = splhigh()
 	wrpr	%g0, PIL_HIGH, %pil
-	ld	[%l0 + CI_IDEPTH], %l1
 	LDPTR	[%l0 + CI_EINTSTACK], %l6	! l6 = ci_eintstack
-	dec	%l1
 	add	%sp, -CC64FSZ, %l2		! ci_eintstack = sp - CC64FSZ
-	st	%l1, [%l0 + CI_IDEPTH]		! adjust ci_idepth
 	STPTR	%l2, [%l0 + CI_EINTSTACK]	! save intstack for nexted intr
 
 	mov	%i0, %o0			! o0/i0 = softint lwp
@@ -5279,10 +5284,7 @@ ENTRY(softint_fastintr)
 
 	restore	! rewind register window
 
-	ld	[%l0 + CI_IDEPTH], %l1
 	STPTR	%l6, [%l0 + CI_EINTSTACK]	! restore ci_eintstack
-	inc	%l1
-	st	%l1, [%l0 + CI_IDEPTH]		! re-adjust ci_idepth
 	wrpr	%g0, %l7, %pil			! restore ipl
 	ret
 	 restore	%g0, 1, %o0
@@ -5306,10 +5308,7 @@ softint_fastintr_ret:
 	st	%o1, [%l0 + CI_MTX_COUNT]
 	st	%g0, [%o0 + L_CTXSWTCH]		! prev-l_ctxswtch = 0
 
-	ld	[%l0 + CI_IDEPTH], %l1
 	STPTR	%l6, [%l0 + CI_EINTSTACK]	! restore ci_eintstack
-	inc	%l1
-	st	%l1, [%l0 + CI_IDEPTH]		! re-adjust ci_idepth
 	wrpr	%g0, %l7, %pil			! restore ipl
 	ret
 	 restore	%g0, 1, %o0



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:33:54 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-1]: locore.s

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #994):
sys/arch/sparc64/sparc64/locore.s: revision 1.350
Increase an interrupt depth only in the case of hardware interrupts,
and remove the ci_idepth trick in softint_fastintr.
Fixes the following diagnostic panic reported in port-sparc64.
  panic: kernel diagnostic assertion !cpu_intr_p() failed: file
  ../../../../kern/subr_xcall.c, line 351


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.4 -r1.338.8.4.2.1 \
src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4 src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4.2.1
--- src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4	Fri Feb  8 20:58:17 2013
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Dec 14 19:33:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.338.8.4 2013/02/08 20:58:17 riz Exp $	*/
+/*	$NetBSD: locore.s,v 1.338.8.4.2.1 2013/12/14 19:33:54 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -3284,12 +3284,6 @@ ENTRY_NOPROFILE(sparc_interrupt)
 	 LDPTR	[%g3 + %lo(CPUINFO_VA+CI_TICK_IH)], %g5
 0:
 
-	! Increment the per-cpu interrupt level
-	sethi	%hi(CPUINFO_VA+CI_IDEPTH), %g1
-	ld	[%g1 + %lo(CPUINFO_VA+CI_IDEPTH)], %g2
-	inc	%g2
-	st	%g2, [%g1 + %lo(CPUINFO_VA+CI_IDEPTH)]
-
 #ifdef TRAPSTATS
 	sethi	%hi(_C_LABEL(kintrcnt)), %g1
 	sethi	%hi(_C_LABEL(uintrcnt)), %g2
@@ -3378,6 +3372,17 @@ ENTRY_NOPROFILE(sparc_interrupt)
 	
 	wrpr	%l6, %pil
 
+#define SOFTINT_INT \
+	(1IPL_SOFTCLOCK|1IPL_SOFTBIO|1IPL_SOFTNET|1IPL_SOFTSERIAL)
+
+	! Increment the per-cpu interrupt depth in case of hardintrs
+	btst	SOFTINT_INT, %l3
+	bnz,pn	%icc, sparc_intr_retry
+	 sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l1
+	ld	[%l1 + %lo(CPUINFO_VA+CI_IDEPTH)], %l2
+	inc	%l2
+	st	%l2, [%l1 + %lo(CPUINFO_VA+CI_IDEPTH)]
+
 sparc_intr_retry:
 	wr	%l3, 0, CLEAR_SOFTINT	! (don't clear possible %tick IRQ)
 	sethi	%hi(CPUINFO_VA+CI_INTRPENDING), %l4
@@ -3477,11 +3482,14 @@ intrcmplt:
 	bnz,pn	%icc, sparc_intr_retry
 	 mov	1, %l5			! initialize intr count for next run
 
-	! Decrement this cpu's interrupt depth
-	sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l4
+	! Decrement this cpu's interrupt depth in case of hardintrs
+	btst	SOFTINT_INT, %l3
+	bnz,pn	%icc, 1f
+	 sethi	%hi(CPUINFO_VA+CI_IDEPTH), %l4
 	ld	[%l4 + %lo(CPUINFO_VA+CI_IDEPTH)], %l5
 	dec	%l5
 	st	%l5, [%l4 + %lo(CPUINFO_VA+CI_IDEPTH)]
+1:
 
 #ifdef NOT_DEBUG
 	set	_C_LABEL(intrdebug), %o2
@@ -5233,11 +5241,8 @@ ENTRY(softint_fastintr)
 	set	CPUINFO_VA, %l0			! l0 = curcpu()
 	rdpr	%pil, %l7			! l7 = splhigh()
 	wrpr	%g0, PIL_HIGH, %pil
-	ld	[%l0 + CI_IDEPTH], %l1
 	LDPTR	[%l0 + CI_EINTSTACK], %l6	! l6 = ci_eintstack
-	dec	%l1
 	add	%sp, -CC64FSZ, %l2		! ci_eintstack = sp - CC64FSZ
-	st	%l1, [%l0 + CI_IDEPTH]		! adjust ci_idepth
 	STPTR	%l2, [%l0 + CI_EINTSTACK]	! save intstack for nexted intr
 
 	mov	%i0, %o0			! o0/i0 = softint lwp
@@ -5282,10 +5287,7 @@ ENTRY(softint_fastintr)
 
 	restore	! rewind register window
 
-	ld	[%l0 + CI_IDEPTH], %l1
 	STPTR	%l6, [%l0 + CI_EINTSTACK]	! restore ci_eintstack
-	inc	%l1
-	st	%l1, [%l0 + CI_IDEPTH]		! re-adjust ci_idepth
 	wrpr	%g0, %l7, %pil			! restore ipl
 	ret
 	 restore	%g0, 1, %o0
@@ -5309,10 +5311,7 @@ softint_fastintr_ret:
 	st	%o1, [%l0 + CI_MTX_COUNT]
 	st	%g0, [%o0 + L_CTXSWTCH]		! prev-l_ctxswtch = 0
 
-	ld	[%l0 + CI_IDEPTH], %l1
 	STPTR	%l6, [%l0 + CI_EINTSTACK]	! restore ci_eintstack
-	inc	%l1
-	st	%l1, [%l0 + CI_IDEPTH]		! re-adjust ci_idepth
 	wrpr	%g0, %l7, %pil			! restore ipl
 	ret
 	 restore	%g0, 1, %o0



CVS commit: [netbsd-6] src/sys/kern

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:36:33 UTC 2013

Modified Files:
src/sys/kern [netbsd-6]: uipc_syscalls.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #996):
sys/kern/uipc_syscalls.c: revision 1.163
PR/47591: Michael Plass: If the unix socket is closed before accept,
unp-unp_conn will be NULL in PRU_ACCEPT, as called from
sys_accept-so_accept. This will cause the usrreq to return with
no error, leaving the mbuf gotten from m_get() with an uninitialized
length, containing junk from a previous call. Initialize m_len to
be 0 to handle this case. This is yet another reason why Beverly's
idea of setting m_len = 0 in m_get() makes a lot of sense. Arguably
this could be an error, since the data we return now has 0 family
and length.


To generate a diff of this commit:
cvs rdiff -u -r1.154.2.4 -r1.154.2.5 src/sys/kern/uipc_syscalls.c

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

Modified files:

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.154.2.4 src/sys/kern/uipc_syscalls.c:1.154.2.5
--- src/sys/kern/uipc_syscalls.c:1.154.2.4	Mon Feb 18 22:00:49 2013
+++ src/sys/kern/uipc_syscalls.c	Sat Dec 14 19:36:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.154.2.4 2013/02/18 22:00:49 riz Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.154.2.5 2013/12/14 19:36:33 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.154.2.4 2013/02/18 22:00:49 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.154.2.5 2013/12/14 19:36:33 bouyer Exp $);
 
 #include opt_pipe.h
 
@@ -184,6 +184,7 @@ do_sys_accept(struct lwp *l, int sock, s
 		return (error);
 	}
 	nam = m_get(M_WAIT, MT_SONAME);
+	nam-m_len = 0;
 	*new_sock = fd;
 	so = fp-f_data;
 	solock(so);



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:36:58 UTC 2013

Modified Files:
src/sys/kern [netbsd-6-1]: uipc_syscalls.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #996):
sys/kern/uipc_syscalls.c: revision 1.163
PR/47591: Michael Plass: If the unix socket is closed before accept,
unp-unp_conn will be NULL in PRU_ACCEPT, as called from
sys_accept-so_accept. This will cause the usrreq to return with
no error, leaving the mbuf gotten from m_get() with an uninitialized
length, containing junk from a previous call. Initialize m_len to
be 0 to handle this case. This is yet another reason why Beverly's
idea of setting m_len = 0 in m_get() makes a lot of sense. Arguably
this could be an error, since the data we return now has 0 family
and length.


To generate a diff of this commit:
cvs rdiff -u -r1.154.2.4 -r1.154.2.4.2.1 src/sys/kern/uipc_syscalls.c

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

Modified files:

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.154.2.4 src/sys/kern/uipc_syscalls.c:1.154.2.4.2.1
--- src/sys/kern/uipc_syscalls.c:1.154.2.4	Mon Feb 18 22:00:49 2013
+++ src/sys/kern/uipc_syscalls.c	Sat Dec 14 19:36:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.154.2.4 2013/02/18 22:00:49 riz Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.154.2.4.2.1 2013/12/14 19:36:58 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.154.2.4 2013/02/18 22:00:49 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.154.2.4.2.1 2013/12/14 19:36:58 bouyer Exp $);
 
 #include opt_pipe.h
 
@@ -184,6 +184,7 @@ do_sys_accept(struct lwp *l, int sock, s
 		return (error);
 	}
 	nam = m_get(M_WAIT, MT_SONAME);
+	nam-m_len = 0;
 	*new_sock = fd;
 	so = fp-f_data;
 	solock(so);



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:37:02 UTC 2013

Modified Files:
src/sys/kern [netbsd-6-0]: uipc_syscalls.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #996):
sys/kern/uipc_syscalls.c: revision 1.163
PR/47591: Michael Plass: If the unix socket is closed before accept,
unp-unp_conn will be NULL in PRU_ACCEPT, as called from
sys_accept-so_accept. This will cause the usrreq to return with
no error, leaving the mbuf gotten from m_get() with an uninitialized
length, containing junk from a previous call. Initialize m_len to
be 0 to handle this case. This is yet another reason why Beverly's
idea of setting m_len = 0 in m_get() makes a lot of sense. Arguably
this could be an error, since the data we return now has 0 family
and length.


To generate a diff of this commit:
cvs rdiff -u -r1.154.2.1.4.1 -r1.154.2.1.4.2 src/sys/kern/uipc_syscalls.c

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

Modified files:

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.154.2.1.4.1 src/sys/kern/uipc_syscalls.c:1.154.2.1.4.2
--- src/sys/kern/uipc_syscalls.c:1.154.2.1.4.1	Mon Jan  7 16:53:36 2013
+++ src/sys/kern/uipc_syscalls.c	Sat Dec 14 19:37:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.154.2.1.4.1 2013/01/07 16:53:36 riz Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.154.2.1.4.2 2013/12/14 19:37:02 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.154.2.1.4.1 2013/01/07 16:53:36 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.154.2.1.4.2 2013/12/14 19:37:02 bouyer Exp $);
 
 #include opt_pipe.h
 
@@ -184,6 +184,7 @@ do_sys_accept(struct lwp *l, int sock, s
 		return (error);
 	}
 	nam = m_get(M_WAIT, MT_SONAME);
+	nam-m_len = 0;
 	*new_sock = fd;
 	so = fp-f_data;
 	solock(so);



CVS commit: [netbsd-6-0] src/doc

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:37:40 UTC 2013

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.4

Log Message:
tickets 994, 996


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-6.0.4

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-6.0.4
diff -u src/doc/CHANGES-6.0.4:1.1.2.6 src/doc/CHANGES-6.0.4:1.1.2.7
--- src/doc/CHANGES-6.0.4:1.1.2.6	Mon Nov 25 08:31:28 2013
+++ src/doc/CHANGES-6.0.4	Sat Dec 14 19:37:40 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.4,v 1.1.2.6 2013/11/25 08:31:28 bouyer Exp $
+# $NetBSD: CHANGES-6.0.4,v 1.1.2.7 2013/12/14 19:37:40 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.3 release to the NetBSD 6.0.4
 release:
@@ -82,3 +82,22 @@ sys/uvm/uvm_km.c1.125
 	freeing to the wrong vmem arena in case of failed page allocations.
 	[para, ticket #989]
 
+sys/arch/sparc64/sparc64/locore.s		1.350
+
+	Increase an interrupt depth only in the case of hardware interrupts,
+	and remove the ci_idepth trick in softint_fastintr.
+	Fixes the following diagnostic panic reported in port-sparc64.
+	  panic: kernel diagnostic assertion !cpu_intr_p() failed: file
+	  ../../../../kern/subr_xcall.c, line 351
+	[nakayama, ticket #994]
+
+sys/kern/uipc_syscalls.c			1.163
+
+	PR/47591: Michael Plass: If the unix socket is closed before accept,
+	unp-unp_conn will be NULL in PRU_ACCEPT, as called from
+	sys_accept-so_accept. This will cause the usrreq to return with
+	no error, leaving the mbuf gotten from m_get() with an uninitialized
+	length, containing junk from a previous call. Initialize m_len to
+	be 0 to handle this case. 
+	[spz, ticket #996]
+



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

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:37:44 UTC 2013

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.3

Log Message:
tickets 994, 996


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-6.1.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-6.1.3
diff -u src/doc/CHANGES-6.1.3:1.1.2.6 src/doc/CHANGES-6.1.3:1.1.2.7
--- src/doc/CHANGES-6.1.3:1.1.2.6	Mon Nov 25 08:31:24 2013
+++ src/doc/CHANGES-6.1.3	Sat Dec 14 19:37:44 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.3,v 1.1.2.6 2013/11/25 08:31:24 bouyer Exp $
+# $NetBSD: CHANGES-6.1.3,v 1.1.2.7 2013/12/14 19:37:44 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.1 release to the NetBSD 6.1.2
 release:
@@ -90,3 +90,22 @@ sys/uvm/uvm_km.c1.125
 	freeing to the wrong vmem arena in case of failed page allocations.
 	[para, ticket #989]
 
+sys/arch/sparc64/sparc64/locore.s		1.350
+
+	Increase an interrupt depth only in the case of hardware interrupts,
+	and remove the ci_idepth trick in softint_fastintr.
+	Fixes the following diagnostic panic reported in port-sparc64.
+	  panic: kernel diagnostic assertion !cpu_intr_p() failed: file
+	  ../../../../kern/subr_xcall.c, line 351
+	[nakayama, ticket #994]
+
+sys/kern/uipc_syscalls.c			1.163
+
+	PR/47591: Michael Plass: If the unix socket is closed before accept,
+	unp-unp_conn will be NULL in PRU_ACCEPT, as called from
+	sys_accept-so_accept. This will cause the usrreq to return with
+	no error, leaving the mbuf gotten from m_get() with an uninitialized
+	length, containing junk from a previous call. Initialize m_len to
+	be 0 to handle this case. 
+	[spz, ticket #996]
+



CVS commit: [netbsd-6] src/doc

2013-12-14 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec 14 19:38:21 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
tickets 990, 992, 993, 994, 996


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.62 -r1.1.2.63 src/doc/CHANGES-6.2

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-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.62 src/doc/CHANGES-6.2:1.1.2.63
--- src/doc/CHANGES-6.2:1.1.2.62	Mon Dec  9 20:25:28 2013
+++ src/doc/CHANGES-6.2	Sat Dec 14 19:38:21 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.62 2013/12/09 20:25:28 bouyer Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.63 2013/12/14 19:38:21 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -1040,3 +1040,43 @@ sys/uvm/uvm_km.c1.125
 	freeing to the wrong vmem arena in case of failed page allocations.
 	[para, ticket #989]
 
+sys/dev/usb/ehci.c1.221
+
+	In ehci_check_qh_intr don't treat a short control transfer as done
+	if the status phase is still inflight.  Let the hardware complete it.
+	PR/48358: Repeated low-speed USB control transfers returning short data
+		  fail on EHCI
+	PR/46696: uhub disables port where USB keyboard attached
+	[skrll, ticket #990]
+
+sys/netinet/tcp_usrreq.c			1.170
+
+	Update TCP CB with new values on rfc1323 and mssdflt sysctl updates
+	From yasuoka-cj7txg5mjn14eiagz67...@public.gmane.org in kern/44254
+	[kefren, ticket #992]
+
+sys/compat/linux/common/linux_misc.c		1.227
+
+	On linux_sys_getdents, insert d_type at the end of each record.
+	Fixes PR kern/47806.
+	[hauke, ticket #993]
+
+sys/arch/sparc64/sparc64/locore.s		1.350
+
+	Increase an interrupt depth only in the case of hardware interrupts,
+	and remove the ci_idepth trick in softint_fastintr.
+	Fixes the following diagnostic panic reported in port-sparc64.
+	  panic: kernel diagnostic assertion !cpu_intr_p() failed: file
+	  ../../../../kern/subr_xcall.c, line 351
+	[nakayama, ticket #994]
+
+sys/kern/uipc_syscalls.c			1.163
+
+	PR/47591: Michael Plass: If the unix socket is closed before accept,
+	unp-unp_conn will be NULL in PRU_ACCEPT, as called from
+	sys_accept-so_accept. This will cause the usrreq to return with
+	no error, leaving the mbuf gotten from m_get() with an uninitialized
+	length, containing junk from a previous call. Initialize m_len to
+	be 0 to handle this case. 
+	[spz, ticket #996]
+



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

2013-12-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 14 19:51:13 UTC 2013

Modified Files:
src/sys/arch/luna68k/dev: lunafb.c

Log Message:
Initialize capabilities in struct wsscreen_descr per omrasops settings.

Now REVERSE characters are drawn properly.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/luna68k/dev/lunafb.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/luna68k/dev/lunafb.c
diff -u src/sys/arch/luna68k/dev/lunafb.c:1.27 src/sys/arch/luna68k/dev/lunafb.c:1.28
--- src/sys/arch/luna68k/dev/lunafb.c:1.27	Fri Jul 19 16:35:57 2013
+++ src/sys/arch/luna68k/dev/lunafb.c	Sat Dec 14 19:51:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.27 2013/07/19 16:35:57 tsutsui Exp $ */
+/* $NetBSD: lunafb.c,v 1.28 2013/12/14 19:51:13 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: lunafb.c,v 1.27 2013/07/19 16:35:57 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: lunafb.c,v 1.28 2013/12/14 19:51:13 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -461,6 +461,7 @@ omfb_getdevconfig(paddr_t paddr, struct 
 	omfb_stdscreen.nrows = ri-ri_rows;
 	omfb_stdscreen.ncols = ri-ri_cols;
 	omfb_stdscreen.textops = ri-ri_ops;
+	omfb_stdscreen.capabilities = ri-ri_caps;
 	omfb_stdscreen.fontwidth = ri-ri_font-fontwidth;
 	omfb_stdscreen.fontheight = ri-ri_font-fontheight;
 }



CVS commit: src/sys/nfs

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 14 22:04:03 UTC 2013

Modified Files:
src/sys/nfs: nfs_serv.c

Log Message:
only prevent autounload, not regular unload when we have exports


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/nfs/nfs_serv.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/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.167 src/sys/nfs/nfs_serv.c:1.168
--- src/sys/nfs/nfs_serv.c:1.167	Sat Dec 14 11:19:28 2013
+++ src/sys/nfs/nfs_serv.c	Sat Dec 14 17:04:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.168 2013/12/14 22:04:03 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.168 2013/12/14 22:04:03 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -125,8 +125,6 @@ nfsserver_modcmd(modcmd_t cmd, void *arg
 		nfs_timer_srvinit(nfsrv_timer);
 		return 0;
 	case MODULE_CMD_FINI:
-		if (netexport_hasexports())
-			return EBUSY;
 		error = syscall_disestablish(NULL, nfsserver_syscalls);
 		if (error != 0) {
 			return error;
@@ -146,6 +144,10 @@ nfsserver_modcmd(modcmd_t cmd, void *arg
 		nfsrv_finicache();
 		nfs_fini();
 		return 0;
+	case MODULE_CMD_AUTOUNLOAD:
+		if (netexport_hasexports())
+			return EBUSY;
+		/*FALLTHROUGH*/
 	default:
 		return ENOTTY;
 	}



CVS commit: src/share/mk

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 00:28:45 UTC 2013

Modified Files:
src/share/mk: bsd.rpc.mk

Log Message:
centralize the rpcgen flags and set for BSD output


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/share/mk/bsd.rpc.mk

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

Modified files:

Index: src/share/mk/bsd.rpc.mk
diff -u src/share/mk/bsd.rpc.mk:1.12 src/share/mk/bsd.rpc.mk:1.13
--- src/share/mk/bsd.rpc.mk:1.12	Sat Sep 10 12:57:35 2011
+++ src/share/mk/bsd.rpc.mk	Sat Dec 14 19:28:45 2013
@@ -1,8 +1,9 @@
-#	$NetBSD: bsd.rpc.mk,v 1.12 2011/09/10 16:57:35 apb Exp $
+#	$NetBSD: bsd.rpc.mk,v 1.13 2013/12/15 00:28:45 christos Exp $
 
 .include bsd.init.mk
 
 RPC_XDIR?=	${.CURDIR}/
+RPCGEN_FLAGS?=	-B
 
 # We don't use implicit suffix rules here to avoid dependencies in the
 # Installed files.
@@ -12,7 +13,7 @@ RPC_XDIR?=	${.CURDIR}/
 .for I in ${RPC_INCS}
 ${I}: ${I:.h=.x}
 	${_MKTARGET_CREATE}
-	${TOOL_RPCGEN} -C -h ${RPC_XDIR}${I:.h=.x} -o ${.TARGET}
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -h ${RPC_XDIR}${I:.h=.x} -o ${.TARGET}
 .endfor
 
 DPSRCS+=	${RPC_INCS}
@@ -26,7 +27,7 @@ CLEANFILES+=	${RPC_INCS}
 .for I in ${RPC_XDRFILES}
 ${I}: ${RPC_XDIR}${I:_xdr.c=.x}
 	${_MKTARGET_CREATE}
-	${TOOL_RPCGEN} -C -c ${RPC_XDIR}${I:_xdr.c=.x} -o ${.TARGET}
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -c ${RPC_XDIR}${I:_xdr.c=.x} -o ${.TARGET}
 .endfor
 
 DPSRCS+=	${RPC_XDRFILES}
@@ -45,7 +46,7 @@ _RPCS += -s ${I}
 
 ${I}: ${RPC_XDIR}${I:_svc.c=.x}
 	${_MKTARGET_CREATE}
-	${TOOL_RPCGEN} -C ${_RPCS} ${RPC_SVCFLAGS} ${RPC_XDIR}${I:_svc.c=.x} \
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} ${_RPCS} ${RPC_SVCFLAGS} ${RPC_XDIR}${I:_svc.c=.x} \
 		-o ${.TARGET}
 .endfor
 
@@ -60,7 +61,7 @@ CLEANFILES+=	${RPC_SVCFILES}
 
 ${I}: ${RPC_XDIR}${I:_clnt.c=.x}
 	${_MKTARGET_CREATE}
-	${TOOL_RPCGEN} -C -l ${_RPCS} ${RPC_CLNTFLAGS} \
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -l ${_RPCS} ${RPC_CLNTFLAGS} \
 		${RPC_XDIR}${I:_clnt.c=.x} -o ${.TARGET}
 .endfor
 



CVS commit: src/usr.bin/rpcgen

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 00:40:17 UTC 2013

Modified Files:
src/usr.bin/rpcgen: rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c
rpc_parse.c rpc_sample.c rpc_scan.c rpc_svcout.c rpc_tblout.c
rpc_util.c rpc_util.h rpcgen.1

Log Message:
- remove support for pre-ansi output
- add -B (BSD) support for c++ output macros
- group functions to make output better looking


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/rpcgen/rpc_clntout.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/rpcgen/rpc_cout.c
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/rpcgen/rpc_hout.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/rpcgen/rpc_main.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/rpcgen/rpc_parse.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/rpcgen/rpc_sample.c \
src/usr.bin/rpcgen/rpc_scan.c src/usr.bin/rpcgen/rpc_util.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/rpcgen/rpc_svcout.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/rpcgen/rpc_tblout.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/rpcgen/rpc_util.h
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/rpcgen/rpcgen.1

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

Modified files:

Index: src/usr.bin/rpcgen/rpc_clntout.c
diff -u src/usr.bin/rpcgen/rpc_clntout.c:1.14 src/usr.bin/rpcgen/rpc_clntout.c:1.15
--- src/usr.bin/rpcgen/rpc_clntout.c:1.14	Sun Aug 11 04:03:10 2013
+++ src/usr.bin/rpcgen/rpc_clntout.c	Sat Dec 14 19:40:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_clntout.c,v 1.14 2013/08/11 08:03:10 dholland Exp $	*/
+/*	$NetBSD: rpc_clntout.c,v 1.15 2013/12/15 00:40:17 christos Exp $	*/
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  * unrestricted use provided that this legend is included on all tape
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)rpc_clntout.c 1.11 89/02/22 (C) 1987 SMI;
 #else
-__RCSID($NetBSD: rpc_clntout.c,v 1.14 2013/08/11 08:03:10 dholland Exp $);
+__RCSID($NetBSD: rpc_clntout.c,v 1.15 2013/12/15 00:40:17 christos Exp $);
 #endif
 #endif
 
@@ -53,10 +53,10 @@ __RCSID($NetBSD: rpc_clntout.c,v 1.14 2
 #include rpc_parse.h
 #include rpc_util.h
 
-static void write_program __P((definition *));
-static const char *ampr __P((const char *));
-static const char *aster __P((const char *));
-static void printbody __P((proc_list *));
+static void write_program(definition *);
+static const char *ampr(const char *);
+static const char *aster(const char *);
+static void printbody(proc_list *);
 
 #define DEFAULT_TIMEOUT 25	/* in seconds */
 static char RESULT[] = clnt_res;
@@ -119,84 +119,36 @@ printarglist(proc_list *proc, const char
 
 	if (!newstyle) {	/* old style: always pass argument by
  * reference */
-		if (Cflag) {	/* C++ style heading */
-			f_print(fout, ();
-			ptype(proc-args.decls-decl.prefix, proc-args.decls-decl.type, 1);
-			f_print(fout, *argp, );
-			if (Mflag) {
-if (streq(proc-res_type, void))
-	f_print(fout, char );
-else
-	ptype(proc-res_prefix, proc-res_type, 0);
-f_print(fout, %s%s, , aster(proc-res_type),
-result);
-			}
-			f_print(fout, %s%s)\n, addargtype, addargname);
-		} else {
-			f_print(fout, (argp, );
-			if (Mflag)
-f_print(fout, %s, , result);
-			f_print(fout, %s)\n, addargname);
-			f_print(fout, \t);
-			ptype(proc-args.decls-decl.prefix, proc-args.decls-decl.type, 1);
-			f_print(fout, *argp;\n);
-			if (Mflag) {
-f_print(fout, \t);
-if (streq(proc-res_type, void))
-	f_print(fout, char );
-else
-	ptype(proc-res_prefix, proc-res_type, 0);
-f_print(fout, %s%s;\n, aster(proc-res_type),
-result);
-			}
+		f_print(fout, ();
+		ptype(proc-args.decls-decl.prefix, proc-args.decls-decl.type, 1);
+		f_print(fout, *argp, );
+		if (Mflag) {
+			if (streq(proc-res_type, void))
+f_print(fout, char );
+			else
+ptype(proc-res_prefix, proc-res_type, 0);
+			f_print(fout, %s%s, , aster(proc-res_type),
+			result);
 		}
+		f_print(fout, %s%s)\n, addargtype, addargname);
 	} else {
 		f_print(fout, ();
 		if (!streq(proc-args.decls-decl.type, void)) {
 			/* new style, 1 or multiple arguments */
-			if (!Cflag) {
-for (l = proc-args.decls; l != NULL;
-l = l-next)
-	f_print(fout, %s, , l-decl.name);
-			} else {/* C++ style header */
-for (l = proc-args.decls; l != NULL;
-l = l-next)
-	pdeclaration(proc-args.argname,
-	l-decl, 0, , );
-			}
+			for (l = proc-args.decls; l != NULL; l = l-next)
+pdeclaration(proc-args.argname,
+l-decl, 0, , );
 		}
-		if (!Cflag) {
-			if (Mflag) {
-f_print(fout, \t);
-if (streq(proc-res_type, void))
-	f_print(fout, char );
-else
-	ptype(proc-res_prefix, proc-res_type, 0);
-f_print(fout, %s%s;\n, aster(proc-res_type),
-result);
-			}
-			f_print(fout, %s)\n, addargname);
-			if (!streq(proc-args.decls-decl.type, void)) {
-for (l = proc-args.decls; l != NULL;
-l = l-next)
-	

CVS commit: src/usr.bin/xlint/lint1

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 03:43:37 UTC 2013

Modified Files:
src/usr.bin/xlint/lint1: decl.c

Log Message:
downgrade illegal bitfield from error to warning so we can ignore it.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/xlint/lint1/decl.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.57 src/usr.bin/xlint/lint1/decl.c:1.58
--- src/usr.bin/xlint/lint1/decl.c:1.57	Fri Apr 19 14:51:14 2013
+++ src/usr.bin/xlint/lint1/decl.c	Sat Dec 14 22:43:37 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.57 2013/04/19 18:51:14 christos Exp $ */
+/* $NetBSD: decl.c,v 1.58 2013/12/15 03:43:37 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(lint)
-__RCSID($NetBSD: decl.c,v 1.57 2013/04/19 18:51:14 christos Exp $);
+__RCSID($NetBSD: decl.c,v 1.58 2013/12/15 03:43:37 christos Exp $);
 #endif
 
 #include sys/param.h
@@ -1121,7 +1121,7 @@ decl1str(sym_t *dsym)
 			 */
 			if (bitfieldtype_ok == 0 || isityp(t) == 0) {
 /* illegal bit-field type */
-error(35);
+warning(35);
 sz = tp-t_flen;
 dsym-s_type = tp = duptyp(gettyp(t = INT));
 if ((tp-t_flen = sz)  size(t))



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

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 03:45:07 UTC 2013

Modified Files:
src/sys/arch/sparc/include: ieee.h

Log Message:
Add linted comments.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sparc/include/ieee.h

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

Modified files:

Index: src/sys/arch/sparc/include/ieee.h
diff -u src/sys/arch/sparc/include/ieee.h:1.16 src/sys/arch/sparc/include/ieee.h:1.17
--- src/sys/arch/sparc/include/ieee.h:1.16	Wed Nov 20 17:22:20 2013
+++ src/sys/arch/sparc/include/ieee.h	Sat Dec 14 22:45:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee.h,v 1.16 2013/11/20 22:22:20 martin Exp $	*/
+/*	$NetBSD: ieee.h,v 1.17 2013/12/15 03:45:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -62,9 +62,9 @@
 #define	EXT_FRACBITS	(EXT_FRACLBITS + EXT_FRACHBITS)
 
 struct ieee_ext {
-	uint64_t	ext_sign:1;
-	uint64_t	ext_exp:EXT_EXPBITS;
-	uint64_t	ext_frach:EXT_FRACHBITS;
+	/*LINTED35*/	uint64_t	ext_sign:1;
+	/*LINTED35*/	uint64_t	ext_exp:EXT_EXPBITS;
+	/*LINTED35*/	uint64_t	ext_frach:EXT_FRACHBITS;
 	uint64_t	ext_fracl;
 };
 __CTASSERT(sizeof(struct ieee_ext) == 16);



CVS commit: src/sys/dev/pci

2013-12-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Dec 15 04:21:52 UTC 2013

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add ASMedia ASM1042 xHCI USB3 controller


To generate a diff of this commit:
cvs rdiff -u -r1.1168 -r1.1169 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1168 src/sys/dev/pci/pcidevs:1.1169
--- src/sys/dev/pci/pcidevs:1.1168	Fri Dec 13 07:11:09 2013
+++ src/sys/dev/pci/pcidevs	Sun Dec 15 04:21:52 2013
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1168 2013/12/13 07:11:09 pedro Exp $
+$NetBSD: pcidevs,v 1.1169 2013/12/15 04:21:52 pgoyette Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1162,6 +1162,7 @@ product ASMEDIA ASM1061_01	0x0601	ASM106
 product ASMEDIA ASM1061_02	0x0602	ASM1061 AHCI SATA III Controller
 product ASMEDIA ASM1061_11	0x0611	ASM1061 AHCI SATA III Controller
 product ASMEDIA ASM1061_12	0x0612	ASM1061 AHCI SATA III Controller
+product	ASMEDIA	ASM1042		0x1042	ASM1042 xHCI USB 3.0
 
 /* Asustek products */
 product ASUSTEK HFCPCI		0x0675	ISDN



CVS commit: src/usr.bin/rpcgen

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 06:07:39 UTC 2013

Modified Files:
src/usr.bin/rpcgen: rpc_svcout.c

Log Message:
Put back the extra prototype for main(); some programs #define main to
something else, so we need the extra prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/rpcgen/rpc_svcout.c

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

Modified files:

Index: src/usr.bin/rpcgen/rpc_svcout.c
diff -u src/usr.bin/rpcgen/rpc_svcout.c:1.25 src/usr.bin/rpcgen/rpc_svcout.c:1.26
--- src/usr.bin/rpcgen/rpc_svcout.c:1.25	Sat Dec 14 19:40:17 2013
+++ src/usr.bin/rpcgen/rpc_svcout.c	Sun Dec 15 01:07:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_svcout.c,v 1.25 2013/12/15 00:40:17 christos Exp $	*/
+/*	$NetBSD: rpc_svcout.c,v 1.26 2013/12/15 06:07:39 christos Exp $	*/
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  * unrestricted use provided that this legend is included on all tape
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)rpc_svcout.c 1.29 89/03/30 (C) 1987 SMI;
 #else
-__RCSID($NetBSD: rpc_svcout.c,v 1.25 2013/12/15 00:40:17 christos Exp $);
+__RCSID($NetBSD: rpc_svcout.c,v 1.26 2013/12/15 06:07:39 christos Exp $);
 #endif
 #endif
 
@@ -118,6 +118,8 @@ write_most(char *infile /* our name */, 
 	if (nomain)
 		return;
 
+	f_print(fout, \n\n);
+	f_print(fout, int main(int, char *[]);\n);
 	f_print(fout, \nint\n);
 	f_print(fout, main(int argc, char *argv[])\n);
 	f_print(fout, {\n);



CVS commit: src/usr.sbin/rpc.pcnfsd

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 06:10:33 UTC 2013

Modified Files:
src/usr.sbin/rpc.pcnfsd: Makefile.clnt

Log Message:
Add extra rpcgen flags.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rpc.pcnfsd/Makefile.clnt

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

Modified files:

Index: src/usr.sbin/rpc.pcnfsd/Makefile.clnt
diff -u src/usr.sbin/rpc.pcnfsd/Makefile.clnt:1.13 src/usr.sbin/rpc.pcnfsd/Makefile.clnt:1.14
--- src/usr.sbin/rpc.pcnfsd/Makefile.clnt:1.13	Fri Aug  1 13:04:07 2003
+++ src/usr.sbin/rpc.pcnfsd/Makefile.clnt	Sun Dec 15 01:10:33 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.clnt,v 1.13 2003/08/01 17:04:07 lukem Exp $
+#	$NetBSD: Makefile.clnt,v 1.14 2013/12/15 06:10:33 christos Exp $
 
 #	This Makefile builds a client used for testing.
 
@@ -28,13 +28,13 @@ getrpcgen:
 	@set -- X `type ${TOOL_RPCGEN}`  shift $$(($$# - 1))  echo $$1
 
 pcnfsd_clnt.c: pcnfsd.x ${XRPCGEN}
-	${TOOL_RPCGEN} -l ${.CURDIR}/pcnfsd.x -o $@
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -l ${.CURDIR}/pcnfsd.x -o $@
 
 pcnfsd_xdr.c: pcnfsd.x ${XRPCGEN}
-	${TOOL_RPCGEN} -c ${.CURDIR}/pcnfsd.x -o $@
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -c ${.CURDIR}/pcnfsd.x -o $@
 
 pcnfsd.h: pcnfsd.x ${XRPCGEN}
-	${TOOL_RPCGEN} -h ${.CURDIR}/pcnfsd.x -o $@
+	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -h ${.CURDIR}/pcnfsd.x -o $@
 
 DPSRCS+=	pcnfsd.h
 CLEANFILES+=	pcnfsd_clnt.c pcnfsd_xdr.c pcnfsd.h



CVS commit: src/external/historical/nawk/dist

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 06:41:18 UTC 2013

Modified Files:
src/external/historical/nawk/dist: run.c

Log Message:
PR/48448: David A. Holland: Avoid coredump by checking return code of
localtime(3)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/historical/nawk/dist/run.c

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

Modified files:

Index: src/external/historical/nawk/dist/run.c
diff -u src/external/historical/nawk/dist/run.c:1.7 src/external/historical/nawk/dist/run.c:1.8
--- src/external/historical/nawk/dist/run.c:1.7	Sun Oct 27 06:06:01 2013
+++ src/external/historical/nawk/dist/run.c	Sun Dec 15 01:41:18 2013
@@ -1647,6 +1647,8 @@ Cell *bltin(Node **a, int n)	/* builtin 
 		} else
 			tv = time((time_t *) 0);
 		tm = localtime(tv);
+		if (tm == NULL)
+			FATAL(bad time %jd, (intmax_t)tv);
 
 		if (isrec(x)) {
 			/* format argument not provided, use default */



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

2013-12-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 15 07:52:53 UTC 2013

Modified Files:
src/sys/arch/sparc64/conf: INSTALL

Log Message:
Add -Wno-uninitialized with -Os so that we don't get spurious gcc warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sparc64/conf/INSTALL

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

Modified files:

Index: src/sys/arch/sparc64/conf/INSTALL
diff -u src/sys/arch/sparc64/conf/INSTALL:1.28 src/sys/arch/sparc64/conf/INSTALL:1.29
--- src/sys/arch/sparc64/conf/INSTALL:1.28	Sun Jul 10 04:51:24 2011
+++ src/sys/arch/sparc64/conf/INSTALL	Sun Dec 15 02:52:53 2013
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.28 2011/07/10 08:51:24 mrg Exp $
+# 	$NetBSD: INSTALL,v 1.29 2013/12/15 07:52:53 christos Exp $
 #
 #	NOTE: this file only needs *additional* things for the install
 #	kernel, that are not already included in GENERIC!
@@ -6,9 +6,9 @@
 
 include arch/sparc64/conf/GENERIC
 
-#ident 		INSTALL-$Revision: 1.28 $
+#ident 		INSTALL-$Revision: 1.29 $
 
-makeoptions	COPTS=-Os
+makeoptions	COPTS=-Os -Wno-uninitialized
 
 options 	PIPE_SOCKETPAIR		# smaller, but slower pipe(2)