CVS commit: src/sys/kern

2014-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr  4 06:47:02 UTC 2014

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

Log Message:
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.477 -r1.478 src/sys/kern/vfs_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/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.477 src/sys/kern/vfs_syscalls.c:1.478
--- src/sys/kern/vfs_syscalls.c:1.477	Sat Mar 22 08:15:25 2014
+++ src/sys/kern/vfs_syscalls.c	Fri Apr  4 06:47:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.477 2014/03/22 08:15:25 maxv Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.478 2014/04/04 06:47:02 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.477 2014/03/22 08:15:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.478 2014/04/04 06:47:02 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -485,10 +485,7 @@ do_sys_mount(struct lwp *l, struct vfsop
 		if (data_len == 0) {
 			/* No length supplied, use default for filesystem */
 			data_len = vfsops->vfs_min_mount_data;
-			if (data_len > VFS_MAX_MOUNT_DATA) {
-error = EINVAL;
-goto done;
-			}
+
 			/*
 			 * Hopefully a longer buffer won't make copyin() fail.
 			 * For compatibility with 3.0 and earlier.
@@ -497,6 +494,10 @@ do_sys_mount(struct lwp *l, struct vfsop
 			&& data_len < sizeof (struct mnt_export_args30))
 data_len = sizeof (struct mnt_export_args30);
 		}
+		if (data_len > VFS_MAX_MOUNT_DATA) {
+			error = EINVAL;
+			goto done;
+		}
 		data_buf = kmem_alloc(data_len, KM_SLEEP);
 
 		/* NFS needs the buffer even for mnt_getargs  */



CVS commit: src/sys/arch/cats/cats

2014-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  4 06:25:00 UTC 2014

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.80 src/sys/arch/cats/cats/cats_machdep.c:1.81
--- src/sys/arch/cats/cats/cats_machdep.c:1.80	Fri Apr  4 06:04:54 2014
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Apr  4 06:25:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.80 2014/04/04 06:04:54 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.81 2014/04/04 06:25:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.80 2014/04/04 06:04:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.81 2014/04/04 06:25:00 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -359,7 +359,7 @@ initarm(void *arm_bootargs)
 	 * and not have to worry about things moving.
 	 */
 #ifdef FCOM_INIT_ARM
-	 fcomcnattach(DC21285_ARMCSR_BASE, comcnspeed, comcnmode);
+	fcomcnattach(DC21285_ARMCSR_BASE, comcnspeed, comcnmode);
 #endif
 
 	/* Talk to the user */



CVS commit: src/sys/arch/cats

2014-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  4 06:04:54 UTC 2014

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: files.cats

Log Message:
Revert previous - it wasn't complete.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/cats/conf/files.cats

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/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.79 src/sys/arch/cats/cats/cats_machdep.c:1.80
--- src/sys/arch/cats/cats/cats_machdep.c:1.79	Wed Apr  2 17:36:05 2014
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Apr  4 06:04:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.79 2014/04/02 17:36:05 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.80 2014/04/04 06:04:54 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.79 2014/04/02 17:36:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.80 2014/04/04 06:04:54 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -74,8 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: cats_machdep
 #include 
 #include 
 #include 
-
-#include 
  
 #include 
 #include 
@@ -118,11 +116,30 @@ static char bootargs[MAX_BOOT_STRING + 1
 char *boot_args = NULL;
 char *boot_file = NULL;
 
+vm_offset_t physical_start;
+vm_offset_t physical_freestart;
+vm_offset_t physical_freeend;
+vm_offset_t physical_end;
+u_int free_pages;
+vm_offset_t pagetables_start;
+
+vm_offset_t msgbufphys;
 
 #ifdef PMAP_DEBUG
 extern int pmap_debug_level;
 #endif
 
+#define KERNEL_PT_SYS		0	/* L2 table for mapping zero page */
+#define KERNEL_PT_KERNEL	1	/* L2 table for mapping kernel */
+#define	KERNEL_PT_KERNEL_NUM	2
+
+/* now this could move into something more generic */
+	/* L2 tables for mapping kernel VM */
+#define	KERNEL_PT_VMDATA	(KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM)
+#define	KERNEL_PT_VMDATA_NUM	4	/* 16MB kernel VM !*/
+#define NUM_KERNEL_PTS		(KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
+
+pv_addr_t kernel_pt_table[NUM_KERNEL_PTS];
 
 /* Prototypes */
 
@@ -173,7 +190,88 @@ extern void configure(void);
 int comcnspeed = CONSPEED;
 int comcnmode = CONMODE;
 
-static const struct pmap_devmap cats_devmap[] = {
+
+/*
+ * void cpu_reboot(int howto, char *bootstr)
+ *
+ * Reboots the system
+ *
+ * Deal with any syncing, unmounting, dumping and shutdown hooks,
+ * then reset the CPU.
+ */
+
+void
+cpu_reboot(int howto, char *bootstr)
+{
+#ifdef DIAGNOSTIC
+	/* info */
+	printf("boot: howto=%08x curlwp=%p\n", howto, curlwp);
+#endif
+
+	/*
+	 * If we are still cold then hit the air brakes
+	 * and crash to earth fast
+	 */
+	if (cold) {
+		doshutdownhooks();
+		pmf_system_shutdown(boothowto);
+		printf("The operating system has halted.\n");
+		printf("Please press any key to reboot.\n\n");
+		cngetc();
+		printf("rebooting...\n");
+		cpu_reset();
+		/*NOTREACHED*/
+	}
+
+	/* Disable console buffering */
+/*	cnpollc(1);*/
+
+	/*
+	 * If RB_NOSYNC was not specified sync the discs.
+	 * Note: Unless cold is set to 1 here, syslogd will die during the unmount.
+	 * It looks like syslogd is getting woken up only to find that it cannot
+	 * page part of the binary in as the filesystem has been unmounted.
+	 */
+	if (!(howto & RB_NOSYNC))
+		bootsync();
+
+	/* Say NO to interrupts */
+	splhigh();
+
+	/* Do a dump if requested. */
+	if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
+		dumpsys();
+	
+	/* Run any shutdown hooks */
+	doshutdownhooks();
+
+	pmf_system_shutdown(boothowto);
+
+	/* Make sure IRQ's are disabled */
+	IRQdisable;
+
+	if (howto & RB_HALT) {
+		printf("The operating system has halted.\n");
+		printf("Please press any key to reboot.\n\n");
+		cngetc();
+	}
+
+	printf("rebooting...\n");
+	cpu_reset();
+	/*NOTREACHED*/
+}
+
+/*
+ * Mapping table for core kernel memory. This memory is mapped at init
+ * time with section mappings.
+ */
+struct l1_sec_map {
+	vm_offset_t	va;
+	vm_offset_t	pa;
+	vm_size_t	size;
+	vm_prot_t	prot;
+	int		cache;
+} l1_sec_table[] = {
 	/* Map 1MB for CSR space */
 	{ DC21285_ARMCSR_VBASE,			DC21285_ARMCSR_BASE,
 	DC21285_ARMCSR_VSIZE,		VM_PROT_READ|VM_PROT_WRITE,
@@ -212,14 +310,6 @@ static const struct pmap_devmap cats_dev
 	{ 0, 0, 0, 0, 0 }
 };
 
-#define MAX_PHYSMEM 4
-static struct boot_physmem cats_physmem[MAX_PHYSMEM];
-int ncats_physmem = 0;
-
-extern struct bus_space footbridge_pci_io_bs_tag;
-extern struct bus_space footbridge_pci_mem_bs_tag;
-void footbridge_pci_bs_tag_init(void);
-
 /*
  * u_int initarm(struct ebsaboot *bootinfo)
  *
@@ -238,6 +328,9 @@ u_int
 initarm(void *arm_bootargs)
 {
 	struct ebsaboot *bootinfo = arm_bootargs;
+	int loop;
+	int loop1;
+	u_int l1pagetable;
 	extern u_int cpu_get_control(void);
 
 	/*
@@ -265,10 +358,8 @@ initarm(void *

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

2014-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  4 05:40:57 UTC 2014

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

Log Message:
Fix non-DWC2_DEBUG build.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/dwc2/dist/dwc2_coreintr.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_coreintr.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c:1.7 src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c:1.8
--- src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c:1.7	Thu Apr  3 06:34:58 2014
+++ src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c	Fri Apr  4 05:40:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_coreintr.c,v 1.7 2014/04/03 06:34:58 skrll Exp $	*/
+/*	$NetBSD: dwc2_coreintr.c,v 1.8 2014/04/04 05:40:57 skrll Exp $	*/
 
 /*
  * core_intr.c - DesignWare HS OTG Controller common interrupt handling
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_coreintr.c,v 1.7 2014/04/03 06:34:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_coreintr.c,v 1.8 2014/04/04 05:40:57 skrll Exp $");
 
 #include 
 #include 
@@ -82,6 +82,7 @@ static const char *dwc2_op_state_str(str
 		return "unknown";
 	}
 }
+#endif
 
 /**
  * dwc2_handle_usb_port_intr - handles OTG PRTINT interrupts.
@@ -102,7 +103,6 @@ static void dwc2_handle_usb_port_intr(st
 	/* Clear interrupt */
 	DWC2_WRITE_4(hsotg, GINTSTS, GINTSTS_PRTINT);
 }
-#endif
 
 /**
  * dwc2_handle_mode_mismatch_intr() - Logs a mode mismatch warning message



CVS commit: src/share/mk

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr  4 05:10:15 UTC 2014

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

Log Message:
Using -Wl,-x breaks build ARM BE8 shared libraries by striping the $a/$d/$t
symbols before the linker can use them.  Instead do ${OBJCOPY} -x ${.TARGET}
afterwards.


To generate a diff of this commit:
cvs rdiff -u -r1.348 -r1.349 src/share/mk/bsd.lib.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.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.348 src/share/mk/bsd.lib.mk:1.349
--- src/share/mk/bsd.lib.mk:1.348	Sun Mar  9 18:00:51 2014
+++ src/share/mk/bsd.lib.mk	Fri Apr  4 05:10:15 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.348 2014/03/09 18:00:51 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.349 2014/04/04 05:10:15 matt Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -442,7 +442,7 @@ ${_LIB}_combine.o: ${COMBINESRCS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} -MD --combine ${.ALLSRC} -o ${.TARGET}
 .if defined(LIBSTRIPOBJS)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 CLEANFILES+=	${_LIB}_combine.d
@@ -618,10 +618,11 @@ ${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPL
 ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
 	${_MKTARGET_BUILD}
 	rm -f ${.TARGET}
-	${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} \
+	${LIBCC} ${LDLIBC} -shared ${SHLIB_SHFLAGS} \
 	${_LDFLAGS.${_LIB}} -o ${.TARGET} ${_LIBLDOPTS} \
 	-Wl,--whole-archive ${SOLIB} \
 	-Wl,--no-whole-archive ${_LDADD.${_LIB}}
+	${OBJCOPY} -x ${.TARGET}
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX



CVS commit: [matt-nb5-mips64] src/share/mk

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr  4 05:07:14 UTC 2014

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.lib.mk

Log Message:
Using -Wl,-x breaks build ARM BE8 shared libraries by striping the $a/$d/$t
symbols before the linker can use them.  Instead do ${OBJCOPY} -x ${.TARGET}
afterwards.


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.2.2.1.2.2 -r1.289.2.2.2.1.2.3 src/share/mk/bsd.lib.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.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.2 src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.3
--- src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.2	Wed Dec 18 18:39:05 2013
+++ src/share/mk/bsd.lib.mk	Fri Apr  4 05:07:14 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.289.2.2.2.1.2.2 2013/12/18 18:39:05 matt Exp $
+#	$NetBSD: bsd.lib.mk,v 1.289.2.2.2.1.2.3 2014/04/04 05:07:14 matt Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -506,15 +506,16 @@ lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
 .if defined(DESTDIR)
 	${LIBCC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}${SHLIBDIR}/ \
 	${_LIBLDOPTS} \
-	-Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \
+	-shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \
 	-Wl,--whole-archive ${SOLIB} \
 	-Wl,--no-whole-archive ${LDADD} \
 	-L${_GCC_LIBGCCDIR}
 .else
-	${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} \
+	${LIBCC} ${LDLIBC} -shared ${SHLIB_SHFLAGS} ${LDFLAGS} \
 	-o ${.TARGET} ${_LIBLDOPTS} \
 	-Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD}
 .endif
+	${OBJCOPY} -x ${.TARGET}
 .if ${OBJECT_FMT} == "ELF"
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does



CVS commit: src/sys/arch/mips/rmi

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  4 01:41:06 UTC 2014

Modified Files:
src/sys/arch/mips/rmi: rmixl_pcie.c

Log Message:
adjust to pci_intr_string signature.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/rmi/rmixl_pcie.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/mips/rmi/rmixl_pcie.c
diff -u src/sys/arch/mips/rmi/rmixl_pcie.c:1.10 src/sys/arch/mips/rmi/rmixl_pcie.c:1.11
--- src/sys/arch/mips/rmi/rmixl_pcie.c:1.10	Sat Oct 27 13:18:02 2012
+++ src/sys/arch/mips/rmi/rmixl_pcie.c	Thu Apr  3 21:41:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_pcie.c,v 1.10 2012/10/27 17:18:02 chs Exp $	*/
+/*	$NetBSD: rmixl_pcie.c,v 1.11 2014/04/04 01:41:05 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_pcie.c,v 1.10 2012/10/27 17:18:02 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_pcie.c,v 1.11 2014/04/04 01:41:05 christos Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -188,7 +188,8 @@ static void	rmixl_pcie_conf_write(void *
 static int	rmixl_pcie_intr_map(const struct pci_attach_args *,
 		pci_intr_handle_t *);
 static const char *
-		rmixl_pcie_intr_string(void *, pci_intr_handle_t);
+		rmixl_pcie_intr_string(void *, pci_intr_handle_t, char *,
+		size_t);
 static const struct evcnt *
 		rmixl_pcie_intr_evcnt(void *, pci_intr_handle_t);
 static pci_intr_handle_t
@@ -1094,7 +1095,7 @@ rmixl_pcie_intr_map(const struct pci_att
 }
 
 const char *
-rmixl_pcie_intr_string(void *v, pci_intr_handle_t pih)
+rmixl_pcie_intr_string(void *v, pci_intr_handle_t pih, char *buf, size_t len)
 {
 	const char *name = "(illegal)";
 	u_int link, bitno, irq;
@@ -1143,7 +1144,8 @@ rmixl_pcie_intr_string(void *v, pci_intr
 			__func__, MIPS_PRID_IMPL(mips_options.mips_cpu_id));
 	}
 
-	return name;
+	strlcpy(buf, name, len);
+	return buf;
 }
 
 const struct evcnt *



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

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  4 01:35:11 UTC 2014

Modified Files:
src/sys/rump/librump/rumpdev: rump_dev.c

Log Message:
provide cpu_bootconf()


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/rump/librump/rumpdev/rump_dev.c

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

Modified files:

Index: src/sys/rump/librump/rumpdev/rump_dev.c
diff -u src/sys/rump/librump/rumpdev/rump_dev.c:1.24 src/sys/rump/librump/rumpdev/rump_dev.c:1.25
--- src/sys/rump/librump/rumpdev/rump_dev.c:1.24	Fri Sep 20 12:49:00 2013
+++ src/sys/rump/librump/rumpdev/rump_dev.c	Thu Apr  3 21:35:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_dev.c,v 1.24 2013/09/20 16:49:00 pooka Exp $	*/
+/*	$NetBSD: rump_dev.c,v 1.25 2014/04/04 01:35:11 christos Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.24 2013/09/20 16:49:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.25 2014/04/04 01:35:11 christos Exp $");
 
 #include 
 #include 
@@ -82,6 +82,11 @@ cpu_rootconf(void)
 }
 
 void
+cpu_bootconf(void)
+{
+}
+
+void
 device_register(device_t dev, void *v)
 {
 



CVS commit: src/doc

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  4 01:23:34 UTC 2014

Modified Files:
src/doc: HACKS

Log Message:
add ctfconvert bug.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.144 src/doc/HACKS:1.145
--- src/doc/HACKS:1.144	Mon Mar 24 19:03:21 2014
+++ src/doc/HACKS	Thu Apr  3 21:23:34 2014
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.144 2014/03/24 23:03:21 tron Exp $
+# $NetBSD: HACKS,v 1.145 2014/04/04 01:23:34 christos Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -280,6 +280,17 @@ descr
 	-fno-strict-aliasing.
 kcah
 
+hack	disable ctf for gcc-4.8 build
+mdate	April 3 2014
+who	chritos
+file	external/gpl3/gcc/usr.bin/Makefile.frontend	: 1.4
+file	external/gpl3/gcc/usr.bin/Makefile.backend	: 1.5
+descr
+	nbctfconvert -g -L VERSION -g fold-const.o
+	ERROR: fold-const.c: failed to get mapping for tid 79154 \
+		((null)) <13532>
+kcak
+
 hack	emacs aborting on exit (libgcc issue)
 mdate	7 November 2011
 who	christos



CVS commit: src/share/mk

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  4 01:20:13 UTC 2014

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

Log Message:
Add NOCTF


To generate a diff of this commit:
cvs rdiff -u -r1.794 -r1.795 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.794 src/share/mk/bsd.own.mk:1.795
--- src/share/mk/bsd.own.mk:1.794	Thu Apr  3 14:29:11 2014
+++ src/share/mk/bsd.own.mk	Thu Apr  3 21:20:12 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.794 2014/04/03 18:29:11 riastradh Exp $
+#	$NetBSD: bsd.own.mk,v 1.795 2014/04/04 01:20:12 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -507,7 +507,7 @@ FC=		${TOOL_FC.${ACTIVE_FC}}
 OBJC=		${TOOL_OBJC.${ACTIVE_OBJC}}
 
 # Override with tools versions if needed
-.if ${MKCTF:Uno} != "no"
+.if ${MKCTF:Uno} != "no" && !defined(NOCTF)
 CTFCONVERT=	${TOOL_CTFCONVERT}
 CTFMERGE=	${TOOL_CTFMERGE}
 .endif



CVS commit: src/external/gpl3/gcc/usr.bin/cc1plus

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  4 01:19:57 UTC 2014

Modified Files:
src/external/gpl3/gcc/usr.bin/cc1plus: Makefile

Log Message:
remove extra


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/usr.bin/cc1plus/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/cc1plus/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.7 src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.8
--- src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.7	Wed Mar  5 16:37:02 2014
+++ src/external/gpl3/gcc/usr.bin/cc1plus/Makefile	Thu Apr  3 21:19:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2014/03/05 21:37:02 tron Exp $
+#	$NetBSD: Makefile,v 1.8 2014/04/04 01:19:57 christos Exp $
 
 PROG=		cc1plus
 SRCS=		${G_CXX_OBJS:S,c-family/,,:S,cp/,,:Nlibcpp.a:.o=.c} main.c ${PROG}-checksum.c
@@ -9,8 +9,6 @@ NOMAN=	1
 CPPFLAGS+=	-I${DIST}/gcc/cp
 CPPFLAGS.prefix.c+= -DPREFIX=\"/usr\"
 
-.include 
-
 .include "../Makefile.backend"
 .include "../Makefile.backtrace"
 .include "../Makefile.common"



CVS commit: src/external/gpl3/gcc/usr.bin

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  4 01:19:14 UTC 2014

Modified Files:
src/external/gpl3/gcc/usr.bin: Makefile.backend Makefile.frontend

Log Message:
Add NOCTF


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/usr.bin/Makefile.backend
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/usr.bin/Makefile.frontend

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/Makefile.backend
diff -u src/external/gpl3/gcc/usr.bin/Makefile.backend:1.4 src/external/gpl3/gcc/usr.bin/Makefile.backend:1.5
--- src/external/gpl3/gcc/usr.bin/Makefile.backend:1.4	Sat Mar  1 05:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/Makefile.backend	Thu Apr  3 21:19:14 2014
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile.backend,v 1.4 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile.backend,v 1.5 2014/04/04 01:19:14 christos Exp $
 
 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_BACKEND_
 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_BACKEND_=1
 
 NOMAN=		# defined
+NOCTF=		# defined
 BINDIR=		/usr/libexec
 
 CPPFLAGS+=	-I${GCCARCH} -I${BACKENDOBJ} \

Index: src/external/gpl3/gcc/usr.bin/Makefile.frontend
diff -u src/external/gpl3/gcc/usr.bin/Makefile.frontend:1.3 src/external/gpl3/gcc/usr.bin/Makefile.frontend:1.4
--- src/external/gpl3/gcc/usr.bin/Makefile.frontend:1.3	Sat Mar  1 05:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/Makefile.frontend	Thu Apr  3 21:19:14 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.frontend,v 1.3 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile.frontend,v 1.4 2014/04/04 01:19:14 christos Exp $
 
 BINDIR=		/usr/bin
 
@@ -6,6 +6,7 @@ CPPFLAGS+=	-I${GCCARCH} -I${FRONTENDOBJ}
 		${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} \
 		-DIN_GCC_FRONTEND
 
+NOCTF=	# defined
 .include 
 
 DPADD+=			${FRONTENDOBJ}/libfrontend.a



CVS commit: src/sys

2014-04-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr  3 23:49:47 UTC 2014

Modified Files:
src/sys/arch/prep/pci: pci_machdep.c
src/sys/arch/prep/prep: machdep.c platform.c
src/sys/arch/prep/stand/boot: pci.c siop.c vreset.c
src/sys/dev/isa: pckbc_isa.c

Log Message:
GCC 4.8 build fixes from John D. Baker


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/prep/pci/pci_machdep.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/prep/prep/machdep.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/prep/prep/platform.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/prep/stand/boot/pci.c \
src/sys/arch/prep/stand/boot/siop.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/prep/stand/boot/vreset.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/isa/pckbc_isa.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/prep/pci/pci_machdep.c
diff -u src/sys/arch/prep/pci/pci_machdep.c:1.39 src/sys/arch/prep/pci/pci_machdep.c:1.40
--- src/sys/arch/prep/pci/pci_machdep.c:1.39	Wed Mar 26 16:01:43 2014
+++ src/sys/arch/prep/pci/pci_machdep.c	Thu Apr  3 23:49:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.39 2014/03/26 16:01:43 christos Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.40 2014/04/03 23:49:47 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.39 2014/03/26 16:01:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.40 2014/04/03 23:49:47 mrg Exp $");
 
 #include 
 #include 
@@ -153,13 +153,12 @@ prep_pci_intr_map(const struct pci_attac
 	prop_dictionary_t dict, devsub;
 	prop_object_t pinsub;
 	prop_number_t pbus;
-	int busno, bus, pin, line, swiz, dev, origdev, i;
+	int busno, pin, line, dev, origdev, i;
 	char key[20];
 
 	pin = pa->pa_intrpin;
 	line = pa->pa_intrline;
-	bus = busno = pa->pa_bus;
-	swiz = pa->pa_intrswiz;
+	busno = pa->pa_bus;
 	origdev = dev = pa->pa_device;
 	i = 0;
 

Index: src/sys/arch/prep/prep/machdep.c
diff -u src/sys/arch/prep/prep/machdep.c:1.74 src/sys/arch/prep/prep/machdep.c:1.75
--- src/sys/arch/prep/prep/machdep.c:1.74	Sun Apr 21 15:42:11 2013
+++ src/sys/arch/prep/prep/machdep.c	Thu Apr  3 23:49:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.74 2013/04/21 15:42:11 kiyohara Exp $	*/
+/*	$NetBSD: machdep.c,v 1.75 2014/04/03 23:49:47 mrg Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.74 2013/04/21 15:42:11 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2014/04/03 23:49:47 mrg Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_openpic.h"
@@ -313,7 +313,6 @@ prep_setup_openpic(PPC_DEVICE *dev)
 {
 	uint32_t l;
 	uint8_t *p;
-	void *v;
 	int tag, size, item, i;
 	unsigned char *baseaddr = NULL;
 
@@ -329,7 +328,6 @@ prep_setup_openpic(PPC_DEVICE *dev)
 		struct _L4_PPCPack *pa = &pack->L4_Data.L4_PPCPack;
 
 		tag = *p;
-		v = p;
 		if (tag_type(p[0]) == PNP_SMALL) {
 			size = tag_small_count(tag) + 1;
 			continue;
@@ -383,7 +381,6 @@ setup_ivr(PPC_DEVICE *dev)
 {
 	uint32_t l, addr;
 	uint8_t *p;
-	void *v;
 	int tag, size, item;
 
 	l = be32toh(dev->AllocatedOffset);
@@ -395,7 +392,6 @@ setup_ivr(PPC_DEVICE *dev)
 		struct _L4_PPCPack *pa = &pack->L4_Data.L4_PPCPack;
 
 		tag = *p;
-		v = p;
 		if (tag_type(p[0]) == PNP_SMALL) {
 			size = tag_small_count(tag) + 1;
 			continue;

Index: src/sys/arch/prep/prep/platform.c
diff -u src/sys/arch/prep/prep/platform.c:1.27 src/sys/arch/prep/prep/platform.c:1.28
--- src/sys/arch/prep/prep/platform.c:1.27	Wed Mar 26 16:01:43 2014
+++ src/sys/arch/prep/prep/platform.c	Thu Apr  3 23:49:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform.c,v 1.27 2014/03/26 16:01:43 christos Exp $	*/
+/*	$NetBSD: platform.c,v 1.28 2014/04/03 23:49:47 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.27 2014/03/26 16:01:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.28 2014/04/03 23:49:47 mrg Exp $");
 
 #include 
 #include 
@@ -85,12 +85,12 @@ find_platform_quirk(const char *model)
 void
 cpu_setup_prep_generic(device_t dev)
 {
-	u_int8_t l2ctrl, cpuinf;
+	u_int8_t l2ctrl;
 
 	/* system control register */
 	l2ctrl = inb(PREP_BUS_SPACE_IO + 0x81c);
 	/* device status register */
-	cpuinf = inb(PREP_BUS_SPACE_IO + 0x80c);
+	(void)inb(PREP_BUS_SPACE_IO + 0x80c);
 
 	/* Enable L2 cache */
 	outb(PREP_BUS_SPACE_IO + 0x81c, l2ctrl | 0xc0);
@@ -222,7 +222,7 @@ static int
 create_intr_map(void *v, prop_dictionary_t dict)
 {
 	prop_dictionary_t sub;
-	int item, size, i, j, bus, numslots;
+	int item, size, i, j, numslots;
 	int tag = *(unsigned char *)v;
 	unsigned char *q = v;
 	PCIInfoPack *pi = v;
@@ -238,7 +238,6 @@ create_intr_map(void *v, prop_dictionary
 		return size;
 

CVS commit: src/distrib/utils/embedded

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 22:51:38 UTC 2014

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
now that fdisk has optional arguments, don't pass -1


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.47 src/distrib/utils/embedded/mkimage:1.48
--- src/distrib/utils/embedded/mkimage:1.47	Mon Mar 31 14:18:29 2014
+++ src/distrib/utils/embedded/mkimage	Thu Apr  3 18:51:38 2014
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.47 2014/03/31 18:18:29 christos Exp $
+# $NetBSD: mkimage,v 1.48 2014/04/03 22:51:38 christos Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -202,7 +202,7 @@ if [ -n "${msdosid}" ]; then
 elif [ -n "${netbsdid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}
-	${FDISK} -f -a -u -0 -s 169/-1/-1/ ${image}
+	${FDISK} -f -a -u -0 -s 169 ${image}
 	${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
 fi
 



CVS commit: src/sbin/fdisk

2014-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  3 21:56:19 UTC 2014

Modified Files:
src/sbin/fdisk: fdisk.8

Log Message:
Update SYNOPSIS.
Christos, please check.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sbin/fdisk/fdisk.8

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

Modified files:

Index: src/sbin/fdisk/fdisk.8
diff -u src/sbin/fdisk/fdisk.8:1.82 src/sbin/fdisk/fdisk.8:1.83
--- src/sbin/fdisk/fdisk.8:1.82	Mon Mar 31 11:25:48 2014
+++ src/sbin/fdisk/fdisk.8	Thu Apr  3 21:56:19 2014
@@ -1,6 +1,6 @@
-.\"	$NetBSD: fdisk.8,v 1.82 2014/03/31 11:25:48 martin Exp $
+.\"	$NetBSD: fdisk.8,v 1.83 2014/04/03 21:56:19 wiz Exp $
 .\"
-.Dd October 6, 2013
+.Dd April 3, 2014
 .Dt FDISK 8
 .Os
 .Sh NAME
@@ -11,7 +11,7 @@
 .Op Fl aBFfIiSuv
 .Oo
 .Fl 0 | 1 | 2 | 3 | E Ar number
-.Op Fl s Ar id/start/size Ns Bq Ar /bootmenu
+.Op Fl s Ar Oo Ar id Oc Ns Oo / Ns Oo Ar start Oc Ns Oo / Ns Oo Ar size Oc Ns Oo / Ns Oo Ar bootmenu Oc Oc Oc Oc
 .Oc
 .Op Fl r Ar file | Fl w Ar file
 .Op Fl A Ar ptn_alignment Ns Bq Ar /ptn_0_offset



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

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 19:18:51 UTC 2014

Added Files:
src/sys/arch/i386/conf: DRMKMS NO_DRM

Log Message:
Copy NO_DRM and DRMKMS kernels for i386.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/conf/DRMKMS \
src/sys/arch/i386/conf/NO_DRM

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

Added files:

Index: src/sys/arch/i386/conf/DRMKMS
diff -u /dev/null src/sys/arch/i386/conf/DRMKMS:1.1
--- /dev/null	Thu Apr  3 19:18:51 2014
+++ src/sys/arch/i386/conf/DRMKMS	Thu Apr  3 19:18:51 2014
@@ -0,0 +1,10 @@
+include "arch/i386/conf/NO_DRM"
+
+drmkms* 	at drmkmsbus?
+i915drmkms* 	at pci? dev ? function ?
+
+no options 	DIAGNOSTIC
+options 	DIAGNOSTIC	# expensive kernel consistency check
+options 	DEBUG		# expensive debugging checks/support
+options 	LOCKDEBUG	# debug locks
+makeoptions 	DEBUG="-g"	# compile full symbol table
Index: src/sys/arch/i386/conf/NO_DRM
diff -u /dev/null src/sys/arch/i386/conf/NO_DRM:1.1
--- /dev/null	Thu Apr  3 19:18:51 2014
+++ src/sys/arch/i386/conf/NO_DRM	Thu Apr  3 19:18:51 2014
@@ -0,0 +1,11 @@
+include "arch/i386/conf/GENERIC"
+
+no i915drm* 	at drm?
+no mach64drm* 	at drm?
+no mgadrm* 	at drm?
+no r128drm* 	at drm?
+no radeondrm* 	at drm?
+no savagedrm* 	at drm?
+no sisdrm* 	at drm?
+no tdfxdrm* 	at drm?
+no viadrm* 	at drm?



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

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 19:18:29 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_bufs.c
src/sys/external/bsd/drm2/dist/include/drm: drmP.h
src/sys/external/bsd/drm2/i915drm: i915_gem_gtt.c i915_pci.c
src/sys/external/bsd/drm2/include/drm: bus_dma_hacks.h
src/sys/external/bsd/drm2/include/linux: pci.h

Log Message:
Miscellaneous fixes for drm2 on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/drm_bufs.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/include/drm/drmP.h
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/i915drm/i915_pci.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/pci.h

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_bufs.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_bufs.c:1.3 src/sys/external/bsd/drm2/dist/drm/drm_bufs.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/drm_bufs.c:1.3	Thu Apr  3 05:48:02 2014
+++ src/sys/external/bsd/drm2/dist/drm/drm_bufs.c	Thu Apr  3 19:18:29 2014
@@ -177,6 +177,7 @@ static int drm_addmap_core(struct drm_de
 	switch (map->type) {
 	case _DRM_REGISTERS:
 	case _DRM_FRAME_BUFFER:
+#ifndef __NetBSD__		/* XXX No idea what this is for...  */
 #if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__arm__)
 		if (map->offset + (map->size-1) < map->offset ||
 		map->offset < virt_to_phys(high_memory)) {
@@ -184,6 +185,7 @@ static int drm_addmap_core(struct drm_de
 			return -EINVAL;
 		}
 #endif
+#endif
 		/* Some drivers preinitialize some maps, without the X Server
 		 * needing to be aware of it.  Therefore, we just return success
 		 * when the server tries to create a duplicate map.

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.3
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Thu Apr  3 19:18:29 2014
@@ -2110,11 +2110,26 @@ DRM_READ32(struct drm_local_map *map, bu
 static inline uint64_t
 DRM_READ64(struct drm_local_map *map, bus_size_t offset)
 {
-	if (DRM_IS_BUS_SPACE(map))
+	if (DRM_IS_BUS_SPACE(map)) {
+#if _LP64			/* XXX How to detect bus_space_read_8?  */
 		return bus_space_read_8(map->lm_data.bus_space.bst,
 		map->lm_data.bus_space.bsh, offset);
-	else
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+		/* XXX Yes, this is sketchy.  */
+		return bus_space_read_4(map->lm_data.bus_space.bst,
+		map->lm_data.bus_space.bsh, offset) |
+		((uint64_t)bus_space_read_4(map->lm_data.bus_space.bst,
+			map->lm_data.bus_space.bsh, (offset + 4)) << 32);
+#else
+		/* XXX Yes, this is sketchy.  */
+		return bus_space_read_4(map->lm_data.bus_space.bst,
+		map->lm_data.bus_space.bsh, (offset + 4)) |
+		((uint64_t)bus_space_read_4(map->lm_data.bus_space.bst,
+			map->lm_data.bus_space.bsh, offset) << 32);
+#endif
+	} else {
 		return *(volatile uint64_t *)((vaddr_t)map->handle + offset);
+	}
 }
 
 static inline void
@@ -2150,11 +2165,25 @@ DRM_WRITE32(struct drm_local_map *map, b
 static inline void
 DRM_WRITE64(struct drm_local_map *map, bus_size_t offset, uint64_t value)
 {
-	if (DRM_IS_BUS_SPACE(map))
+	if (DRM_IS_BUS_SPACE(map)) {
+#if _LP64			/* XXX How to detect bus_space_write_8?  */
 		bus_space_write_8(map->lm_data.bus_space.bst,
 		map->lm_data.bus_space.bsh, offset, value);
-	else
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+		bus_space_write_4(map->lm_data.bus_space.bst,
+		map->lm_data.bus_space.bsh, offset, (value & 0xU));
+		bus_space_write_4(map->lm_data.bus_space.bst,
+		map->lm_data.bus_space.bsh, (offset + 4), (value >> 32));
+#else
+		bus_space_write_4(map->lm_data.bus_space.bst,
+		map->lm_data.bus_space.bsh, offset, (value >> 32));
+		bus_space_write_4(map->lm_data.bus_space.bst,
+		map->lm_data.bus_space.bsh, (offset + 4),
+		(value & 0xU));
+#endif
+	} else {
 		*(volatile uint64_t *)((vaddr_t)map->handle + offset) = value;
+	}
 }
 #endif	/* defined(__NetBSD__) */
 

Index: src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.2 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.3
--- src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c	Thu Apr  3 19:18:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_gtt.c,v 1.2 2014/03/18 18:20:42 riastradh Exp $	*/
+/*	$NetBSD: i915_gem_gtt.c,v 1.3 2014/04/03 19:18:29 riastradh Ex

CVS commit: src/sys/arch/cobalt/cobalt

2014-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr  3 19:15:43 UTC 2014

Modified Files:
src/sys/arch/cobalt/cobalt: machdep.c

Log Message:
GC nsym


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/cobalt/cobalt/machdep.c

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

Modified files:

Index: src/sys/arch/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.115 src/sys/arch/cobalt/cobalt/machdep.c:1.116
--- src/sys/arch/cobalt/cobalt/machdep.c:1.115	Mon Mar 24 20:06:31 2014
+++ src/sys/arch/cobalt/cobalt/machdep.c	Thu Apr  3 19:15:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.115 2014/03/24 20:06:31 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.115 2014/03/24 20:06:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -141,7 +141,6 @@ mach_init(int32_t memsize32, u_int bim, 
 	extern char edata[], end[];
 	const char *bi_msg;
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-	int nsym = 0;
 	char *ssym = 0;
 	struct btinfo_symtab *bi_syms;
 #endif
@@ -206,7 +205,6 @@ mach_init(int32_t memsize32, u_int bim, 
 
 	/* Load symbol table if present */
 	if (bi_syms != NULL) {
-		nsym = bi_syms->nsym;
 		ssym = (void *)(intptr_t)bi_syms->ssym;
 		esym = (void *)(intptr_t)bi_syms->esym;
 		kernend = (void *)mips_round_page(esym);



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

2014-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  3 19:03:28 UTC 2014

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

Log Message:
ticket #1041


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/doc/CHANGES-6.1.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.1.4
diff -u src/doc/CHANGES-6.1.4:1.1.2.5 src/doc/CHANGES-6.1.4:1.1.2.6
--- src/doc/CHANGES-6.1.4:1.1.2.5	Tue Mar 18 09:44:25 2014
+++ src/doc/CHANGES-6.1.4	Thu Apr  3 19:03:28 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.4,v 1.1.2.5 2014/03/18 09:44:25 msaitoh Exp $
+# $NetBSD: CHANGES-6.1.4,v 1.1.2.6 2014/04/03 19:03:28 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.3 release to the NetBSD 6.1.4
 release:
@@ -39,3 +39,14 @@ sys/kern/kern_verifiedexec.c			1.132
 
 	Reorder code to avoid use-after-free on error.
 	[maxv, ticket #1034]
+crypto/external/bsd/openssl/dist/crypto/bn/bn.h	1.2
+crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c 1.2
+crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c 1.2
+
+	Add fix for CVE-2014-0076 taken from OpenSSL GIT repository:
+	Fix for the attack described in the paper "Recovering OpenSSL
+	ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
+	by Yuval Yarom and Naomi Benger. Details can be obtained from:
+	http://eprint.iacr.org/2014/140
+	[tron, ticket #1041]
+



CVS commit: [netbsd-6-1] src/crypto/external/bsd/openssl/dist/crypto

2014-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  3 19:03:09 UTC 2014

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/bn [netbsd-6-1]: bn.h
bn_lib.c
src/crypto/external/bsd/openssl/dist/crypto/ec [netbsd-6-1]: ec2_mult.c

Log Message:
Pull up following revision(s) (requested by tron in ticket #1041):
crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c: revision 1.2
crypto/external/bsd/openssl/dist/crypto/bn/bn.h: revision 1.2
crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c: revision 1.2
Add fix for CVE-2014-0076 taken from OpenSSL GIT repository:
Fix for the attack described in the paper "Recovering OpenSSL
ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
by Yuval Yarom and Naomi Benger. Details can be obtained from:
http://eprint.iacr.org/2014/140


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.1.6.1 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.18.1 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.1.6.1 \
src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1 src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1.6.1
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1	Tue Aug 14 07:56:09 2012
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h	Thu Apr  3 19:03:09 2014
@@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret,
 BIGNUM *BN_mod_sqrt(BIGNUM *ret,
 	const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
 
+void	BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
+
 /* Deprecated versions */
 #ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
@@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf
 
 #define bn_fix_top(a)		bn_check_top(a)
 
+#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
+#define bn_wcheck_size(bn, words) \
+	do { \
+		const BIGNUM *_bnum2 = (bn); \
+		assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
+	} while(0)
+
 #else /* !BN_DEBUG */
 
 #define bn_pollute(a)
 #define bn_check_top(a)
 #define bn_fix_top(a)		bn_correct_top(a)
+#define bn_check_size(bn, bits)
+#define bn_wcheck_size(bn, words)
 
 #endif
 

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2 src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2.18.1
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2	Sun Jun  5 14:57:56 2011
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c	Thu Apr  3 19:03:09 2014
@@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a,
 		}
 	return bn_cmp_words(a,b,cl);
 	}
+
+/* 
+ * Constant-time conditional swap of a and b.  
+ * a and b are swapped if condition is not 0.  The code assumes that at most one bit of condition is set.
+ * nwords is the number of words to swap.  The code assumes that at least nwords are allocated in both a and b,
+ * and that no more than nwords are used by either a or b.
+ * a and b cannot be the same number
+ */
+void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
+	{
+	BN_ULONG t;
+	int i;
+
+	bn_wcheck_size(a, nwords);
+	bn_wcheck_size(b, nwords);
+
+	assert(a != b);
+	assert((condition & (condition - 1)) == 0);
+	assert(sizeof(BN_ULONG) >= sizeof(int));
+
+	condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1;
+
+	t = (a->top^b->top) & condition;
+	a->top ^= t;
+	b->top ^= t;
+
+#define BN_CONSTTIME_SWAP(ind) \
+	do { \
+		t = (a->d[ind] ^ b->d[ind]) & condition; \
+		a->d[ind] ^= t; \
+		b->d[ind] ^= t; \
+	} while (0)
+
+
+	switch (nwords) {
+	default:
+		for (i = 10; i < nwords; i++) 
+			BN_CONSTTIME_SWAP(i);
+		/* Fallthrough */
+	case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */
+	case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */
+	case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */
+	case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */
+	case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */
+	case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */
+	case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */
+	case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
+	case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
+	case 1: BN_CONSTTIME_SWAP(0);
+	}
+#undef BN_CONSTTIME_SWAP
+}

Index: src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1 src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1.6.1
--- src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1	Tue Aug 14 07:56:23 2012
+++ src/crypto/external/bsd/openssl/dist/crypto/ec/

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

2014-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  3 19:02:39 UTC 2014

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

Log Message:
ticket #1041


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

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

Modified files:

Index: src/doc/CHANGES-6.0.5
diff -u src/doc/CHANGES-6.0.5:1.1.2.5 src/doc/CHANGES-6.0.5:1.1.2.6
--- src/doc/CHANGES-6.0.5:1.1.2.5	Tue Mar 18 09:44:51 2014
+++ src/doc/CHANGES-6.0.5	Thu Apr  3 19:02:39 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.5,v 1.1.2.5 2014/03/18 09:44:51 msaitoh Exp $
+# $NetBSD: CHANGES-6.0.5,v 1.1.2.6 2014/04/03 19:02:39 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.4 release to the NetBSD 6.0.5
 release:
@@ -39,3 +39,14 @@ sys/kern/kern_verifiedexec.c			1.132
 
 	Reorder code to avoid use-after-free on error.
 	[maxv, ticket #1034]
+crypto/external/bsd/openssl/dist/crypto/bn/bn.h	1.2
+crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c 1.2
+crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c 1.2
+
+	Add fix for CVE-2014-0076 taken from OpenSSL GIT repository:
+	Fix for the attack described in the paper "Recovering OpenSSL
+	ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
+	by Yuval Yarom and Naomi Benger. Details can be obtained from:
+	http://eprint.iacr.org/2014/140
+	[tron, ticket #1041]
+



CVS commit: [netbsd-6] src/doc

2014-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  3 19:02:27 UTC 2014

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

Log Message:
ticket #1041


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.99 -r1.1.2.100 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.99 src/doc/CHANGES-6.2:1.1.2.100
--- src/doc/CHANGES-6.2:1.1.2.99	Fri Mar 21 14:45:54 2014
+++ src/doc/CHANGES-6.2	Thu Apr  3 19:02:27 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.99 2014/03/21 14:45:54 sborrill Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.100 2014/04/03 19:02:27 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -1394,3 +1394,14 @@ crypto/external/bsd/openssl/lib/libssl/s
 	DTLSv1_method. Addresses asterisk build problems.
 	[wiz, ticket #1038]
 
+crypto/external/bsd/openssl/dist/crypto/bn/bn.h	1.2
+crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c 1.2
+crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c 1.2
+
+	Add fix for CVE-2014-0076 taken from OpenSSL GIT repository:
+	Fix for the attack described in the paper "Recovering OpenSSL
+	ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
+	by Yuval Yarom and Naomi Benger. Details can be obtained from:
+	http://eprint.iacr.org/2014/140
+	[tron, ticket #1041]
+



CVS commit: [netbsd-6-0] src/crypto/external/bsd/openssl/dist/crypto

2014-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  3 19:02:00 UTC 2014

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/bn [netbsd-6-0]: bn.h
bn_lib.c
src/crypto/external/bsd/openssl/dist/crypto/ec [netbsd-6-0]: ec2_mult.c

Log Message:
Pull up following revision(s) (requested by tron in ticket #1041):
crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c: revision 1.2
crypto/external/bsd/openssl/dist/crypto/bn/bn.h: revision 1.2
crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c: revision 1.2
Add fix for CVE-2014-0076 taken from OpenSSL GIT repository:
Fix for the attack described in the paper "Recovering OpenSSL
ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
by Yuval Yarom and Naomi Benger. Details can be obtained from:
http://eprint.iacr.org/2014/140


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.1.4.1 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.10.1 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.1.4.1 \
src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1 src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1.4.1
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1	Tue Aug 14 07:56:09 2012
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h	Thu Apr  3 19:02:00 2014
@@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret,
 BIGNUM *BN_mod_sqrt(BIGNUM *ret,
 	const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
 
+void	BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
+
 /* Deprecated versions */
 #ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
@@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf
 
 #define bn_fix_top(a)		bn_check_top(a)
 
+#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
+#define bn_wcheck_size(bn, words) \
+	do { \
+		const BIGNUM *_bnum2 = (bn); \
+		assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
+	} while(0)
+
 #else /* !BN_DEBUG */
 
 #define bn_pollute(a)
 #define bn_check_top(a)
 #define bn_fix_top(a)		bn_correct_top(a)
+#define bn_check_size(bn, bits)
+#define bn_wcheck_size(bn, words)
 
 #endif
 

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2 src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2.10.1
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2	Sun Jun  5 14:57:56 2011
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c	Thu Apr  3 19:02:00 2014
@@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a,
 		}
 	return bn_cmp_words(a,b,cl);
 	}
+
+/* 
+ * Constant-time conditional swap of a and b.  
+ * a and b are swapped if condition is not 0.  The code assumes that at most one bit of condition is set.
+ * nwords is the number of words to swap.  The code assumes that at least nwords are allocated in both a and b,
+ * and that no more than nwords are used by either a or b.
+ * a and b cannot be the same number
+ */
+void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
+	{
+	BN_ULONG t;
+	int i;
+
+	bn_wcheck_size(a, nwords);
+	bn_wcheck_size(b, nwords);
+
+	assert(a != b);
+	assert((condition & (condition - 1)) == 0);
+	assert(sizeof(BN_ULONG) >= sizeof(int));
+
+	condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1;
+
+	t = (a->top^b->top) & condition;
+	a->top ^= t;
+	b->top ^= t;
+
+#define BN_CONSTTIME_SWAP(ind) \
+	do { \
+		t = (a->d[ind] ^ b->d[ind]) & condition; \
+		a->d[ind] ^= t; \
+		b->d[ind] ^= t; \
+	} while (0)
+
+
+	switch (nwords) {
+	default:
+		for (i = 10; i < nwords; i++) 
+			BN_CONSTTIME_SWAP(i);
+		/* Fallthrough */
+	case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */
+	case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */
+	case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */
+	case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */
+	case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */
+	case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */
+	case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */
+	case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
+	case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
+	case 1: BN_CONSTTIME_SWAP(0);
+	}
+#undef BN_CONSTTIME_SWAP
+}

Index: src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1 src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1.4.1
--- src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1	Tue Aug 14 07:56:23 2012
+++ src/crypto/external/bsd/openssl/dist/crypto/ec/

CVS commit: [netbsd-6] src/crypto/external/bsd/openssl/dist/crypto

2014-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  3 19:01:50 UTC 2014

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/bn [netbsd-6]: bn.h
bn_lib.c
src/crypto/external/bsd/openssl/dist/crypto/ec [netbsd-6]: ec2_mult.c

Log Message:
Pull up following revision(s) (requested by tron in ticket #1041):
crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c: revision 1.2
crypto/external/bsd/openssl/dist/crypto/bn/bn.h: revision 1.2
crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c: revision 1.2
Add fix for CVE-2014-0076 taken from OpenSSL GIT repository:
Fix for the attack described in the paper "Recovering OpenSSL
ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
by Yuval Yarom and Naomi Benger. Details can be obtained from:
http://eprint.iacr.org/2014/140


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.2 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.4.1 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.2 \
src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1 src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.2
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h:1.1.1.2.4.1	Tue Aug 14 07:56:09 2012
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn.h	Thu Apr  3 19:01:50 2014
@@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret,
 BIGNUM *BN_mod_sqrt(BIGNUM *ret,
 	const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
 
+void	BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
+
 /* Deprecated versions */
 #ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
@@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf
 
 #define bn_fix_top(a)		bn_check_top(a)
 
+#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
+#define bn_wcheck_size(bn, words) \
+	do { \
+		const BIGNUM *_bnum2 = (bn); \
+		assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
+	} while(0)
+
 #else /* !BN_DEBUG */
 
 #define bn_pollute(a)
 #define bn_check_top(a)
 #define bn_fix_top(a)		bn_correct_top(a)
+#define bn_check_size(bn, bits)
+#define bn_wcheck_size(bn, words)
 
 #endif
 

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2 src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2.4.1
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c:1.1.1.2	Sun Jun  5 14:57:56 2011
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c	Thu Apr  3 19:01:50 2014
@@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a,
 		}
 	return bn_cmp_words(a,b,cl);
 	}
+
+/* 
+ * Constant-time conditional swap of a and b.  
+ * a and b are swapped if condition is not 0.  The code assumes that at most one bit of condition is set.
+ * nwords is the number of words to swap.  The code assumes that at least nwords are allocated in both a and b,
+ * and that no more than nwords are used by either a or b.
+ * a and b cannot be the same number
+ */
+void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
+	{
+	BN_ULONG t;
+	int i;
+
+	bn_wcheck_size(a, nwords);
+	bn_wcheck_size(b, nwords);
+
+	assert(a != b);
+	assert((condition & (condition - 1)) == 0);
+	assert(sizeof(BN_ULONG) >= sizeof(int));
+
+	condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1;
+
+	t = (a->top^b->top) & condition;
+	a->top ^= t;
+	b->top ^= t;
+
+#define BN_CONSTTIME_SWAP(ind) \
+	do { \
+		t = (a->d[ind] ^ b->d[ind]) & condition; \
+		a->d[ind] ^= t; \
+		b->d[ind] ^= t; \
+	} while (0)
+
+
+	switch (nwords) {
+	default:
+		for (i = 10; i < nwords; i++) 
+			BN_CONSTTIME_SWAP(i);
+		/* Fallthrough */
+	case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */
+	case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */
+	case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */
+	case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */
+	case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */
+	case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */
+	case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */
+	case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
+	case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
+	case 1: BN_CONSTTIME_SWAP(0);
+	}
+#undef BN_CONSTTIME_SWAP
+}

Index: src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1 src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.2
--- src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c:1.1.1.2.4.1	Tue Aug 14 07:56:23 2012
+++ src/crypto/external/bsd/openssl/dist/crypto/ec/ec2_mult.c	Thu Apr  3 

CVS commit: src/sys/dev/raidframe

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 18:55:26 UTC 2014

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
Add a "soft" root option, leaving the current default as "force root", so
as not to break existing configurations.


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.307 src/sys/dev/raidframe/rf_netbsdkintf.c:1.308
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.307	Thu Apr  3 11:30:52 2014
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Thu Apr  3 14:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.307 2014/04/03 15:30:52 christos Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.308 2014/04/03 18:55:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.307 2014/04/03 15:30:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.308 2014/04/03 18:55:26 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -537,11 +537,10 @@ rf_buildroothack(RF_ConfigSet_t *config_
 			candidate_root = dkwedge_find_by_wname(cname);
 		} else
 			candidate_root = rsc->sc_dev;
-#ifndef RAIDFRAME_FORCE_ROOT
-		if (booted_device == NULL
-		|| rf_containsboot(&rsc->sc_r, booted_device))
-#endif
-		booted_device = candidate_root;
+		if (booted_device == NULL ||
+		rsc->sc_r.root_partition == 1 ||
+		rf_containsboot(&rsc->sc_r, booted_device))
+			booted_device = candidate_root;
 	} else if (num_root > 1) {
 
 		/* 
@@ -3327,6 +3326,10 @@ void
 rf_print_component_label(RF_ComponentLabel_t *clabel)
 {
 	uint64_t numBlocks;
+	static const char *rp[] = {
+	"No", "Force", "Soft", "*invalid*"
+	};
+
 
 	numBlocks = rf_component_label_numblocks(clabel);
 
@@ -3343,8 +3346,7 @@ rf_print_component_label(RF_ComponentLab
 	printf("   RAID Level: %c  blocksize: %d numBlocks: %"PRIu64"\n",
 	   (char) clabel->parityConfig, clabel->blockSize, numBlocks);
 	printf("   Autoconfig: %s\n", clabel->autoconfigure ? "Yes" : "No");
-	printf("   Contains root partition: %s\n",
-	   clabel->root_partition ? "Yes" : "No");
+	printf("   Root partition: %s\n", rp[clabel->root_partition & 3]);
 	printf("   Last configured as: raid%d\n", clabel->last_unit);
 #if 0
 	   printf("   Config order: %d\n", clabel->config_order);
@@ -3790,12 +3792,20 @@ rf_auto_config_set(RF_ConfigSet_t *cset)
 
 		rf_markalldirty(raidPtr);
 		raidPtr->autoconfigure = 1; /* XXX do this here? */
-		if (cset->ac->clabel->root_partition==1) {
-			/* everything configured just fine.  Make a note
-			   that this set is eligible to be root. */
-			cset->rootable = 1;
+		switch (cset->ac->clabel->root_partition) {
+		case 1:	/* Force Root */
+		case 2:	/* Soft Root: root when boot partition part of raid */
+			/*
+			 * everything configured just fine.  Make a note
+			 * that this set is eligible to be root,
+			 * or forced to be root
+			 */
+			cset->rootable = cset->ac->clabel->root_partition;
 			/* XXX do this here? */
-			raidPtr->root_partition = 1;
+			raidPtr->root_partition = cset->rootable;
+			break;
+		default:
+			break;
 		}
 	} else {
 		raidput(sc);



CVS commit: src/sbin/raidctl

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 18:54:10 UTC 2014

Modified Files:
src/sbin/raidctl: raidctl.8 raidctl.c

Log Message:
Add the ability to "softroot" mount (i.e. mount root only when the raid
set contains the boot device), as opposed to "hardroot" (the previous
default which forces the raid to be root no matter what).


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.56 -r1.57 src/sbin/raidctl/raidctl.c

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

Modified files:

Index: src/sbin/raidctl/raidctl.8
diff -u src/sbin/raidctl/raidctl.8:1.66 src/sbin/raidctl/raidctl.8:1.67
--- src/sbin/raidctl/raidctl.8:1.66	Mon Oct  7 06:50:37 2013
+++ src/sbin/raidctl/raidctl.8	Thu Apr  3 14:54:10 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: raidctl.8,v 1.66 2013/10/07 10:50:37 jdc Exp $
+.\" $NetBSD: raidctl.8,v 1.67 2014/04/03 18:54:10 christos Exp $
 .\"
 .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\" any improvements or extensions that they make and grant Carnegie the
 .\" rights to redistribute these changes.
 .\"
-.Dd October 7, 2013
+.Dd April 3, 2014
 .Dt RAIDCTL 8
 .Os
 .Sh NAME
@@ -65,7 +65,7 @@
 .Fl a Ar component Ar dev
 .Nm
 .Op Fl v
-.Fl A Op yes | no | root
+.Fl A Op yes | no | forceroot | softroot
 .Ar dev
 .Nm
 .Op Fl v
@@ -163,7 +163,7 @@ Note that all components of the set must
 in the disklabel.
 .It Fl A Ic no Ar dev
 Turn off auto-configuration for the RAID set.
-.It Fl A Ic root Ar dev
+.It Fl A Ic forceroot Ar dev
 Make the RAID set auto-configurable, and also mark the set as being
 eligible to be the root partition.
 A RAID set configured this way will
@@ -175,6 +175,10 @@ in the disklabel.
 Note that only certain architectures
 .Pq currently alpha, amd64, i386, pmax, sandpoint, sparc, sparc64, and vax
 support booting a kernel directly from a RAID set.
+.It Fl A Ic softroot Ar dev
+Like
+.Ic forceroot ,
+but only change the root device if the boot device is part of the RAID set.
 .It Fl B Ar dev
 Initiate a copyback of reconstructed data from a spare disk to
 its original disk.

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.56 src/sbin/raidctl/raidctl.c:1.57
--- src/sbin/raidctl/raidctl.c:1.56	Fri Oct 18 21:09:59 2013
+++ src/sbin/raidctl/raidctl.c	Thu Apr  3 14:54:10 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.56 2013/10/19 01:09:59 christos Exp $   */
+/*  $NetBSD: raidctl.c,v 1.57 2014/04/03 18:54:10 christos Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.56 2013/10/19 01:09:59 christos Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.57 2014/04/03 18:54:10 christos Exp $");
 #endif
 
 
@@ -88,6 +88,8 @@ static  void rf_pm_configure(int, int, c
 
 int verbose;
 
+static const char *rootpart[] = { "No", "Force", "Soft", "*invalid*" };
+
 int
 main(int argc,char *argv[])
 {
@@ -748,7 +750,7 @@ get_component_label(int fd, char *compon
 	printf("   Autoconfig: %s\n", 
 	   component_label.autoconfigure ? "Yes" : "No" );
 	printf("   Root partition: %s\n",
-	   component_label.root_partition ? "Yes" : "No" );
+	   rootpart[component_label.root_partition & 3]);
 	printf("   Last configured as: raid%d\n", component_label.last_unit );
 }
 
@@ -806,12 +808,16 @@ set_autoconfig(int fd, int raidID, char 
 	auto_config = 0;
 	root_config = 0;
 
-	if (strncasecmp(autoconf,"root", 4) == 0) {
+	if (strncasecmp(autoconf, "root", 4) == 0 ||
+	strncasecmp(autoconf, "hard", 4) == 0 ||
+	strncasecmp(autoconf, "force", 4) == 0) {
 		root_config = 1;
+	} else if (strncasecmp(autoconf, "soft", 4) == 0) {
+		root_config = 2;
 	}
 
 	if ((strncasecmp(autoconf,"yes", 3) == 0) ||
-	root_config == 1) {
+	root_config > 0) {
 		auto_config = 1;
 	}
 
@@ -824,9 +830,8 @@ set_autoconfig(int fd, int raidID, char 
 	printf("raid%d: Autoconfigure: %s\n", raidID,
 	   auto_config ? "Yes" : "No");
 
-	if (root_config == 1) {
-		printf("raid%d: Root: %s\n", raidID,
-		   auto_config ? "Yes" : "No");
+	if (auto_config == 1) {
+		printf("raid%d: Root: %s\n", raidID, rootpart[root_config]);
 	}
 }
 
@@ -1130,7 +1135,7 @@ usage(void)
 	const char *progname = getprogname();
 
 	fprintf(stderr, "usage: %s [-v] -a component dev\n", progname);
-	fprintf(stderr, "   %s [-v] -A [yes | no | root] dev\n", progname);
+	fprintf(stderr, "   %s [-v] -A [yes | no | softroot | hardroot] dev\n", progname);
 	fprintf(stderr, "   %s [-v] -B dev\n", progname);
 	fprintf(stderr, "   %s [-v] -c config_file dev\n", progname);
 	fprintf(stderr, "   %s [-v] -C config_file dev\n", progname);



CVS commit: src/sys/arch/cobalt/stand/boot

2014-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr  3 18:49:41 UTC 2014

Modified Files:
src/sys/arch/cobalt/stand/boot: wd.c

Log Message:
Avoid type pruning.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/cobalt/stand/boot/wd.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/cobalt/stand/boot/wd.c
diff -u src/sys/arch/cobalt/stand/boot/wd.c:1.15 src/sys/arch/cobalt/stand/boot/wd.c:1.16
--- src/sys/arch/cobalt/stand/boot/wd.c:1.15	Sun Jul 17 20:54:38 2011
+++ src/sys/arch/cobalt/stand/boot/wd.c	Thu Apr  3 18:49:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.15 2011/07/17 20:54:38 joerg Exp $	*/
+/*	$NetBSD: wd.c,v 1.16 2014/04/03 18:49:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -157,6 +157,7 @@ wdgetdisklabel(struct wd_softc *wd)
 	size_t rsize;
 	struct disklabel *lp;
 	uint8_t buf[DEV_BSIZE];
+	uint16_t magic;
 
 	wdgetdefaultlabel(wd, &wd->sc_label);
 
@@ -167,7 +168,8 @@ wdgetdisklabel(struct wd_softc *wd)
 	if (wdstrategy(wd, F_READ, MBR_BBSECTOR, DEV_BSIZE, buf, &rsize))
 		return EOFFSET;
 
-	if (*(uint16_t *)&buf[MBR_MAGIC_OFFSET] == MBR_MAGIC) {
+	memcpy(&magic, &buf[MBR_MAGIC_OFFSET], sizeof(magic));
+	if (magic == MBR_MAGIC) {
 		int i;
 		struct mbr_partition *mp;
 



CVS commit: src/sys/arch/cobalt/stand/boot

2014-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr  3 18:49:52 UTC 2014

Modified Files:
src/sys/arch/cobalt/stand/boot: wdc.c

Log Message:
GC found.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/cobalt/stand/boot/wdc.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/cobalt/stand/boot/wdc.c
diff -u src/sys/arch/cobalt/stand/boot/wdc.c:1.13 src/sys/arch/cobalt/stand/boot/wdc.c:1.14
--- src/sys/arch/cobalt/stand/boot/wdc.c:1.13	Tue Jan 19 15:28:52 2010
+++ src/sys/arch/cobalt/stand/boot/wdc.c	Thu Apr  3 18:49:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.13 2010/01/19 15:28:52 tsutsui Exp $	*/
+/*	$NetBSD: wdc.c,v 1.14 2014/04/03 18:49:52 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -115,7 +115,6 @@ wdcprobe(struct wdc_channel *chp)
 	uint8_t st0, st1;
 	uint8_t ret_value = 0x03;
 	uint8_t drive;
-	int found;
 
 	/*
 	 * Sanity check to see if the wdc channel responds at all.
@@ -157,7 +156,6 @@ wdcprobe(struct wdc_channel *chp)
 	 * something here assume it's ATA or OLD. Ghost will be killed later in
 	 * attach routine.
 	 */
-	found = 0;
 	for (drive = 0; drive < 2; drive++) {
 		if ((ret_value & (0x01 << drive)) == 0)
 			continue;



CVS commit: src/share/mk

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 18:29:11 UTC 2014

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

Log Message:
Elide broken exists tests for TOOL_CTFCONVERT and TOOL_CTFMERGE.

Either you set MKCTF=yes and they should exist, or you set MKCTF=no
and it doesn't matter.  If MKCTF=yes and they don't exist, something
is broken, and this should fail noisily, not silently.


To generate a diff of this commit:
cvs rdiff -u -r1.793 -r1.794 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.793 src/share/mk/bsd.own.mk:1.794
--- src/share/mk/bsd.own.mk:1.793	Wed Apr  2 22:34:29 2014
+++ src/share/mk/bsd.own.mk	Thu Apr  3 18:29:11 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.793 2014/04/02 22:34:29 joerg Exp $
+#	$NetBSD: bsd.own.mk,v 1.794 2014/04/03 18:29:11 riastradh Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -507,7 +507,7 @@ FC=		${TOOL_FC.${ACTIVE_FC}}
 OBJC=		${TOOL_OBJC.${ACTIVE_OBJC}}
 
 # Override with tools versions if needed
-.if ${MKCTF:Uno} != "no" && exists(${TOOL_CTFCONVERT}) && exists(${TOOL_CTFMERGE})
+.if ${MKCTF:Uno} != "no"
 CTFCONVERT=	${TOOL_CTFCONVERT}
 CTFMERGE=	${TOOL_CTFMERGE}
 .endif



CVS commit: src/share/mk

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 18:27:37 UTC 2014

Modified Files:
src/share/mk: sys.mk

Log Message:
By default define CTFCONVERT and CTFMERGE to be no-ops in sys.mk.

Don't test for /usr/bin/ctfconvert or /usr/bin/ctfmerge -- that is
completely bonkers and breaks the build if the host's ctfconvert and
ctfmerge are too old.

Strip the broken conditionals in the .c.o &c. rules.

bsd.own.mk will override CTFCONVERT and CTFMERGE with TOOL_CTFCONVERT
and TOOL_CTFMERGE if MKCTF=yes.

XXX The way CTFCONVERT and CTFMERGE are integrated into the rules is
bogus -- it is not safe to interrupt them.  We need some intermediate
object to do this right.

Please let me know if I broke anything with this -- I am not an elvin
or dwarven wizard, nor a dtrace expert.  But this has been breaking
builds for ages now and nobody else seems to want to do anything
about it.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/share/mk/sys.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/sys.mk
diff -u src/share/mk/sys.mk:1.122 src/share/mk/sys.mk:1.123
--- src/share/mk/sys.mk:1.122	Sun Mar  9 19:10:01 2014
+++ src/share/mk/sys.mk	Thu Apr  3 18:27:37 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.122 2014/03/09 19:10:01 christos Exp $
+#	$NetBSD: sys.mk,v 1.123 2014/04/03 18:27:37 riastradh Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -49,10 +49,8 @@ CTFMFLAGS	?=	-S 1 -g -t -L VERSION
 
 # We have to define these here, because if we don't the rules below will
 # not work
-.if exists(/usr/bin/ctfconvert) && exists(/usr/bin/ctfmerge)
-CTFCONVERT	?=	ctfconvert
-CTFMERGE	?=	ctfmerge
-.endif
+CTFCONVERT	?=	: ctfconvert
+CTFMERGE	?=	: ctfmerge
 
 CXX?=		c++
 CXXFLAGS?=	${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length}
@@ -120,14 +118,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 .c:
 	${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 # XXX: disable for now
-#.if defined(CTFCONVERT)
 #	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-#.endif
 .c.o:
 	${COMPILE.c} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .c.a:
 	${COMPILE.c} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -152,9 +146,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 	${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 .f.o:
 	${COMPILE.f} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .f.a:
 	${COMPILE.f} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -162,14 +154,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 
 .F:
 	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .F.o:
 	${COMPILE.F} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .F.a:
 	${COMPILE.F} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -179,9 +167,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 .r.o:
 	${COMPILE.r} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .r.a:
 	${COMPILE.r} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -190,14 +176,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 # Pascal
 .p:
 	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .p.o:
 	${COMPILE.p} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .p.a:
 	${COMPILE.p} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -206,28 +188,20 @@ YACC.y?=	${YACC} ${YFLAGS}
 # Assembly
 .s:
 	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .s.o:
 	${COMPILE.s} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .s.a:
 	${COMPILE.s} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
 	rm -f ${.PREFIX}.o
 .S:
 	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .S.o:
 	${COMPILE.S} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .S.a:
 	${COMPILE.S} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -244,9 +218,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 .l.o:
 	${LEX.l} ${.IMPSRC}
 	${COMPILE.c} -o ${.TARGET} lex.yy.c
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 	rm -f lex.yy.c
 
 # Yacc
@@ -260,9 +232,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 .y.o:
 	${YACC.y} ${.IMPSRC}
 	${COMPILE.c} -o ${.TARGET} y.tab.c
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 	rm -f y.tab.c
 
 # Shell



CVS commit: src/external/mit/xorg/server/drivers/xf86-video-intel

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 18:17:52 UTC 2014

Modified Files:
src/external/mit/xorg/server/drivers/xf86-video-intel: Makefile

Log Message:
Skip SNA on i386 for now, since it triggers a GCC ICE.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/mit/xorg/server/drivers/xf86-video-intel/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/xf86-video-intel/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-video-intel/Makefile:1.12 src/external/mit/xorg/server/drivers/xf86-video-intel/Makefile:1.13
--- src/external/mit/xorg/server/drivers/xf86-video-intel/Makefile:1.12	Thu Apr  3 02:51:20 2014
+++ src/external/mit/xorg/server/drivers/xf86-video-intel/Makefile	Thu Apr  3 18:17:52 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2014/04/03 02:51:20 riastradh Exp $
+#	$NetBSD: Makefile,v 1.13 2014/04/03 18:17:52 riastradh Exp $
 
 .include 
 
@@ -24,6 +24,9 @@ SRCS+=		i810_dga.c
 SRCS+=		i810_dri.c
 SRCS+=		i810_hwmc.c
 
+# SNA is amd64-only for now -- triggers ICEs on i386.
+.if ${MACHINE_ARCH} != "i386"
+
 # sna
 .PATH:	${X11SRCDIR.${DRIVER}}/src/sna
 SRCS+=		blt.c
@@ -93,6 +96,8 @@ SRCS+=		fbstipple.c
 SRCS+=		fbtile.c
 SRCS+=		fbutil.c
 
+.endif
+
 # uxa
 .PATH:	${X11SRCDIR.${DRIVER}}/src/uxa
 SRCS+=		intel_batchbuffer.c
@@ -134,9 +139,13 @@ CPPFLAGS+=	-I${X11SRCDIR.${DRIVER}}/xvmc
 CPPFLAGS+=	-DHAVE_ATOMIC_PRIMITIVES
 
 CPPFLAGS+=	-DENABLE_XVMC
-CPPFLAGS+=	-DUSE_SNA
 CPPFLAGS+=	-DUSE_UXA
+.if ${MACHINE_ARCH} == "i386"
+CPPFLAGS+=	-DDEFAULT_ACCEL_METHOD=UXA
+.else
+CPPFLAGS+=	-DUSE_SNA
 CPPFLAGS+=	-DDEFAULT_ACCEL_METHOD=SNA
+.endif
 
 CPPFLAGS+=	-DHAVE_DRI1
 CPPFLAGS+=	-DHAVE_DRI2_H



CVS commit: src/tools

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 18:23:38 UTC 2014

Modified Files:
src/tools: Makefile

Log Message:
ctfconvert/ctfmerge need libdwarf &c., so build them if MKCTF=yes.


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/tools/Makefile

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

Modified files:

Index: src/tools/Makefile
diff -u src/tools/Makefile:1.172 src/tools/Makefile:1.173
--- src/tools/Makefile:1.172	Tue Mar 25 09:52:56 2014
+++ src/tools/Makefile	Thu Apr  3 18:23:38 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.172 2014/03/25 09:52:56 ozaki-r Exp $
+#	$NetBSD: Makefile,v 1.173 2014/04/03 18:23:38 riastradh Exp $
 
 .include 
 .include 
@@ -65,7 +65,7 @@ TOOLCHAIN_BITS+= dbsym mdsetimage
 .endif
 
 DTRACE_BITS=
-.if ${MKDTRACE} != "no"
+.if ${MKDTRACE} != "no" || ${MKCTF} != "no"
 DTRACE_BITS+= .WAIT libelf
 DTRACE_BITS+= .WAIT libdwarf
 DTRACE_BITS+= .WAIT libctf



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

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 17:14:41 UTC 2014

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

Log Message:
Make sure to enable refclk for usb on omap5


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/evbarm/beagle/beagle_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.56 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.57
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.56	Sat Mar 29 14:47:30 2014
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Thu Apr  3 17:14:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.56 2014/03/29 14:47:30 matt Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.57 2014/04/03 17:14:41 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.56 2014/03/29 14:47:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.57 2014/04/03 17:14:41 matt Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -1049,6 +1049,29 @@ beagle_device_register(device_t self, vo
 		prop_dictionary_set_cstring(dict, "port2-mode", "hsic");
 		prop_dictionary_set_int16(dict, "port2-gpio", -1);
 #endif
+#if defined(OMAP_5430)
+		bus_space_tag_t iot = &omap_bs_tag;
+		bus_space_handle_t ioh;
+		omap2_gpio_ctl(80, GPIO_PIN_OUTPUT);
+		omap2_gpio_write(80, 0);
+		prop_dictionary_set_uint16(dict, "nports", 1);
+		prop_dictionary_set_cstring(dict, "port0-mode", "hsi");
+#if 0
+		prop_dictionary_set_bool(dict, "phy-reset", true);
+		prop_dictionary_set_int16(dict, "port0-gpio", 80);
+		prop_dictionary_set_bool(dict, "port0-gpioval", true);
+#endif
+		int rv = bus_space_map(iot, OMAP5_CM_CTL_WKUP_REF_CLK0_OUT_REF_CLK1_OUT, 4, 0, &ioh);
+		KASSERT(rv == 0);
+		uint32_t v = bus_space_read_4(iot, ioh, 0);
+		v &= 0x;
+		v |= __SHIFTIN(OMAP5_CM_CTL_WKUP_MUXMODE1_REF_CLK1_OUT,
+		OMAP5_CM_CTL_WKUP_MUXMODE1);
+		bus_space_write_4(iot, ioh, 0, v);
+		bus_space_unmap(iot, ioh, 4);
+
+		omap2_gpio_write(80, 1);
+#endif
 		return;
 	}
 



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

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 17:12:15 UTC 2014

Modified Files:
src/sys/arch/arm/omap: omap5_ahcisata.c

Log Message:
Enable sata port


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap5_ahcisata.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/omap/omap5_ahcisata.c
diff -u src/sys/arch/arm/omap/omap5_ahcisata.c:1.1 src/sys/arch/arm/omap/omap5_ahcisata.c:1.2
--- src/sys/arch/arm/omap/omap5_ahcisata.c:1.1	Sat Jun 15 21:55:09 2013
+++ src/sys/arch/arm/omap/omap5_ahcisata.c	Thu Apr  3 17:12:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: omap5_ahcisata.c,v 1.1 2013/06/15 21:55:09 matt Exp $ */
+/* $NetBSD: omap5_ahcisata.c,v 1.2 2014/04/03 17:12:15 matt Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap5_ahcisata.c,v 1.1 2013/06/15 21:55:09 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap5_ahcisata.c,v 1.2 2014/04/03 17:12:15 matt Exp $");
 
 #include "locators.h"
 
@@ -83,6 +83,21 @@ omap5_ahcisata_attach(device_t parent, d
 	aprint_naive("\n");
 	aprint_normal(": OMAP AHCI controller\n");
 
+#ifdef OMAP5
+	{
+		bus_space_handle_t ioh;
+		rv = bus_space_map(obio->obio_iot,
+		OMAP5_CM_L3INIT_SATA_CLKCTRL, 4, 0, &ioh);
+		KASSERT(rv == 0);
+		uint32_t v = bus_space_read_4(obio->obio_iot, ioh, 0);
+		v &= ~OMAP5_CM_L3INIT_MODE;
+		v |= OMAP5_CM_L3INIT_ENABLE;
+		bus_space_write_4(obio->obio_iot, ioh, 0, v);
+		bus_space_unmap(obio->obio_iot, ioh, 4);
+	}
+#endif
+
+	sc->sc_ahci_ports = 1;
 	sc->sc_dmat = obio->obio_dmat;
 	sc->sc_ahcit = obio->obio_iot;
 	sc->sc_ahcis = obio->obio_size;



CVS commit: src/lib/librumpclient

2014-04-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr  3 17:11:35 UTC 2014

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
Make sure holyfd is -1 when rumpclient_init() is called for
the first time after fork to prevent fd 0 from being closed.

should fix test failures, thanks to martin for the prod


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.60 src/lib/librumpclient/rumpclient.c:1.61
--- src/lib/librumpclient/rumpclient.c:1.60	Wed Apr  2 17:09:23 2014
+++ src/lib/librumpclient/rumpclient.c	Thu Apr  3 17:11:35 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.60 2014/04/02 17:09:23 justin Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.61 2014/04/03 17:11:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -50,7 +50,7 @@
 #define USE_SIGNALFD
 #endif
 
-__RCSID("$NetBSD: rumpclient.c,v 1.60 2014/04/02 17:09:23 justin Exp $");
+__RCSID("$NetBSD: rumpclient.c,v 1.61 2014/04/03 17:11:35 pooka Exp $");
 
 #include 
 #include 
@@ -121,7 +121,7 @@ static struct spclient clispc = {
 	.spc_fd = -1,
 };
 
-static int holyfd;
+static int holyfd = -1;
 static sigset_t fullset;
 
 static int doconnect(void);
@@ -878,10 +878,9 @@ rumpclient_init(void)
 	if (init_done == (mypid = getpid()))
 		return 0;
 
-	/* kq does not traverse fork() */
 #ifdef USE_KQUEUE
-	if (init_done != 0)
-		holyfd = -1;
+	/* kq does not traverse fork() */
+	holyfd = -1;
 #endif
 	init_done = mypid;
 



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

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 17:11:10 UTC 2014

Modified Files:
src/sys/arch/arm/omap: omap2_reg.h

Log Message:
Add some more OMAP5 stuff.
Consistently use upper case hex.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/omap/omap2_reg.h

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

Modified files:

Index: src/sys/arch/arm/omap/omap2_reg.h
diff -u src/sys/arch/arm/omap/omap2_reg.h:1.25 src/sys/arch/arm/omap/omap2_reg.h:1.26
--- src/sys/arch/arm/omap/omap2_reg.h:1.25	Thu Apr  3 17:09:48 2014
+++ src/sys/arch/arm/omap/omap2_reg.h	Thu Apr  3 17:11:10 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.25 2014/04/03 17:09:48 matt Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.26 2014/04/03 17:11:10 matt Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -56,7 +56,7 @@
 /* OMAP3 processors */
 
 #define	OMAP3430_L4_WAKEUP_BASE		0x4830
-#define	OMAP3430_L4_WAKEUP_SIZE		0x0004	/* 256KB */
+#define	OMAP3430_L4_WAKEUP_SIZE		0x0010	/* 256KB padded to 1M */
 
 #define	OMAP3430_L4_PERIPHERAL_BASE	0x4900
 #define	OMAP3430_L4_PERIPHERAL_SIZE	0x0010	/* 1MB */
@@ -65,7 +65,7 @@
 #define	OMAP3430_L4_EMULATION_SIZE	0x0080	/* 8MB */
 
 #define	OMAP3530_L4_WAKEUP_BASE		0x4830
-#define	OMAP3530_L4_WAKEUP_SIZE		0x0004	/* 256KB */
+#define	OMAP3530_L4_WAKEUP_SIZE		0x0010	/* 256KB padded to 1M */
 
 #define	OMAP3530_L4_PERIPHERAL_BASE	0x4900
 #define	OMAP3530_L4_PERIPHERAL_SIZE	0x0010	/* 1MB */
@@ -79,7 +79,7 @@
 #define	OMAP4430_L4_CORE_SIZE		0x0100	/* 16MB - CFG */
 
 #define	OMAP4430_L4_WAKEUP_BASE		0x4A30
-#define	OMAP4430_L4_WAKEUP_SIZE		0x0004	/* 256KB */
+#define	OMAP4430_L4_WAKEUP_SIZE		0x0010	/* 256KB padded to 1M */
 
 #define	OMAP4430_L4_PERIPHERAL_BASE	0x4800
 #define	OMAP4430_L4_PERIPHERAL_SIZE	0x0100	/* 16MB */
@@ -744,7 +744,7 @@
 #define	GPIO5_BASE_4430			0x4805b000
 #define	GPIO6_BASE_4430			0x4805d000
 
-#define	GPIO1_BASE_5430			0x4ae1
+#define	GPIO1_BASE_5430			0x4AE1
 #define	GPIO2_BASE_5430			0x48055000
 #define	GPIO3_BASE_5430			0x48057000
 #define	GPIO4_BASE_5430			0x48059000
@@ -753,10 +753,10 @@
 #define	GPIO7_BASE_5430			0x48051000
 #define	GPIO8_BASE_5430			0x48053000
 
-#define	GPIO0_BASE_TI_AM335X		0x44e07000
-#define	GPIO1_BASE_TI_AM335X		0x4804c000
-#define	GPIO2_BASE_TI_AM335X		0x481ac000
-#define	GPIO3_BASE_TI_AM335X		0x481ae000
+#define	GPIO0_BASE_TI_AM335X		0x44E07000
+#define	GPIO1_BASE_TI_AM335X		0x4804C000
+#define	GPIO2_BASE_TI_AM335X		0x481AC000
+#define	GPIO3_BASE_TI_AM335X		0x481AE000
 
 #define	GPIO1_BASE_TI_DM37XX		0x4831
 #define	GPIO2_BASE_TI_DM37XX		0x4905
@@ -844,6 +844,48 @@
 #define	 PRM_FRAC_INCR_DENUM_RELOAD	__BIT(16)
 #define	 PRM_FRAC_INCR_DENUM_DENOMINATOR	__BITS(11,0)
 #define	OMAP5_GTIMER_FREQ		6144000		/* 6.144Mhz */
+#define	OMAP5_CM_CTL_WKUP_LLIA_WAKEREQIN_LLIBWAKEREQIN \
+	0x4AE0C840
+#define	OMAP5_CM_CTL_WKUP_DRM_EMU0_DRM_EMU1 \
+	0x4AE0C844
+#define	OMAP5_CM_CTL_WKUP_JTAG_NTRST_JTAG_TCK \
+	0x4AE0C848
+#define	OMAP5_CM_CTL_WKUP_JTAG_TDI_JTAG_TMSC \
+	0x4AE0C84C
+#define	OMAP5_CM_CTL_WKUP_JTAG_TDI_JTAG_TDO \
+	0x4AE0C850
+#define	OMAP5_CM_CTL_WKUP_SYS_32K_FREQ_CLK_IOREG \
+	0x4AE0C854
+#define	OMAP5_CM_CTL_WKUP_REF_CLK0_OUT_REF_CLK1_OUT \
+	0x4AE0C858
+#define	OMAP5_CM_CTL_WKUP_WAKEUPEVENT1	__BIT(31)
+#define	OMAP5_CM_CTL_WKUP_WAKEUPENABLE1	__BIT(30)
+#define	OMAP5_CM_CTL_WKUP_INPUT_ENABLE1	__BIT(24)
+#define	OMAP5_CM_CTL_WKUP_PWRDOWN1	__BIT(21)
+#define	OMAP5_CM_CTL_WKUP_PULLTYPEUP1	__BIT(20)
+#define	OMAP5_CM_CTL_WKUP_PULLUDENABLE1	__BIT(19)
+#define	OMAP5_CM_CTL_WKUP_MUXMODE1	__BITS(18,16)
+#define	OMAP5_CM_CTL_WKUP_WAKEUPEVENT0	__BIT(15)
+#define	OMAP5_CM_CTL_WKUP_WAKEUPENABLE0	__BIT(14)
+#define	OMAP5_CM_CTL_WKUP_INPUT_ENABLE0	__BIT(8)
+#define	OMAP5_CM_CTL_WKUP_PWRDOWN0	__BIT(5)
+#define	OMAP5_CM_CTL_WKUP_PULLTYPEUP0	__BIT(4)
+#define	OMAP5_CM_CTL_WKUP_PULLUDENABLE0	__BIT(3)
+#define	OMAP5_CM_CTL_WKUP_MUXMODE0	__BITS(2,0)
+
+#define	OMAP5_CM_CTL_WKUP_MUXMODE1_REF_CLK1_OUT		0
+#define	OMAP5_CM_CTL_WKUP_MUXMODE1_HW_WKDBG5		5
+#define	OMAP5_CM_CTL_WKUP_MUXMODE1_GPIO_WK11		6
+#define	OMAP5_CM_CTL_WKUP_MUXMODE1_SAFE_MODE_WAKEUP12	7
+
+#define	OMAP5_CM_L3INIT_MMC1_CLKCTRL		0x4a009628
+#define	OMAP5_CM_L3INIT_MMC2_CLKCTRL		0x4a009630
+#define	OMAP5_CM_L3INIT_HSI_CLKCTRL		0x4a009638
+#define	OMAP5_CM_L3INIT_USB_HOST_HS_CLKCTRL	0x4a009658
+#define	OMAP5_CM_L3INIT_SATA_CLKCTRL		0x4a009688
+
+#define	OMAP5_CM_L3INIT_MODE			__BITS(0,1)
+#define	OMAP5_CM_L3INIT_ENABLE			2
 
 #ifdef TI_AM335X
 #define	TI_AM335X_CTLMOD_BASE		0x44e1



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

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 17:09:48 UTC 2014

Modified Files:
src/sys/arch/arm/omap: omap2_reg.h

Log Message:
Consistently use #define


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/omap/omap2_reg.h

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

Modified files:

Index: src/sys/arch/arm/omap/omap2_reg.h
diff -u src/sys/arch/arm/omap/omap2_reg.h:1.24 src/sys/arch/arm/omap/omap2_reg.h:1.25
--- src/sys/arch/arm/omap/omap2_reg.h:1.24	Sat Mar 29 23:32:41 2014
+++ src/sys/arch/arm/omap/omap2_reg.h	Thu Apr  3 17:09:48 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: omap2_reg.h,v 1.24 2014/03/29 23:32:41 matt Exp $ */
+/* $NetBSD: omap2_reg.h,v 1.25 2014/04/03 17:09:48 matt Exp $ */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -30,7 +30,7 @@
  */
 
 #ifndef _ARM_OMAP_OMAP2_REG_H_
-#define _ARM_OMAP_OMAP2_REG_H_
+#define	_ARM_OMAP_OMAP2_REG_H_
 
 #include "opt_omap.h"
 
@@ -41,132 +41,132 @@
 /*
  * L4 Interconnect WAKEUP address space
  */
-#define OMAP2430_L4_CORE_BASE		0x4800
-#define OMAP2430_L4_CORE_SIZE		(16 << 20)	/* 16 MB */
+#define	OMAP2430_L4_CORE_BASE		0x4800
+#define	OMAP2430_L4_CORE_SIZE		(16 << 20)	/* 16 MB */
 
-#define OMAP2430_L4_WAKEUP_BASE		0x4900
-#define OMAP2430_L4_WAKEUP_SIZE		(8 << 20)	/* 8 MB */
+#define	OMAP2430_L4_WAKEUP_BASE		0x4900
+#define	OMAP2430_L4_WAKEUP_SIZE		(8 << 20)	/* 8 MB */
 
-#define OMAP3430_L4_CORE_BASE		0x4800
-#define OMAP3430_L4_CORE_SIZE		0x0100	/* 16 MB */
+#define	OMAP3430_L4_CORE_BASE		0x4800
+#define	OMAP3430_L4_CORE_SIZE		0x0100	/* 16 MB */
 
-#define OMAP3530_L4_CORE_BASE		0x4800
-#define OMAP3530_L4_CORE_SIZE		0x0100	/* 16 MB */
+#define	OMAP3530_L4_CORE_BASE		0x4800
+#define	OMAP3530_L4_CORE_SIZE		0x0100	/* 16 MB */
 
 /* OMAP3 processors */
 
-#define OMAP3430_L4_WAKEUP_BASE		0x4830
-#define OMAP3430_L4_WAKEUP_SIZE		0x0004	/* 256KB */
+#define	OMAP3430_L4_WAKEUP_BASE		0x4830
+#define	OMAP3430_L4_WAKEUP_SIZE		0x0004	/* 256KB */
 
-#define OMAP3430_L4_PERIPHERAL_BASE	0x4900
-#define OMAP3430_L4_PERIPHERAL_SIZE	0x0010	/* 1MB */
+#define	OMAP3430_L4_PERIPHERAL_BASE	0x4900
+#define	OMAP3430_L4_PERIPHERAL_SIZE	0x0010	/* 1MB */
 
-#define OMAP3430_L4_EMULATION_BASE	0x5400
-#define OMAP3430_L4_EMULATION_SIZE	0x0080	/* 8MB */
+#define	OMAP3430_L4_EMULATION_BASE	0x5400
+#define	OMAP3430_L4_EMULATION_SIZE	0x0080	/* 8MB */
 
-#define OMAP3530_L4_WAKEUP_BASE		0x4830
-#define OMAP3530_L4_WAKEUP_SIZE		0x0004	/* 256KB */
+#define	OMAP3530_L4_WAKEUP_BASE		0x4830
+#define	OMAP3530_L4_WAKEUP_SIZE		0x0004	/* 256KB */
 
-#define OMAP3530_L4_PERIPHERAL_BASE	0x4900
-#define OMAP3530_L4_PERIPHERAL_SIZE	0x0010	/* 1MB */
+#define	OMAP3530_L4_PERIPHERAL_BASE	0x4900
+#define	OMAP3530_L4_PERIPHERAL_SIZE	0x0010	/* 1MB */
 
-#define OMAP3530_L4_EMULATION_BASE	0x5400
-#define OMAP3530_L4_EMULATION_SIZE	0x0080	/* 8MB */
+#define	OMAP3530_L4_EMULATION_BASE	0x5400
+#define	OMAP3530_L4_EMULATION_SIZE	0x0080	/* 8MB */
 
 /* OMAP4 processors */
 
-#define OMAP4430_L4_CORE_BASE		0x4A00
-#define OMAP4430_L4_CORE_SIZE		0x0100	/* 16MB - CFG */
+#define	OMAP4430_L4_CORE_BASE		0x4A00
+#define	OMAP4430_L4_CORE_SIZE		0x0100	/* 16MB - CFG */
 
-#define OMAP4430_L4_WAKEUP_BASE		0x4A30
-#define OMAP4430_L4_WAKEUP_SIZE		0x0004	/* 256KB */
+#define	OMAP4430_L4_WAKEUP_BASE		0x4A30
+#define	OMAP4430_L4_WAKEUP_SIZE		0x0004	/* 256KB */
 
-#define OMAP4430_L4_PERIPHERAL_BASE	0x4800
-#define OMAP4430_L4_PERIPHERAL_SIZE	0x0100	/* 16MB */
+#define	OMAP4430_L4_PERIPHERAL_BASE	0x4800
+#define	OMAP4430_L4_PERIPHERAL_SIZE	0x0100	/* 16MB */
 
-#define OMAP4430_L4_ABE_BASE		0x4900	/* Actually L3 */
-#define OMAP4430_L4_ABE_SIZE		0x0100	/* 16MB */
+#define	OMAP4430_L4_ABE_BASE		0x4900	/* Actually L3 */
+#define	OMAP4430_L4_ABE_SIZE		0x0100	/* 16MB */
 
-#define OMAP4430_EMIF1_BASE		0x4C00	/* MemCtrl 0 */
-#define OMAP4430_EMIF1_SIZE		0x0010	/* 4KB padded to 1M */
+#define	OMAP4430_EMIF1_BASE		0x4C00	/* MemCtrl 0 */
+#define	OMAP4430_EMIF1_SIZE		0x0010	/* 4KB padded to 1M */
 
-#define OMAP4430_EMIF2_BASE		0x4D00	/* MemCtrl 1 */
-#define OMAP4430_EMIF2_SIZE		0x0010	/* 4KB padded to 1M */
+#define	OMAP4430_EMIF2_BASE		0x4D00	/* MemCtrl 1 */
+#define	OMAP4430_EMIF2_SIZE		0x0010	/* 4KB padded to 1M */
 
 /* OMAP5 processors */
 
-#define OMAP5430_L4_CORE_BASE		0x4A00
-#define OMAP5430_L4_CORE_SIZE		0x0100	/* 16MB - CFG */
+#define	OMAP5430_L4_CORE_BASE		0x4A00
+#define	OMAP5430_L4_CORE_SIZE		0x0100	/* 16MB - CFG */
 
-#define OMAP5430_L4_WAKEUP_BASE		0x4AE0
-#define OMAP5430_L4_WAKEUP_SIZE		0x0020	/* 2M */
+#define	OMAP5430_L4_WAKEUP_BASE		0x4AE0
+#define	OMAP5430_L4_WAKEUP_SIZE		0x0020	/* 2M */
 
-#define OMAP5430_L4_PERIPHERAL_B

CVS commit: src/sbin/fdisk

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 17:07:11 UTC 2014

Modified Files:
src/sbin/fdisk: fdisk.c

Log Message:
instead of using ugly -1's make args optional


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sbin/fdisk/fdisk.c

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

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.148 src/sbin/fdisk/fdisk.c:1.149
--- src/sbin/fdisk/fdisk.c:1.148	Tue Apr  1 15:08:48 2014
+++ src/sbin/fdisk/fdisk.c	Thu Apr  3 13:07:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.148 2014/04/01 19:08:48 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.149 2014/04/03 17:07:11 christos Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.148 2014/04/01 19:08:48 christos Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.149 2014/04/03 17:07:11 christos Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -321,6 +321,66 @@ initvar_disk(const char **diskp)
 #endif /* HAVE_NBTOOL_CONFIG_H */
 }
 
+static int
+getnum(const char *str, int *num)
+{
+	char *e;
+	long l;
+
+	errno = 0;
+	l = strtol(str, &e, 0);
+	if (str[0] == '\0' || *e != '\0')
+		return -1;
+	if (errno == ERANGE && (l == LONG_MAX || l == LONG_MIN))
+		return -1;
+	/* XXX: truncation */
+	*num = (int)l;
+	return 0;
+}
+
+/* [][/[][/[][/[ */
+static int
+parse_s(char *arg, int *csysid, unsigned *cstart, unsigned *csize,
+char **cbootmenu)
+{
+	char *ptr;
+	int num;
+
+	if ((ptr = strchr(arg, '/')) != NULL)
+		*ptr++ = '\0';
+
+	if (*arg) {
+		if (getnum(arg, &num) == -1)
+			return -1;
+		*csysid = num;
+	}
+	if (ptr == NULL)
+		return 0;
+
+	arg = ptr;
+	if ((ptr = strchr(arg, '/')) != NULL)
+		*ptr++ = '\0';
+	if (*arg) {
+		if (getnum(arg, &num) == -1)
+			return -1;
+		*cstart = num;
+	}
+	if (ptr == NULL)
+		return 0;
+
+	arg = ptr;
+	if ((ptr = strchr(arg, '/')) != NULL)
+		*ptr++ = '\0';
+	if (*arg) {
+		if (getnum(arg, &num) == -1)
+			return -1;
+		*csize = num;
+	}
+	if (ptr != NULL && *ptr)
+		*cbootmenu = ptr;
+	return 0;
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -331,8 +391,8 @@ main(int argc, char *argv[])
 	int n;
 #ifdef BOOTSEL
 	daddr_t default_ptn;		/* start sector of default ptn */
-	char *cbootmenu = 0;
 #endif
+	char *cbootmenu = 0;
 
 	int csysid;	/* For the s_flag. */
 	unsigned int cstart, csize;
@@ -340,7 +400,8 @@ main(int argc, char *argv[])
 	i_flag = B_flag = 0;
 	v_flag = 0;
 	E_flag = 0;
-	csysid = cstart = csize = 0;
+	csysid = -1;
+	cstart = csize = ~0;
 	while ((ch = getopt(argc, argv, OPTIONS)) != -1) {
 		switch (ch) {
 		case '0':
@@ -397,18 +458,12 @@ main(int argc, char *argv[])
 			break;
 		case 's':	/* Partition details */
 			s_flag = 1;
-			if (sscanf(optarg, "%d/%u/%u%n", &csysid, &cstart,
-			&csize, &n) == 3) {
-if (optarg[n] == 0)
-	break;
-#ifdef BOOTSEL
-if (optarg[n] == '/') {
-	cbootmenu = optarg + n + 1;
-	break;
-}
-#endif
-			}
-			errx(1, "Bad argument to the -s flag.");
+
+			if (parse_s(optarg, &csysid, &cstart, &csize,
+			&cbootmenu) == -1)
+errx(1, "Bad argument to the -s flag.");
+			printf("%d %d %d %s\n", csysid, cstart, csize, cbootmenu);
+			exit(0);
 			break;
 		case 'b':	/* BIOS geometry */
 			b_flag = 1;
@@ -621,7 +676,7 @@ usage(void)
 		"[-A ptn_alignment[/ptn_0_offset]] \\\n"
 		"%*s[-b cylinders/heads/sectors] \\\n"
 		"%*s[-0123 | -E num "
-		"[-s id/start/size[/bootmenu]]] \\\n"
+		"[-s [id][/[start][/[size][/bootmenu \\\n"
 		"%*s[-t disktab] [-T disktype] \\\n"
 		"%*s[-c bootcode] "
 		"[-r|-w file] [device]\n"



CVS commit: src/sys/arch/ia64/ia64

2014-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  3 17:07:07 UTC 2014

Modified Files:
src/sys/arch/ia64/ia64: consinit.c

Log Message:
Make GENERIC compilable


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/ia64/consinit.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/ia64/ia64/consinit.c
diff -u src/sys/arch/ia64/ia64/consinit.c:1.3 src/sys/arch/ia64/ia64/consinit.c:1.4
--- src/sys/arch/ia64/ia64/consinit.c:1.3	Wed Mar 12 08:36:59 2014
+++ src/sys/arch/ia64/ia64/consinit.c	Thu Apr  3 17:07:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: consinit.c,v 1.3 2014/03/12 08:36:59 martin Exp $	*/
+/*	$NetBSD: consinit.c,v 1.4 2014/04/03 17:07:07 martin Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2014/03/12 08:36:59 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.4 2014/04/03 17:07:07 martin Exp $");
 
 #include 
 #include 
@@ -123,7 +123,7 @@ static void
 pcdp_cninit(struct consdev *cn)
 {
 	struct dig64_hcdp_table *tbl;
-#if NVGA > 0
+#if NVGA > 0 || NCOM > 0
 	union dev_desc *desc;
 #endif
 	uint64_t hcdp;
@@ -137,12 +137,13 @@ pcdp_cninit(struct consdev *cn)
 	n = 0;
 	m = tbl->length - sizeof(struct dig64_hcdp_table);
 	while (n < m) {
-#if NVGA > 0
+#if NVGA > 0 || NCOM > 0
 		desc = (union dev_desc *)((char *)tbl->entry + n);
+#endif
 
 /* not yet... */
 /* Our VGA is Framebuffer? */
-
+#if NVGA > 0
 		if (cn->cn_pri == CN_NORMAL &&
 		desc->type ==
 			(DIG64_ENTRYTYPE_VGA | DIG64_ENTRYTYPE_OUTONLY)) {



CVS commit: src/sys/arch/ia64/ia64

2014-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  3 17:05:58 UTC 2014

Modified Files:
src/sys/arch/ia64/ia64: db_interface.c

Log Message:
Fix snprintf fallout


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/ia64/db_interface.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/ia64/ia64/db_interface.c
diff -u src/sys/arch/ia64/ia64/db_interface.c:1.7 src/sys/arch/ia64/ia64/db_interface.c:1.8
--- src/sys/arch/ia64/ia64/db_interface.c:1.7	Wed Jun  9 02:48:52 2010
+++ src/sys/arch/ia64/ia64/db_interface.c	Thu Apr  3 17:05:58 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.7 2010/06/09 02:48:52 mrg Exp $ */
+/* $NetBSD: db_interface.c,v 1.8 2014/04/03 17:05:58 martin Exp $ */
 
 /*-
  * Copyright (c) 2003-2005 Marcel Moolenaar
@@ -80,7 +80,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.7 2010/06/09 02:48:52 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.8 2014/04/03 17:05:58 martin Exp $");
 
 #include 
 #include 
@@ -458,17 +458,17 @@ db_disasm(db_addr_t loc, bool altfmt)
 
 		/* Predicate. */
 		if (i->i_oper[0].o_value != 0) {
-			asm_operand(i->i_oper+0, buf, loc);
+			asm_operand(i->i_oper+0, buf, sizeof(buf), loc);
 			db_printf("(%s) ", buf);
 		} else
 			db_printf("   ");
 
 		/* Mnemonic & completers. */
-		asm_mnemonic(i->i_op, buf);
+		asm_mnemonic(i->i_op, buf, sizeof(buf));
 		db_printf(buf);
 		n = 0;
 		while (n < i->i_ncmpltrs) {
-			asm_completer(i->i_cmpltr + n, buf);
+			asm_completer(i->i_cmpltr + n, buf, sizeof(buf));
 			db_printf(buf);
 			n++;
 		}
@@ -484,7 +484,7 @@ db_disasm(db_addr_t loc, bool altfmt)
 else
 	db_printf(",");
 			}
-			asm_operand(i->i_oper + n, buf, loc);
+			asm_operand(i->i_oper + n, buf, sizeof(buf), loc);
 			db_printf(buf);
 			n++;
 		}



CVS commit: src/sys/arch/ia64/ia64

2014-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  3 17:04:46 UTC 2014

Modified Files:
src/sys/arch/ia64/ia64: cpu.c

Log Message:
Add missing include


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ia64/ia64/cpu.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/ia64/ia64/cpu.c
diff -u src/sys/arch/ia64/ia64/cpu.c:1.13 src/sys/arch/ia64/ia64/cpu.c:1.14
--- src/sys/arch/ia64/ia64/cpu.c:1.13	Mon Mar 24 20:06:32 2014
+++ src/sys/arch/ia64/ia64/cpu.c	Thu Apr  3 17:04:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.13 2014/03/24 20:06:32 christos Exp $	*/
+/*	$NetBSD: cpu.c,v 1.14 2014/04/03 17:04:46 martin Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,9 +30,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.13 2014/03/24 20:06:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2014/04/03 17:04:46 martin Exp $");
 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/ia64/disasm

2014-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  3 17:02:34 UTC 2014

Modified Files:
src/sys/arch/ia64/disasm: disasm.h disasm_format.c

Log Message:
Fix snprintf fallout


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/disasm/disasm.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/disasm/disasm_format.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/ia64/disasm/disasm.h
diff -u src/sys/arch/ia64/disasm/disasm.h:1.1 src/sys/arch/ia64/disasm/disasm.h:1.2
--- src/sys/arch/ia64/disasm/disasm.h:1.1	Fri Apr  7 14:21:18 2006
+++ src/sys/arch/ia64/disasm/disasm.h	Thu Apr  3 17:02:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: disasm.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
+/*	$NetBSD: disasm.h,v 1.2 2014/04/03 17:02:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 Marcel Moolenaar
@@ -316,9 +316,9 @@ int asm_extract(enum asm_op, enum asm_fm
 
 int asm_decode(uint64_t, struct asm_bundle *);
 
-void asm_completer(const struct asm_cmpltr *, char *);
-void asm_mnemonic(const enum asm_op, char *);
-void asm_operand(const struct asm_oper *, char *, uint64_t);
+void asm_completer(const struct asm_cmpltr *, char *, size_t);
+void asm_mnemonic(const enum asm_op, char *, size_t);
+void asm_operand(const struct asm_oper *, char *, size_t, uint64_t);
 void asm_print_bundle(const struct asm_bundle *, uint64_t);
 void asm_print_inst(const struct asm_bundle *, int, uint64_t);
 

Index: src/sys/arch/ia64/disasm/disasm_format.c
diff -u src/sys/arch/ia64/disasm/disasm_format.c:1.3 src/sys/arch/ia64/disasm/disasm_format.c:1.4
--- src/sys/arch/ia64/disasm/disasm_format.c:1.3	Thu Mar 27 18:22:56 2014
+++ src/sys/arch/ia64/disasm/disasm_format.c	Thu Apr  3 17:02:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: disasm_format.c,v 1.3 2014/03/27 18:22:56 christos Exp $	*/
+/*	$NetBSD: disasm_format.c,v 1.4 2014/04/03 17:02:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 Marcel Moolenaar
@@ -287,7 +287,7 @@ asm_operand(const struct asm_oper *o, ch
 	case 12: l = strlcpy(buf, "sp", buflen); break;
 	case 13: l = strlcpy(buf, "tp", buflen); break;
 	default:
-	l += snprintf(buf, buflen, "r%d", (int)o->o_value);
+	l = snprintf(buf, buflen, "r%d", (int)o->o_value);
 	if (l > buflen)
 		l = buflen;
 	break;



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

2014-04-03 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Thu Apr  3 16:22:20 UTC 2014

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

Log Message:
Add support for EABI syscalls.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/arm/linux_syscall.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/arm/linux_syscall.c
diff -u src/sys/arch/arm/arm/linux_syscall.c:1.25 src/sys/arch/arm/arm/linux_syscall.c:1.26
--- src/sys/arch/arm/arm/linux_syscall.c:1.25	Sun Aug 18 07:01:45 2013
+++ src/sys/arch/arm/arm/linux_syscall.c	Thu Apr  3 16:22:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_syscall.c,v 1.25 2013/08/18 07:01:45 matt Exp $	*/
+/*	$NetBSD: linux_syscall.c,v 1.26 2014/04/03 16:22:20 rjs Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.25 2013/08/18 07:01:45 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.26 2014/04/03 16:22:20 rjs Exp $");
 
 #include 
 #include 
@@ -90,6 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscal
 
 /* ARMLinux has some system calls of its very own. */
 #define LINUX_ARM_NR_BASE	0x9f
+#define LINUX_EARM_NR_BASE	0x0f
 #define LINUX_SYS_ARMBASE	0x000180 /* Must agree with syscalls.master */
 
 void linux_syscall_intern(struct proc *);
@@ -115,9 +116,15 @@ linux_syscall_plain(trapframe_t *frame, 
 	register_t *args, rval[2];
 
 	code = insn & 0x00ff;
-	/* Remap ARM-specific syscalls onto the end of the standard range. */
-	if (code > LINUX_ARM_NR_BASE)
-		code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+	if (code == 0) {	/* EABI */
+		code = frame->tf_r7;
+		if (code > LINUX_EARM_NR_BASE)
+			code = code - LINUX_EARM_NR_BASE + LINUX_SYS_ARMBASE;
+	} else {
+		/* Remap ARM-specific syscalls onto the end of the standard range. */
+		if (code > LINUX_ARM_NR_BASE)
+			code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+	}
 	code &= LINUX_SYS_NSYSENT - 1;
 
 	/* Linux passes all arguments in order in registers, which is nice. */
@@ -160,9 +167,15 @@ linux_syscall_fancy(trapframe_t *frame, 
 	register_t *args, rval[2];
 
 	code = insn & 0x00ff;
-	/* Remap ARM-specific syscalls onto the end of the standard range. */
-	if (code > LINUX_ARM_NR_BASE)
-		code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+	if (code == 0) {	/* EABI */
+		code = frame->tf_r7;
+		if (code > LINUX_EARM_NR_BASE)
+			code = code - LINUX_EARM_NR_BASE + LINUX_SYS_ARMBASE;
+	} else {
+		/* Remap ARM-specific syscalls onto the end of the standard range. */
+		if (code > LINUX_ARM_NR_BASE)
+			code = code - LINUX_ARM_NR_BASE + LINUX_SYS_ARMBASE;
+	}
 	code &= LINUX_SYS_NSYSENT - 1;
 
 	/* Linux passes all arguments in order in registers, which is nice. */



CVS commit: src/sys/arch/xen/x86

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:53:05 UTC 2014

Modified Files:
src/sys/arch/xen/x86: autoconf.c

Log Message:
Change findroot() to cpu_bootconf() since this is what it does. Remove bogus
comment.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/xen/x86/autoconf.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/xen/x86/autoconf.c
diff -u src/sys/arch/xen/x86/autoconf.c:1.16 src/sys/arch/xen/x86/autoconf.c:1.17
--- src/sys/arch/xen/x86/autoconf.c:1.16	Wed Oct  3 14:58:33 2012
+++ src/sys/arch/xen/x86/autoconf.c	Thu Apr  3 11:53:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.16 2012/10/03 18:58:33 dsl Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.17 2014/04/03 15:53:05 christos Exp $	*/
 /*	NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp 	*/
 
 /*-
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.16 2012/10/03 18:58:33 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2014/04/03 15:53:05 christos Exp $");
 
 #include "opt_xen.h"
 #include "opt_compat_oldboot.h"
@@ -86,7 +86,6 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 
-static void findroot(void);
 static int is_valid_disk(device_t);
 
 struct disklist *x86_alldisks;
@@ -143,7 +142,7 @@ cpu_configure(void)
 void
 cpu_rootconf(void)
 {
-	findroot();
+	cpu_bootconf();
 
 	printf("boot device: %s\n",
 	booted_device ? device_xname(booted_device) : "");
@@ -153,11 +152,9 @@ cpu_rootconf(void)
 
 /*
  * Attempt to find the device from which we were booted.
- * If we can do so, and not instructed not to do so,
- * change rootdev to correspond to the load device.
  */
 void
-findroot(void)
+cpu_bootconf(void)
 {
 	device_t dv;
 	deviter_t di;



CVS commit: src/share/man/man9

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 15:39:10 UTC 2014

Modified Files:
src/share/man/man9: iic.9

Log Message:
Correct return type of iic_release_bus.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man9/iic.9

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

Modified files:

Index: src/share/man/man9/iic.9
diff -u src/share/man/man9/iic.9:1.9 src/share/man/man9/iic.9:1.10
--- src/share/man/man9/iic.9:1.9	Tue Mar 18 18:20:40 2014
+++ src/share/man/man9/iic.9	Thu Apr  3 15:39:10 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.9,v 1.9 2014/03/18 18:20:40 riastradh Exp $
+.\"	$NetBSD: iic.9,v 1.10 2014/04/03 15:39:10 riastradh Exp $
 .\"	$OpenBSD: iic.9,v 1.3 2004/08/24 05:48:22 david Exp $
 .\"
 .\" Copyright (c) 2003 Wasabi Systems, Inc.
@@ -52,7 +52,7 @@
 .Fa "i2c_tag_t ic"
 .Fa "int flags"
 .Fc
-.Ft int
+.Ft void
 .Fo iic_release_bus
 .Fa "i2c_tag_t ic"
 .Fa "int flags"



CVS commit: src/doc

2014-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  3 15:35:55 UTC 2014

Modified Files:
src/doc: 3RDPARTY

Log Message:
mention our third in-tree gcc version as well.


To generate a diff of this commit:
cvs rdiff -u -r1.1103 -r1.1104 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1103 src/doc/3RDPARTY:1.1104
--- src/doc/3RDPARTY:1.1103	Thu Apr  3 15:32:21 2014
+++ src/doc/3RDPARTY	Thu Apr  3 15:35:55 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1103 2014/04/03 15:32:21 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1104 2014/04/03 15:35:55 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -368,7 +368,7 @@ Notes:
 There is a flex2netbsd script to help newer imports.
 
 Package:	gcc
-Version:	4.1.3-20080831/4.5.4
+Version:	4.1.3-20080831/4.5.4/4.8.2r206687
 Current Vers:	4.8.2
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gcc/



CVS commit: src/doc

2014-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  3 15:32:21 UTC 2014

Modified Files:
src/doc: 3RDPARTY

Log Message:
file-5.18 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1102 -r1.1103 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1102 src/doc/3RDPARTY:1.1103
--- src/doc/3RDPARTY:1.1102	Fri Mar 28 08:15:48 2014
+++ src/doc/3RDPARTY	Thu Apr  3 15:32:21 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1102 2014/03/28 08:15:48 apb Exp $
+#	$NetBSD: 3RDPARTY,v 1.1103 2014/04/03 15:32:21 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -343,7 +343,7 @@ Please use "expat" as the vendor tag for
 
 Package:	file
 Version:	5.16
-Current Vers:	5.16
+Current Vers:	5.18
 Maintainer:	Christos Zoulas 
 Archive Site:	ftp://ftp.astron.com/pub/file/
 Home Page:	http://www.darwinsys.com/file/



CVS commit: src/sys/dev/raidframe

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:30:52 UTC 2014

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
Fix bugs in raidframe + wedge and root interaction:
1. Don't call cpu_rootconf() just to setup booted_device. Calling cpu_rootconf()
   multiple times can have nasty side effects (aside from printing root device
   twice). Instead for those who have it, call cpu_bootconf() which is intended
   just for that.
2. If the raid component devices are wedges, then matching the booted_device
   against the wedges will never work; match instead on the wedges parent.
   XXX: perhaps should keep looking if the parent is a wedge too?


To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.306 src/sys/dev/raidframe/rf_netbsdkintf.c:1.307
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.306	Tue Apr  1 22:17:01 2014
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Thu Apr  3 11:30:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.306 2014/04/02 02:17:01 christos Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.307 2014/04/03 15:30:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.306 2014/04/02 02:17:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.307 2014/04/03 15:30:52 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -431,6 +431,16 @@ rf_autoconfig(device_t self)
 	/* XXX This code can only be run once. */
 	raidautoconfigdone = true;
 
+#ifdef __HAVE_CPU_BOOTCONF
+	/*
+	 * 0. find the boot device if needed first so we can use it later
+	 * this needs to be done before we autoconfigure any raid sets,
+	 * because if we use wedges we are not going to be able to open
+	 * the boot device later
+	 */
+	if (booted_device == NULL)
+		cpu_bootconf();
+#endif
 	/* 1. locate all RAID components on the system */
 	aprint_debug("Searching for RAID components...\n");
 	ac_list = rf_find_raid_components();
@@ -448,13 +458,19 @@ rf_autoconfig(device_t self)
 }
 
 static int
-rf_containsboot(RF_Raid_t *r, device_t dv) {
-	const char *bootname = device_xname(dv);
+rf_containsboot(RF_Raid_t *r, device_t bdv) {
+	const char *bootname = device_xname(bdv);
 	size_t len = strlen(bootname);
 
 	for (int col = 0; col < r->numCol; col++) {
-		char *devname = r->Disks[col].devname;
+		const char *devname = r->Disks[col].devname;
 		devname += sizeof("/dev/") - 1;
+		if (strncmp(devname, "dk", 2) == 0) {
+			const char *parent =
+			dkwedge_get_parent_name(r->Disks[col].dev);
+			if (parent != NULL)
+devname = parent;
+		}
 		if (strncmp(devname, bootname, len) == 0) {
 			struct raid_softc *sc = r->softc;
 			aprint_debug("raid%d includes boot device %s\n",
@@ -522,8 +538,6 @@ rf_buildroothack(RF_ConfigSet_t *config_
 		} else
 			candidate_root = rsc->sc_dev;
 #ifndef RAIDFRAME_FORCE_ROOT
-		if (booted_device == NULL)
-			cpu_rootconf();
 		if (booted_device == NULL
 		|| rf_containsboot(&rsc->sc_r, booted_device))
 #endif
@@ -536,9 +550,6 @@ rf_buildroothack(RF_ConfigSet_t *config_
 		 * booted_device and will ask the user if nothing was
 		 * hardwired in the kernel config file 
 		 */
-
-		if (booted_device == NULL)
-			cpu_rootconf();
 		if (booted_device == NULL) 
 			return;
 



CVS commit: src/sys

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:24:20 UTC 2014

Modified Files:
src/sys/dev/dkwedge: dk.c
src/sys/sys: disk.h

Log Message:
add dkwedge_get_parent_name().


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/dkwedge/dk.c
cvs rdiff -u -r1.59 -r1.60 src/sys/sys/disk.h

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

Modified files:

Index: src/sys/dev/dkwedge/dk.c
diff -u src/sys/dev/dkwedge/dk.c:1.68 src/sys/dev/dkwedge/dk.c:1.69
--- src/sys/dev/dkwedge/dk.c:1.68	Sun Mar 16 01:20:27 2014
+++ src/sys/dev/dkwedge/dk.c	Thu Apr  3 11:24:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dk.c,v 1.68 2014/03/16 05:20:27 dholland Exp $	*/
+/*	$NetBSD: dk.c,v 1.69 2014/04/03 15:24:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.68 2014/03/16 05:20:27 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.69 2014/04/03 15:24:20 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -1461,3 +1461,16 @@ dkwedge_find_partition(device_t parent, 
 	return wedge;
 }
 
+const char *
+dkwedge_get_parent_name(dev_t dev)
+{
+	/* XXX: perhaps do this in lookup? */
+	int bmaj = bdevsw_lookup_major(&dk_bdevsw);
+	int cmaj = cdevsw_lookup_major(&dk_cdevsw);
+	if (major(dev) != bmaj && major(dev) != cmaj)
+		return NULL;
+	struct dkwedge_softc *sc = dkwedge_lookup(dev);
+	if (sc == NULL)
+		return NULL;
+	return sc->sc_parent->dk_name;
+}

Index: src/sys/sys/disk.h
diff -u src/sys/sys/disk.h:1.59 src/sys/sys/disk.h:1.60
--- src/sys/sys/disk.h:1.59	Wed May 29 11:22:19 2013
+++ src/sys/sys/disk.h	Thu Apr  3 11:24:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: disk.h,v 1.59 2013/05/29 15:22:19 martin Exp $	*/
+/*	$NetBSD: disk.h,v 1.60 2014/04/03 15:24:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -534,6 +534,7 @@ int	dkwedge_list(struct disk *, struct d
 void	dkwedge_discover(struct disk *);
 int	dkwedge_read(struct disk *, struct vnode *, daddr_t, void *, size_t);
 device_t dkwedge_find_by_wname(const char *);
+const char *dkwedge_get_parent_name(dev_t);
 void	dkwedge_print_wnames(void);
 device_t dkwedge_find_partition(device_t, daddr_t, uint64_t);
 #endif



CVS commit: src/sys/sys

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:22:57 UTC 2014

Modified Files:
src/sys/sys: systm.h

Log Message:
add cpu_bootconf()


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/sys/systm.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/sys/systm.h
diff -u src/sys/sys/systm.h:1.262 src/sys/sys/systm.h:1.263
--- src/sys/sys/systm.h:1.262	Wed Mar 26 14:03:47 2014
+++ src/sys/sys/systm.h	Thu Apr  3 11:22:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.262 2014/03/26 18:03:47 christos Exp $	*/
+/*	$NetBSD: systm.h,v 1.263 2014/04/03 15:22:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -403,6 +403,7 @@ void	consinit(void);
 
 void	cpu_startup(void);
 void	cpu_configure(void);
+void	cpu_bootconf(void);
 void	cpu_rootconf(void);
 void	cpu_dumpconf(void);
 



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

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:22:19 UTC 2014

Modified Files:
src/sys/arch/i386/include: types.h

Log Message:
we have cpu_bootconf()


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/i386/include/types.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/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.76 src/sys/arch/i386/include/types.h:1.77
--- src/sys/arch/i386/include/types.h:1.76	Sat Nov 30 20:05:16 2013
+++ src/sys/arch/i386/include/types.h	Thu Apr  3 11:22:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.76 2013/12/01 01:05:16 christos Exp $	*/
+/*	$NetBSD: types.h,v 1.77 2014/04/03 15:22:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -104,6 +104,7 @@ typedef	volatile unsigned char		__cpu_si
 #define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_CPU_DATA_FIRST
 #define	__HAVE_CPU_COUNTER
+#define	__HAVE_CPU_BOOTCONF
 #define	__HAVE_MD_CPU_OFFLINE
 #define	__HAVE_SYSCALL_INTERN
 #define	__HAVE_MINIMAL_EMUL



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

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:22:36 UTC 2014

Modified Files:
src/sys/arch/amd64/include: types.h

Log Message:
we have cpu_bootconf()


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amd64/include/types.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/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.44 src/sys/arch/amd64/include/types.h:1.45
--- src/sys/arch/amd64/include/types.h:1.44	Thu Mar 20 16:45:32 2014
+++ src/sys/arch/amd64/include/types.h	Thu Apr  3 11:22:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.44 2014/03/20 20:45:32 christos Exp $	*/
+/*	$NetBSD: types.h,v 1.45 2014/04/03 15:22:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -81,6 +81,7 @@ typedef	volatile unsigned char		__cpu_si
 #define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_CPU_COUNTER
 #define	__HAVE_CPU_DATA_FIRST
+#define __HAVE_CPU_BOOTCONF
 #define	__HAVE_MD_CPU_OFFLINE
 #define	__HAVE_SYSCALL_INTERN
 #define	__HAVE_MINIMAL_EMUL



CVS commit: src/sys/arch/x86/x86

2014-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  3 15:21:52 UTC 2014

Modified Files:
src/sys/arch/x86/x86: x86_autoconf.c

Log Message:
- prevent matchbiosdisks from being called twice. This could happen
  via raid autoconf calling cpu_rootconf() once and then init main
  calling cpu_rootconf() a second time.
- separate booted_device setup into cpu_bootconf(), a new optional function.
  This function can be called before raid autoconfiguration to determine
  the booted device. This needs to be done before raid autoconfiguration,
  otherwise if we are using wedges, the raid will autoconfigure wedges,
  and we'll be unable to open the underlying devices later to determine
  the booted device.
- fix a debugging comment.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/x86/x86/x86_autoconf.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/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.69 src/sys/arch/x86/x86/x86_autoconf.c:1.70
--- src/sys/arch/x86/x86/x86_autoconf.c:1.69	Tue Apr  1 22:14:08 2014
+++ src/sys/arch/x86/x86/x86_autoconf.c	Thu Apr  3 11:21:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $");
 
 #include 
 #include 
@@ -101,6 +101,8 @@ matchbiosdisks(void)
 	int dklist_size;
 	int numbig;
 
+	if (x86_ndisks)
+		return;
 	big = lookup_bootinfo(BTINFO_BIOSGEOM);
 
 	numbig = big ? big->num : 0;
@@ -257,7 +259,7 @@ match_bootdisk(device_t dv, struct btinf
 	int found = 0;
 
 	if (device_is_a(dv, "dk")) {
-		DPRINTF(("%s: not dk %s\n", __func__, device_xname(dv)));
+		DPRINTF(("%s: dk %s\n", __func__, device_xname(dv)));
 		return 0;
 	}
 
@@ -509,11 +511,16 @@ findroot(void)
 }
 
 void
-cpu_rootconf(void)
+cpu_bootconf(void)
 {
-
 	findroot();
 	matchbiosdisks();
+}
+
+void
+cpu_rootconf(void)
+{
+	cpu_bootconf();
 
 	aprint_normal("boot device: %s\n",
 	booted_device ? device_xname(booted_device) : "");



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 15:16:42 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_sdvo.c intel_tv.c

Log Message:
Remove ifdef for const fix.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.2 src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c	Thu Apr  3 15:16:42 2014
@@ -419,11 +419,7 @@ static void intel_sdvo_debug_write(struc
 	DRM_DEBUG_KMS("%s: W: %02X ",
 SDVO_NAME(intel_sdvo), cmd);
 	for (i = 0; i < args_len; i++)
-#ifdef __NetBSD__		/* XXX const */
 		DRM_LOG_KMS("%02X ", ((const u8 *)args)[i]);
-#else
-		DRM_LOG_KMS("%02X ", ((u8 *)args)[i]);
-#endif
 	for (; i < 8; i++)
 		DRM_LOG_KMS("   ");
 	for (i = 0; i < ARRAY_SIZE(sdvo_cmd_names); i++) {
@@ -473,11 +469,7 @@ static bool intel_sdvo_write_cmd(struct 
 		msgs[i].len = 2;
 		msgs[i].buf = buf + 2 *i;
 		buf[2*i + 0] = SDVO_I2C_ARG_0 - i;
-#ifdef __NetBSD__		/* XXX const */
 		buf[2*i + 1] = ((const u8*)args)[i];
-#else
-		buf[2*i + 1] = ((u8*)args)[i];
-#endif
 	}
 	msgs[i].addr = intel_sdvo->slave_addr;
 	msgs[i].flags = 0;
Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c:1.2 src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c	Thu Apr  3 15:16:42 2014
@@ -1555,11 +1555,7 @@ intel_tv_init(struct drm_device *dev)
 	struct intel_encoder *intel_encoder;
 	struct intel_connector *intel_connector;
 	u32 tv_dac_on, tv_dac_off, save_tv_dac;
-#ifdef __NetBSD__		/* XXX const */
 	const char *tv_format_names[ARRAY_SIZE(tv_modes)];
-#else
-	char *tv_format_names[ARRAY_SIZE(tv_modes)];
-#endif
 	int i, initial_mode = 0;
 
 	if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED)
@@ -1655,11 +1651,7 @@ intel_tv_init(struct drm_device *dev)
 
 	/* Create TV properties then attach current values */
 	for (i = 0; i < ARRAY_SIZE(tv_modes); i++)
-#ifdef __NetBSD__		/* XXX const */
 		tv_format_names[i] = (const char *)tv_modes[i].name;
-#else
-		tv_format_names[i] = (char *)tv_modes[i].name;
-#endif
 	drm_mode_create_tv_properties(dev,
   ARRAY_SIZE(tv_modes),
   tv_format_names);



CVS commit: src/sys/external/bsd/drm2/drm

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 15:16:18 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/drm: drm_module.c

Log Message:
Need  for AB_DEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/drm/drm_module.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_module.c
diff -u src/sys/external/bsd/drm2/drm/drm_module.c:1.3 src/sys/external/bsd/drm2/drm/drm_module.c:1.4
--- src/sys/external/bsd/drm2/drm/drm_module.c:1.3	Thu Apr  3 14:15:05 2014
+++ src/sys/external/bsd/drm2/drm/drm_module.c	Thu Apr  3 15:16:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_module.c,v 1.3 2014/04/03 14:15:05 riastradh Exp $	*/
+/*	$NetBSD: drm_module.c,v 1.4 2014/04/03 15:16:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,11 +30,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.3 2014/04/03 14:15:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.4 2014/04/03 15:16:18 riastradh Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 14:55:53 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_mm.h

Log Message:
Nix accidental whitespace to reduce diff from Linux.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/include/drm/drm_mm.h

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_mm.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_mm.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drm_mm.h:1.3
--- src/sys/external/bsd/drm2/dist/include/drm/drm_mm.h:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_mm.h	Thu Apr  3 14:55:53 2014
@@ -90,7 +90,6 @@ static inline bool drm_mm_initialized(st
 {
 	return mm->hole_stack.next;
 }
-
 #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
 		&(mm)->head_node.node_list, \
 		node_list)



CVS commit: src/sys/uvm/pmap

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 14:46:25 UTC 2014

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c pmap_tlb.h

Log Message:
Change cpu_tlb_info definition based on PMAP_TLB_MAX instead of MULTIPROCESSOR


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/uvm/pmap/pmap_tlb.c
cvs rdiff -u -r1.5 -r1.6 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.7 src/sys/uvm/pmap/pmap_tlb.c:1.8
--- src/sys/uvm/pmap/pmap_tlb.c:1.7	Thu Apr  3 14:23:38 2014
+++ src/sys/uvm/pmap/pmap_tlb.c	Thu Apr  3 14:46:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.7 2014/04/03 14:23:38 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.8 2014/04/03 14:46:25 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.7 2014/04/03 14:23:38 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.8 2014/04/03 14:46:25 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -947,8 +947,8 @@ pmap_tlb_asid_release_all(struct pmap *p
 	KASSERT(pm != pmap_kernel());
 #if defined(MULTIPROCESSOR)
 	//KASSERT(!kcpuset_iszero(pm->pm_onproc)); // XXX
-	struct cpu_info * const ci __diagused = curcpu();
 #if PMAP_TLB_MAX > 1
+	struct cpu_info * const ci __diagused = curcpu();
 	for (u_int i = 0; !kcpuset_iszero(pm->pm_active); i++) {
 		KASSERT(i < pmap_ntlbs);
 		struct pmap_tlb_info * const ti = pmap_tlbs[i];

Index: src/sys/uvm/pmap/pmap_tlb.h
diff -u src/sys/uvm/pmap/pmap_tlb.h:1.5 src/sys/uvm/pmap/pmap_tlb.h:1.6
--- src/sys/uvm/pmap/pmap_tlb.h:1.5	Sun Mar 30 15:26:15 2014
+++ src/sys/uvm/pmap/pmap_tlb.h	Thu Apr  3 14:46:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.h,v 1.5 2014/03/30 15:26:15 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.h,v 1.6 2014/04/03 14:46:25 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -76,8 +76,12 @@
 
 #include 
 
-#if defined(MULTIPROCESSOR) && !defined(PMAP_TLB_MAX)
-#define PMAP_TLB_MAX		MAXCPUS
+#if !defined(PMAP_TLB_MAX)
+# if defined(MULTIPROCESSOR)
+#  define PMAP_TLB_MAX		MAXCPUS
+# else
+#  define PMAP_TLB_MAX		1
+# endif
 #endif
 
 /*
@@ -145,14 +149,14 @@ extern u_int pmap_ntlbs;
 #endif
 
 #ifndef cpu_set_tlb_info
-#define	cpu_set_tlb_info(ci, ti)	((void)((ci)->ci_tlb_info = (ti)))
+# define cpu_set_tlb_info(ci, ti)	((void)((ci)->ci_tlb_info = (ti)))
 #endif
 #ifndef cpu_tlb_info
-#ifdef MULTIPROCESSOR
-#define	cpu_tlb_info(ci)		((ci)->ci_tlb_info)
-#else
-#define	cpu_tlb_info(ci)		(&pmap_tlb0_info)
-#endif
+# if PMAP_TLB_MAX > 1
+#  define cpu_tlb_info(ci)		((ci)->ci_tlb_info)
+# else
+#  define cpu_tlb_info(ci)		(&pmap_tlb0_info)
+# endif
 #endif
 
 #ifdef MULTIPROCESSOR



CVS commit: src/sys/external/bsd/drm2/i915drm

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 14:45:44 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/i915drm: i915_pci.c

Log Message:
Make i915drmkms grab the console by default.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/i915drm/i915_pci.c

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

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/i915_pci.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_pci.c:1.2 src/sys/external/bsd/drm2/i915drm/i915_pci.c:1.3
--- src/sys/external/bsd/drm2/i915drm/i915_pci.c:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/i915drm/i915_pci.c	Thu Apr  3 14:45:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_pci.c,v 1.2 2014/03/18 18:20:42 riastradh Exp $	*/
+/*	$NetBSD: i915_pci.c,v 1.3 2014/04/03 14:45:44 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.2 2014/03/18 18:20:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.3 2014/04/03 14:45:44 riastradh Exp $");
 
 #include 
 #ifndef _MODULE
@@ -416,7 +416,7 @@ i915drm_fb_probe(struct drm_fb_helper *f
 		goto fail3;
 	}
 
-	prop_dictionary_set_bool(dict, "is_console", 0); /* XXX */
+	prop_dictionary_set_bool(dict, "is_console", 1); /* XXX */
 	prop_dictionary_set_uint32(dict, "width", mode_cmd.width);
 	prop_dictionary_set_uint32(dict, "height", mode_cmd.height);
 	prop_dictionary_set_uint8(dict, "depth", sizes->surface_bpp);



CVS commit: src/sys/uvm/pmap

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 14:23:38 UTC 2014

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
Compare ASIDs, not pmaps.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.6 src/sys/uvm/pmap/pmap_tlb.c:1.7
--- src/sys/uvm/pmap/pmap_tlb.c:1.6	Thu Apr  3 13:54:59 2014
+++ src/sys/uvm/pmap/pmap_tlb.c	Thu Apr  3 14:23:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.6 2014/04/03 13:54:59 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.7 2014/04/03 14:23:38 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.6 2014/04/03 13:54:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.7 2014/04/03 14:23:38 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -993,7 +993,7 @@ pmap_tlb_asid_release_all(struct pmap *p
 	struct pmap_asid_info * const pai = PMAP_PAI(pm, ti);
 	TLBINFO_LOCK(ti);
 	if (pai->pai_asid > KERNEL_PID) {
-		if (curcpu()->ci_pmap_cur == pm) {
+		if (curcpu()->ci_pmap_asid_cur == pai->pai_asid) {
 			tlb_invalidate_asids(pai->pai_asid, pai->pai_asid);
 		} else {
 			pmap_pai_reset(ti, pai, pm);



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

2014-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  3 14:15:05 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_stub.c
src/sys/external/bsd/drm2/drm: drm_module.c

Log Message:
Enable drm debug output iff boothowto has AB_DEBUG set.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/drm_stub.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/drm/drm_module.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_stub.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_stub.c:1.2 src/sys/external/bsd/drm2/dist/drm/drm_stub.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/drm_stub.c:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/dist/drm/drm_stub.c	Thu Apr  3 14:15:05 2014
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-unsigned int drm_debug = 0xf;	/* 1 to enable debug output */
+unsigned int drm_debug = 0;	/* 1 to enable debug output */
 EXPORT_SYMBOL(drm_debug);
 
 unsigned int drm_vblank_offdelay = 5000;/* Default to 5000 msecs. */

Index: src/sys/external/bsd/drm2/drm/drm_module.c
diff -u src/sys/external/bsd/drm2/drm/drm_module.c:1.2 src/sys/external/bsd/drm2/drm/drm_module.c:1.3
--- src/sys/external/bsd/drm2/drm/drm_module.c:1.2	Tue Mar 18 18:20:42 2014
+++ src/sys/external/bsd/drm2/drm/drm_module.c	Thu Apr  3 14:15:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_module.c,v 1.2 2014/03/18 18:20:42 riastradh Exp $	*/
+/*	$NetBSD: drm_module.c,v 1.3 2014/04/03 14:15:05 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.2 2014/03/18 18:20:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.3 2014/04/03 14:15:05 riastradh Exp $");
 
 #include 
 #include 
@@ -85,6 +85,8 @@ drmkms_modcmd(modcmd_t cmd, void *arg __
 			goto init_fail1;
 		}
 #endif
+		if (ISSET(boothowto, AB_DEBUG))
+			drm_debug = ~(unsigned int)0;
 		return 0;
 
 #ifdef _MODULE



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

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 13:55:34 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/booke: pmap.h

Log Message:
Add PMAP_TLB_FLUSH_ASID_ON_RESET define


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/include/booke/pmap.h

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

Modified files:

Index: src/sys/arch/powerpc/include/booke/pmap.h
diff -u src/sys/arch/powerpc/include/booke/pmap.h:1.13 src/sys/arch/powerpc/include/booke/pmap.h:1.14
--- src/sys/arch/powerpc/include/booke/pmap.h:1.13	Tue Mar 18 18:20:41 2014
+++ src/sys/arch/powerpc/include/booke/pmap.h	Thu Apr  3 13:55:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.13 2014/03/18 18:20:41 riastradh Exp $	*/
+/*	$NetBSD: pmap.h,v 1.14 2014/04/03 13:55:34 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -72,6 +72,7 @@
 #define	PMAP_TLB_NUM_PIDS		256
 #define	PMAP_TLB_MAX			1
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xfeeddead)
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	false
 
 #define	pmap_phys_address(x)		(x)
 



CVS commit: src/sys/uvm/pmap

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 13:54:59 UTC 2014

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
Make this compile on booke again.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.5 src/sys/uvm/pmap/pmap_tlb.c:1.6
--- src/sys/uvm/pmap/pmap_tlb.c:1.5	Sun Mar 30 15:26:15 2014
+++ src/sys/uvm/pmap/pmap_tlb.c	Thu Apr  3 13:54:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.5 2014/03/30 15:26:15 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.6 2014/04/03 13:54:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.5 2014/03/30 15:26:15 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.6 2014/04/03 13:54:59 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -947,8 +947,8 @@ pmap_tlb_asid_release_all(struct pmap *p
 	KASSERT(pm != pmap_kernel());
 #if defined(MULTIPROCESSOR)
 	//KASSERT(!kcpuset_iszero(pm->pm_onproc)); // XXX
+	struct cpu_info * const ci __diagused = curcpu();
 #if PMAP_TLB_MAX > 1
-	struct cpu_info * const ci = curcpu();
 	for (u_int i = 0; !kcpuset_iszero(pm->pm_active); i++) {
 		KASSERT(i < pmap_ntlbs);
 		struct pmap_tlb_info * const ti = pmap_tlbs[i];