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

2015-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 08:51:33 UTC 2015

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

Log Message:
Fix XEN build - does XEN really want/need pmap_pv_track?


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/xen/conf/files.xen

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/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.137 src/sys/arch/xen/conf/files.xen:1.138
--- src/sys/arch/xen/conf/files.xen:1.137	Sun Jan  4 07:34:14 2015
+++ src/sys/arch/xen/conf/files.xen	Wed Nov 11 08:51:33 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.137 2015/01/04 07:34:14 uebayasi Exp $
+#	$NetBSD: files.xen,v 1.138 2015/11/11 08:51:33 skrll Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -80,6 +80,7 @@ file	arch/amd64/amd64/lock_stubs.S
 endif
 
 file	kern/subr_disk_mbr.c		disk
+file	uvm/pmap/pmap_pvt.c
 file	arch/x86/x86/convert_xmm_s87.c
 file	arch/x86/x86/db_memrw.c		ddb | kgdb
 file	arch/x86/x86/db_trace.c		ddb



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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 11:32:01 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_i2c.c

Log Message:
fix i2c periph clock, send repeat start for write-then-read xfers


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/nvidia/tegra_i2c.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/nvidia/tegra_i2c.c
diff -u src/sys/arch/arm/nvidia/tegra_i2c.c:1.5 src/sys/arch/arm/nvidia/tegra_i2c.c:1.6
--- src/sys/arch/arm/nvidia/tegra_i2c.c:1.5	Sun May 31 14:41:59 2015
+++ src/sys/arch/arm/nvidia/tegra_i2c.c	Wed Nov 11 11:32:01 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_i2c.c,v 1.5 2015/05/31 14:41:59 jmcneill Exp $ */
+/* $NetBSD: tegra_i2c.c,v 1.6 2015/11/11 11:32:01 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.5 2015/05/31 14:41:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.6 2015/11/11 11:32:01 jmcneill Exp $");
 
 #include 
 #include 
@@ -70,7 +70,7 @@ static int	tegra_i2c_exec(void *, i2c_op
 
 static int	tegra_i2c_wait(struct tegra_i2c_softc *, int);
 static int	tegra_i2c_write(struct tegra_i2c_softc *, i2c_addr_t,
-const uint8_t *, size_t, int);
+const uint8_t *, size_t, int, bool);
 static int	tegra_i2c_read(struct tegra_i2c_softc *, i2c_addr_t, uint8_t *,
 			   size_t, int);
 
@@ -125,7 +125,7 @@ tegra_i2c_attach(device_t parent, device
 	aprint_normal_dev(self, "interrupting on irq %d\n", loc->loc_intr);
 
 	/* Recommended setting for standard mode */
-	tegra_car_periph_i2c_enable(loc->loc_port, 2040);
+	tegra_car_periph_i2c_enable(loc->loc_port, 20400);
 
 	tegra_i2c_init(sc);
 
@@ -239,7 +239,7 @@ tegra_i2c_exec(void *priv, i2c_op_t op, 
 	}
 
 	if (cmdlen > 0) {
-		error = tegra_i2c_write(sc, addr, cmdbuf, cmdlen, flags);
+		error = tegra_i2c_write(sc, addr, cmdbuf, cmdlen, flags, true);
 		if (error) {
 			goto done;
 		}
@@ -248,7 +248,7 @@ tegra_i2c_exec(void *priv, i2c_op_t op, 
 	if (I2C_OP_READ_P(op)) {
 		error = tegra_i2c_read(sc, addr, buf, buflen, flags);
 	} else {
-		error = tegra_i2c_write(sc, addr, buf, buflen, flags);
+		error = tegra_i2c_write(sc, addr, buf, buflen, flags, false);
 	}
 
 done:
@@ -308,7 +308,7 @@ tegra_i2c_wait(struct tegra_i2c_softc *s
 
 static int
 tegra_i2c_write(struct tegra_i2c_softc *sc, i2c_addr_t addr, const uint8_t *buf,
-size_t buflen, int flags)
+size_t buflen, int flags, bool repeat_start)
 {
 	const uint8_t *p = buf;
 	size_t n, resid = buflen;
@@ -334,6 +334,7 @@ tegra_i2c_write(struct tegra_i2c_softc *
 	/* I2C Master Transmit Packet Header */
 	I2C_WRITE(sc, I2C_TX_PACKET_FIFO_REG,
 	I2C_IOPACKET_XMITHDR_IE |
+	(repeat_start ? I2C_IOPACKET_XMITHDR_REPEAT_STARTSTOP : 0) |
 	__SHIFTIN((addr << 1), I2C_IOPACKET_XMITHDR_SLAVE_ADDR));
 
 	/* Transmit data */



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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 12:49:10 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: soc_tegra124.c

Log Message:
make VDD_CPU programming a bit easier to understand, and while here, actually 
program it to 1.4V as intended instead of 1.39V


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nvidia/soc_tegra124.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/nvidia/soc_tegra124.c
diff -u src/sys/arch/arm/nvidia/soc_tegra124.c:1.6 src/sys/arch/arm/nvidia/soc_tegra124.c:1.7
--- src/sys/arch/arm/nvidia/soc_tegra124.c:1.6	Wed Jun  3 11:43:18 2015
+++ src/sys/arch/arm/nvidia/soc_tegra124.c	Wed Nov 11 12:49:10 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: soc_tegra124.c,v 1.6 2015/06/03 11:43:18 skrll Exp $ */
+/* $NetBSD: soc_tegra124.c,v 1.7 2015/11/11 12:49:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.6 2015/06/03 11:43:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.7 2015/11/11 12:49:10 jmcneill Exp $");
 
 #include 
 #include 
@@ -77,9 +77,12 @@ static struct tegra124_cpufreq_rate {
 void
 tegra124_cpuinit(void)
 {
-	/* Set VDD_CPU voltage to 1.4V */
 	tegra_car_periph_i2c_enable(4, 20400);
-	tegra_i2c_dvc_write(0x40, 0x4f00, 2);
+
+	/* Set VDD_CPU voltage to 1.4V */
+	const u_int target_mv = 1400;
+	const u_int sd0_vsel = (target_mv - 600) / 10;
+	tegra_i2c_dvc_write(0x40, (sd0_vsel << 8) | 00, 2);
 	delay(1);
 
 	tegra_cpufreq_register(_cpufreq_func);



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

2015-11-11 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Nov 11 14:04:12 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: JETSONTK1

Log Message:
enable cd(4) in JETSONTK1


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/JETSONTK1

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

Modified files:

Index: src/sys/arch/evbarm/conf/JETSONTK1
diff -u src/sys/arch/evbarm/conf/JETSONTK1:1.36 src/sys/arch/evbarm/conf/JETSONTK1:1.37
--- src/sys/arch/evbarm/conf/JETSONTK1:1.36	Wed Nov 11 12:35:40 2015
+++ src/sys/arch/evbarm/conf/JETSONTK1	Wed Nov 11 14:04:12 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: JETSONTK1,v 1.36 2015/11/11 12:35:40 jmcneill Exp $
+#	$NetBSD: JETSONTK1,v 1.37 2015/11/11 14:04:12 jakllsch Exp $
 #
 #	NVIDIA Jetson TK1 - Tegra K1 development kit
 #	https://developer.nvidia.com/jetson-tk1
@@ -112,7 +112,7 @@ ahcisata0	at tegraio?		# SATA
 atabus*		at ata?
 atapibus*	at atapi?
 wd*		at atabus? drive ?
-#cd*		at atapibus? drive ?
+cd*		at atapibus? drive ?
 
 # HDA
 hdaudio*	at tegraio?		# HDA



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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 16:41:52 UTC 2015

Removed Files:
src/sys/arch/arm/nvidia: tegra_genfb.c

Log Message:
not used by tegradrm


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/sys/arch/arm/nvidia/tegra_genfb.c

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



CVS commit: src/sys/arch/arm

2015-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 17:54:17 UTC 2015

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

Log Message:
Support pmap_pv_track and friends


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.142 -r1.143 src/sys/arch/arm/include/arm32/pmap.h

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.327 src/sys/arch/arm/arm32/pmap.c:1.328
--- src/sys/arch/arm/arm32/pmap.c:1.327	Fri Nov  6 08:44:35 2015
+++ src/sys/arch/arm/arm32/pmap.c	Wed Nov 11 17:54:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.327 2015/11/06 08:44:35 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.328 2015/11/11 17:54:17 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -213,10 +213,11 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.327 2015/11/06 08:44:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.328 2015/11/11 17:54:17 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -757,6 +758,7 @@ static void		pmap_flush_page(struct vm_p
 #endif
 #endif
 static void		pmap_page_remove(struct vm_page_md *, paddr_t);
+static void		pmap_pv_remove(paddr_t);
 
 #ifndef ARM_MMU_EXTENDED
 static void		pmap_init_l1(struct l1_ttable *, pd_entry_t *);
@@ -3118,15 +3120,20 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_
 		 * If the physical address is different, lookup the
 		 * vm_page.
 		 */
-		if (l2pte_pa(opte) != pa)
+		if (l2pte_pa(opte) != pa) {
+			KASSERT(!pmap_pv_tracked(pa));
 			opg = PHYS_TO_VM_PAGE(l2pte_pa(opte));
-		else
+		} else
 			opg = pg;
 	} else
 		opg = NULL;
 
-	if (pg) {
-		struct vm_page_md *md = VM_PAGE_TO_MD(pg);
+	struct pmap_page *pp = pmap_pv_tracked(pa);
+
+	if (pg || pp) {
+		KASSERT((pg != NULL) != (pp != NULL));
+		struct vm_page_md *md = (pg != NULL) ? VM_PAGE_TO_MD(pg) :
+		PMAP_PAGE_TO_MD(pp);
 
 		/*
 		 * This is to be a managed mapping.
@@ -3180,7 +3187,7 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_
 		} else
 			npte |= pte_l2_s_cache_mode;
 
-		if (pg == opg) {
+		if (pg != NULL && pg == opg) {
 			/*
 			 * We're changing the attrs of an existing mapping.
 			 */
@@ -3949,6 +3956,34 @@ pmap_extract(pmap_t pm, vaddr_t va, padd
 	return true;
 }
 
+/*
+ * pmap_pv_remove: remove an unmanaged pv-tracked page from all pmaps
+ *	that map it
+ */
+
+static void
+pmap_pv_remove(paddr_t pa)
+{
+	struct pmap_page *pp;
+
+	pp = pmap_pv_tracked(pa);
+	if (pp == NULL)
+		panic("pmap_pv_protect: page not pv-tracked: 0x%"PRIxPADDR,
+		pa);
+
+	struct vm_page_md *md = PMAP_PAGE_TO_MD(pp);
+	pmap_page_remove(md, pa);
+}
+
+void
+pmap_pv_protect(paddr_t pa, vm_prot_t prot)
+{
+
+	/* the only case is remove at the moment */
+	KASSERT(prot == VM_PROT_NONE);
+	pmap_pv_remove(pa);
+}
+
 void
 pmap_protect(pmap_t pm, vaddr_t sva, vaddr_t eva, vm_prot_t prot)
 {

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.130 src/sys/arch/arm/conf/files.arm:1.131
--- src/sys/arch/arm/conf/files.arm:1.130	Sat Feb  7 17:14:32 2015
+++ src/sys/arch/arm/conf/files.arm	Wed Nov 11 17:54:17 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.130 2015/02/07 17:14:32 jmcneill Exp $
+#	$NetBSD: files.arm,v 1.131 2015/11/11 17:54:17 skrll Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -213,6 +213,9 @@ file	arch/arm/arm32/cortex_pmc.c		cortex
 file	arch/arm/arm32/arm32_tlb.c		(cpu_armv7 | cpu_arm11) & (!arm11_compat_mmu & !cpu_pre_armv6)
 file	uvm/pmap/pmap_tlb.c			(cpu_armv7 | cpu_arm11) & (!arm11_compat_mmu & !cpu_pre_armv6)
 
+# generic pmap files for arm32 implementations
+file	uvm/pmap/pmap_pvt.c			arm32
+
 # arm32 library functions
 file	arch/arm/arm32/bcopy_page.S		arm32
 

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.142 src/sys/arch/arm/include/arm32/pmap.h:1.143
--- src/sys/arch/arm/include/arm32/pmap.h:1.142	Wed Sep  9 07:37:36 2015
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Nov 11 17:54:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.142 2015/09/09 07:37:36 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.143 2015/11/11 17:54:17 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -80,6 +80,7 @@
 #include 
 #include 
 #include 
+#include 
 #endif
 
 #ifdef ARM_MMU_EXTENDED
@@ -1066,11 +1067,11 @@ paddr_t	pmap_unmap_poolpage(vaddr_t);
 #define PMAP_UNMAP_POOLPAGE(va)	pmap_unmap_poolpage(va)
 #endif
 
-/*
- * pmap-specific data store in the vm_page structure.
- */
-#define	__HAVE_VM_PAGE_MD
-struct vm_page_md {
+#define __HAVE_PMAP_PV_TRACK	1
+
+void pmap_pv_protect(paddr_t, vm_prot_t);
+
+struct pmap_page {
 	SLIST_HEAD(,pv_entry) 

CVS commit: src/distrib/amiga/stand

2015-11-11 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 11 16:13:55 UTC 2015

Modified Files:
src/distrib/amiga/stand: Makefile loadbsd.uue
Removed Files:
src/distrib/amiga/stand: loadbsd-2.14.uue loadbsd-2.16.uue
loadbsd.gz.uue

Log Message:
Update loadbsd to 2.17, which can load ELF kernels.
Remove obsolete loadbsd binaries from installation/misc as they
have become useless (and can only load a.out kernels).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amiga/stand/Makefile
cvs rdiff -u -r1.1 -r0 src/distrib/amiga/stand/loadbsd-2.14.uue \
src/distrib/amiga/stand/loadbsd-2.16.uue \
src/distrib/amiga/stand/loadbsd.gz.uue
cvs rdiff -u -r1.1 -r1.2 src/distrib/amiga/stand/loadbsd.uue

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

Modified files:

Index: src/distrib/amiga/stand/Makefile
diff -u src/distrib/amiga/stand/Makefile:1.3 src/distrib/amiga/stand/Makefile:1.4
--- src/distrib/amiga/stand/Makefile:1.3	Mon Jun 23 02:16:53 2008
+++ src/distrib/amiga/stand/Makefile	Wed Nov 11 16:13:55 2015
@@ -1,10 +1,9 @@
-#   $NetBSD: Makefile,v 1.3 2008/06/23 02:16:53 matt Exp $
+#   $NetBSD: Makefile,v 1.4 2015/11/11 16:13:55 phx Exp $
 #
 
 MISC_FILES=	runbootblock.README
 UUDECODE_FILES=	device-streams.tar.gz \
-		loadbsd loadbsd-2.14 loadbsd-2.16 \
-		rdbinfo runbootblock xstreamtodev
+		loadbsd rdbinfo runbootblock xstreamtodev
 
 .include 
 .include 

Index: src/distrib/amiga/stand/loadbsd.uue
diff -u src/distrib/amiga/stand/loadbsd.uue:1.1 src/distrib/amiga/stand/loadbsd.uue:1.2
--- src/distrib/amiga/stand/loadbsd.uue:1.1	Wed Jun 16 02:31:27 2004
+++ src/distrib/amiga/stand/loadbsd.uue	Wed Nov 11 16:13:55 2015
@@ -1,203 +1,484 @@
 begin 755 loadbsd
-M```#\P`#``(```=["0```)/I```'>T[Z`.``
-M`0$'```=["0```)``"0``"\")"\`#"(O`!`@+P`4
-M(^\`"@!(>0```?A(>0```BPO`"\!+P).N0``'3C>_``4)!].=6EX96UU
-M;"YL:6)R87)Y`$-O;G1I;G5E`"YL:6)R87)Y('=A

CVS commit: src/sys/arch/amiga/stand/loadbsd

2015-11-11 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 11 16:08:52 UTC 2015

Modified Files:
src/sys/arch/amiga/stand/loadbsd: Makefile README

Log Message:
Build instructions and Makefile for loadbsd 3.0.
Submitted by Gunther Nikl.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README

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/amiga/stand/loadbsd/Makefile
diff -u src/sys/arch/amiga/stand/loadbsd/Makefile:1.2 src/sys/arch/amiga/stand/loadbsd/Makefile:1.3
--- src/sys/arch/amiga/stand/loadbsd/Makefile:1.2	Mon Jan  5 20:51:30 1998
+++ src/sys/arch/amiga/stand/loadbsd/Makefile	Wed Nov 11 16:08:52 2015
@@ -1,13 +1,13 @@
-#	$NetBSD: Makefile,v 1.2 1998/01/05 20:51:30 perry Exp $
+#	$NetBSD: Makefile,v 1.3 2015/11/11 16:08:52 phx Exp $
 #
-CC = gcc
-CFLAGS = -m68030 -O2 -D__progname=program_name -noixemul
+TARGET	= loadbsd
 
-OBJS = loadbsd.o getopt.o
-LIBS = -lamiga
+CC	= gcc
+CFLAGS	= -D_STANDALONE -I./include -O -fomit-frame-pointer -msmall-code
+LDFLAGS	= -noixemul
+LDLIBS	=
 
-loadbsd: $(OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o loadbsd $(OBJS) $(LIBS)
+OBJS	= loadbsd.o loadfile.o loadfile_aout.o loadfile_elf32.o getopt.o
 
-clean:
-	delete $(OBJS) loadbsd
+$(TARGET): $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
Index: src/sys/arch/amiga/stand/loadbsd/README
diff -u src/sys/arch/amiga/stand/loadbsd/README:1.2 src/sys/arch/amiga/stand/loadbsd/README:1.3
--- src/sys/arch/amiga/stand/loadbsd/README:1.2	Mon Jan  5 20:51:31 1998
+++ src/sys/arch/amiga/stand/loadbsd/README	Wed Nov 11 16:08:52 2015
@@ -1,22 +1,167 @@
-#	$NetBSD: README,v 1.2 1998/01/05 20:51:31 perry Exp $
+#	$NetBSD: README,v 1.3 2015/11/11 16:08:52 phx Exp $
 
-This was prepared to compile with gcc 2.7.0 for AmigaOS and 
-libnix 1.0. You don't need ixemul or special directories to run the
-binary, if compiled that way.
+BUILD INSTRUCTIONS
 
-With very old versions of gcc, you might need to add +2-. to relative
-offsets in the assembler part, but honestly, I suggest you upgrade your
-assembler (and compiler) instead, even if you know what I'm talking about 
-and how to identify the lines.
-
-You'll need the (unchanged) getopt.c from src/lib/libc/stdlib, too.
-
-With newer libnix or the ADE version of gcc, or when removing the
--noixemul option from CFLAGS, you might need (or want) to delete the 
-sleep() function at the bottom of loadbsd, or getopt.o from the 
-"OBJS =" line of Makefile.
-
-[Sorry, but I didn't dare to risk my gcc installation a few weeks 
- before the release by trying to install ADE]
-
-	Ignatios Souvatzis
+Building LoadBSD isn't easy since several sources from the NetBSD repository
+are required. Compiling these sources under AmigaOS without clashes with the
+native GCC headers requires some knowledge. This document tries to describe
+the steps necessary to rebuild LoadBSD with an AmigaOS gcc. These instructions
+do only apply for LoadBSD versions using the loadfile() interface. Previous
+version do only require getopt.c and reboot.h.
+
+Note: Its not possible to build LoadBSD with the native NetBSD compiler!
+  LoadBSD is an *AmigaOS* program and must be built with an AmigaOS
+  compiler. Of course, a properly setup cross-compiler does work.
+
+Required sources from NetBSD (either HEAD or from a release branch)
+
+   From src/sys/lib/libsa: loadfile.h,loadfile.c,loadfile_elf32.c,loadfile_aout.c
+   From src/lib/libc/stdlib: getopt.c
+
+  place these files in the directory where you have loadbsd.c
+
+   From src/sys/arch/m68k/include: aout_machdep.h,elf_machdep.h
+
+  place these files in: /include/m68k
+
+   From src/sys/arch/amiga/include: aout_machdep.h,elf_machdep.h,loadfile_machdep.h
+
+  place these files in: /include/machine
+
+   From src/sys/sys: exec.h,exec_elf.h,exec_aout.h,reboot.h
+
+  place these files in: /include/sys
+
+   Additional headers (see below): inttypes.h,namespace.h,lib/libsa/stand.h,lib/libkern/libkern.h
+
+  place these files in: /include
+
+If all the mentioned files are placed at the correct place, loadfile_machdep.h
+must be modfied. The patch is included below. Another small patch to
+loadfile_aout.c must be applied to fix an incompatibility for LoadBSD.
+However, that patch breaks loadfile() for other architectures using a.out!
+Note: This patch is required to be able to suppress loaded symbols when
+  booting ancient a.out kernels that don't support them. Without the
+  patch symbol suppressing doesn't work! That also means ELF isn't
+  affected and LoadBSD could handle it differently but then it could
+  probably break in other unpredictable ways...
+
+Then it should be possible to recompile LoadBSD by typing "make". If make
+fails, fix the problem and try again :-P
+
+Good luck!
+
+--- Missing files/patches ---
+
+  

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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 12:37:52 UTC 2015

Modified Files:
src/sys/arch/evbarm/tegra: tegra_machdep.c

Log Message:
support RB_POWERDOWN using the AMS AS3722 PMIC when available


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/tegra/tegra_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/tegra/tegra_machdep.c
diff -u src/sys/arch/evbarm/tegra/tegra_machdep.c:1.25 src/sys/arch/evbarm/tegra/tegra_machdep.c:1.26
--- src/sys/arch/evbarm/tegra/tegra_machdep.c:1.25	Mon Nov  9 23:05:58 2015
+++ src/sys/arch/evbarm/tegra/tegra_machdep.c	Wed Nov 11 12:37:52 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_machdep.c,v 1.25 2015/11/09 23:05:58 jmcneill Exp $ */
+/* $NetBSD: tegra_machdep.c,v 1.26 2015/11/11 12:37:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.25 2015/11/09 23:05:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.26 2015/11/11 12:37:52 jmcneill Exp $");
 
 #include "opt_tegra.h"
 #include "opt_machdep.h"
@@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_machde
 #include "ukbd.h"
 #include "genfb.h"
 #include "ether.h"
+#include "as3722pmic.h"
 
 #include 
 #include 
@@ -89,6 +90,10 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_machde
 #include 
 #include 
 
+#if NAS3722PMIC > 0
+#include 
+#endif
+
 #ifndef TEGRA_MAX_BOOT_STRING
 #define TEGRA_MAX_BOOT_STRING 1024
 #endif
@@ -104,6 +109,7 @@ extern char KERNEL_BASE_phys[];
 #define KERNEL_BASE_PHYS ((paddr_t)KERNEL_BASE_phys)
 
 static void tegra_device_register(device_t, void *);
+static void tegra_powerdown(void);
 
 bs_protos(bs_notimpl);
 
@@ -253,6 +259,7 @@ initarm(void *arg)
 #endif
 
 	cpu_reset_address = tegra_pmc_reset;
+	cpu_powerdown_address = tegra_powerdown;
 
 	/* Talk to the user */
 	DPRINTF("\nNetBSD/evbarm (tegra) booting ...\n");
@@ -527,3 +534,18 @@ tegra_device_register(device_t self, voi
 	}
 #endif
 }
+
+static void
+tegra_powerdown(void)
+{
+#if NAS3722PMIC > 0
+	device_t pmic = device_find_by_driver_unit("as3722pmic", 0);
+	if (pmic != NULL) {
+		if (as3722_poweroff(pmic) != 0) {
+			printf("WARNING: AS3722 poweroff failed\n");
+			return;
+		}
+		delay(100);
+	}
+#endif
+}



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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 14:50:08 UTC 2015

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

Log Message:
fix RB_POWERDOWN test


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/arm32/arm32_reboot.c

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

Modified files:

Index: src/sys/arch/arm/arm32/arm32_reboot.c
diff -u src/sys/arch/arm/arm32/arm32_reboot.c:1.9 src/sys/arch/arm/arm32/arm32_reboot.c:1.10
--- src/sys/arch/arm/arm32/arm32_reboot.c:1.9	Wed Nov 11 12:37:13 2015
+++ src/sys/arch/arm/arm32/arm32_reboot.c	Wed Nov 11 14:50:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_reboot.c,v 1.9 2015/11/11 12:37:13 jmcneill Exp $	*/
+/*	$NetBSD: arm32_reboot.c,v 1.10 2015/11/11 14:50:08 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.9 2015/11/11 12:37:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.10 2015/11/11 14:50:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -141,7 +141,7 @@ void (*cpu_powerdown_address)(void);
 static int
 docpureset(int howto)
 {
-	if (howto & RB_POWERDOWN) {
+	if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
 		if (cpu_powerdown_address) {
 			cpu_powerdown_address();
 			printf("WARNING: powerdown failed\r\n");



CVS commit: src/sys/arch/arm

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 12:37:14 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: arm32_reboot.c
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
add support for optional RB_POWERDOWN handler


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/arm32/arm32_reboot.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/arm32/machdep.h

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

Modified files:

Index: src/sys/arch/arm/arm32/arm32_reboot.c
diff -u src/sys/arch/arm/arm32/arm32_reboot.c:1.8 src/sys/arch/arm/arm32/arm32_reboot.c:1.9
--- src/sys/arch/arm/arm32/arm32_reboot.c:1.8	Mon Jan  5 17:04:24 2015
+++ src/sys/arch/arm/arm32/arm32_reboot.c	Wed Nov 11 12:37:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_reboot.c,v 1.8 2015/01/05 17:04:24 joerg Exp $	*/
+/*	$NetBSD: arm32_reboot.c,v 1.9 2015/11/11 12:37:13 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.8 2015/01/05 17:04:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.9 2015/11/11 12:37:13 jmcneill Exp $");
 
 #include 
 #include 
@@ -136,11 +136,19 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_reboot
 #include 
 #include 
 
+void (*cpu_powerdown_address)(void);
+
 static int
 docpureset(int howto)
 {
-	if (howto & RB_POWERDOWN)
-		printf("WARNING: powerdown not supported\r\n");
+	if (howto & RB_POWERDOWN) {
+		if (cpu_powerdown_address) {
+			cpu_powerdown_address();
+			printf("WARNING: powerdown failed\r\n");
+		} else {
+			printf("WARNING: powerdown not supported\r\n");
+		}
+	}
 
 	if (howto & RB_HALT) {
 		printf("The operating system has halted.\r\n");

Index: src/sys/arch/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.18 src/sys/arch/arm/include/arm32/machdep.h:1.19
--- src/sys/arch/arm/include/arm32/machdep.h:1.18	Fri Mar 28 21:51:59 2014
+++ src/sys/arch/arm/include/arm32/machdep.h	Wed Nov 11 12:37:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.18 2014/03/28 21:51:59 matt Exp $ */
+/* $NetBSD: machdep.h,v 1.19 2015/11/11 12:37:13 jmcneill Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -25,6 +25,8 @@
 extern void (*cpu_reset_address)(void);
 extern paddr_t cpu_reset_address_paddr;
 
+extern void (*cpu_powerdown_address)(void);
+
 extern u_int data_abort_handler_address;
 extern u_int prefetch_abort_handler_address;
 // extern u_int undefined_handler_address;



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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 12:28:15 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_i2c.c

Log Message:
only send repeat start if we are doing write-then-read


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nvidia/tegra_i2c.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/nvidia/tegra_i2c.c
diff -u src/sys/arch/arm/nvidia/tegra_i2c.c:1.6 src/sys/arch/arm/nvidia/tegra_i2c.c:1.7
--- src/sys/arch/arm/nvidia/tegra_i2c.c:1.6	Wed Nov 11 11:32:01 2015
+++ src/sys/arch/arm/nvidia/tegra_i2c.c	Wed Nov 11 12:28:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_i2c.c,v 1.6 2015/11/11 11:32:01 jmcneill Exp $ */
+/* $NetBSD: tegra_i2c.c,v 1.7 2015/11/11 12:28:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.6 2015/11/11 11:32:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.7 2015/11/11 12:28:15 jmcneill Exp $");
 
 #include 
 #include 
@@ -239,7 +239,8 @@ tegra_i2c_exec(void *priv, i2c_op_t op, 
 	}
 
 	if (cmdlen > 0) {
-		error = tegra_i2c_write(sc, addr, cmdbuf, cmdlen, flags, true);
+		error = tegra_i2c_write(sc, addr, cmdbuf, cmdlen, flags,
+		I2C_OP_READ_P(op) ? true : false);
 		if (error) {
 			goto done;
 		}



CVS commit: src/sys/dev/i2c

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 12:35:22 UTC 2015

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: as3722.c as3722.h

Log Message:
Add basic driver for AMS AS3722 power management IC


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/as3722.c src/sys/dev/i2c/as3722.h
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/i2c/files.i2c

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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.66 src/sys/dev/i2c/files.i2c:1.67
--- src/sys/dev/i2c/files.i2c:1.66	Wed Oct 21 09:03:13 2015
+++ src/sys/dev/i2c/files.i2c	Wed Nov 11 12:35:22 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.66 2015/10/21 09:03:13 jmcneill Exp $
+#	$NetBSD: files.i2c,v 1.67 2015/11/11 12:35:22 jmcneill Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -250,3 +250,8 @@ file	dev/i2c/act8846.c			act8846pm	needs
 device	titemp: sysmon_envsys
 attach	titemp at iic
 file	dev/i2c/titemp.c			titemp
+
+# AMS AS3722 Power Management IC
+device	as3722pmic
+attach	as3722pmic at iic
+file	dev/i2c/as3722.c			as3722pmic	needs-flag

Added files:

Index: src/sys/dev/i2c/as3722.c
diff -u /dev/null src/sys/dev/i2c/as3722.c:1.1
--- /dev/null	Wed Nov 11 12:35:22 2015
+++ src/sys/dev/i2c/as3722.c	Wed Nov 11 12:35:22 2015
@@ -0,0 +1,130 @@
+/* $NetBSD: as3722.c,v 1.1 2015/11/11 12:35:22 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.1 2015/11/11 12:35:22 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define AS3722_RESET_CTRL_REG		0x36
+#define AS3722_RESET_CTRL_POWER_OFF	__BIT(1)
+
+#define AS3722_ASIC_ID1_REG		0x90
+#define AS3722_ASIC_ID2_REG		0x91
+
+struct as3722_softc {
+	device_t	sc_dev;
+	i2c_tag_t	sc_i2c;
+	i2c_addr_t	sc_addr;
+};
+
+static int	as3722_match(device_t, cfdata_t, void *);
+static void	as3722_attach(device_t, device_t, void *);
+
+#if 0
+static int	as3722_read(struct as3722_softc *, uint8_t, uint8_t *, int);
+#endif
+static int	as3722_write(struct as3722_softc *, uint8_t, uint8_t, int);
+
+CFATTACH_DECL_NEW(as3722pmic, sizeof(struct as3722_softc),
+as3722_match, as3722_attach, NULL, NULL);
+
+static int
+as3722_match(device_t parent, cfdata_t match, void *aux)
+{
+	struct i2c_attach_args *ia = aux;
+	uint8_t reg, id1;
+	int error;
+
+	iic_acquire_bus(ia->ia_tag, I2C_F_POLL);
+	reg = AS3722_ASIC_ID1_REG;
+	error = iic_exec(ia->ia_tag, I2C_OP_READ_WITH_STOP, ia->ia_addr,
+	, 1, , 1, I2C_F_POLL);
+	iic_release_bus(ia->ia_tag, I2C_F_POLL);
+
+	if (error == 0 && id1 == 0x0c)
+		return 1;
+
+	return 0;
+}
+
+static void
+as3722_attach(device_t parent, device_t self, void *aux)
+{
+	struct as3722_softc * const sc = device_private(self);
+	struct i2c_attach_args *ia = aux;
+
+	sc->sc_dev = self;
+	sc->sc_i2c = ia->ia_tag;
+	sc->sc_addr = ia->ia_addr;
+
+	aprint_naive("\n");
+	aprint_normal(": AMS AS3822\n");
+}
+
+#if 0
+static int
+as3722_read(struct as3722_softc *sc, uint8_t reg, uint8_t *val, int flags)
+{
+	return iic_exec(sc->sc_i2c, I2C_OP_READ_WITH_STOP, sc->sc_addr,
+	, 1, val, 1, flags);
+}
+#endif
+
+static int
+as3722_write(struct as3722_softc *sc, uint8_t reg, uint8_t val, int flags)
+{
+	uint8_t buf[2] = { reg, val };
+	return iic_exec(sc->sc_i2c, I2C_OP_WRITE_WITH_STOP, sc->sc_addr,
+	NULL, 0, buf, 2, flags);
+}
+
+int
+as3722_poweroff(device_t dev)
+{
+	struct 

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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 11 12:35:41 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: JETSONTK1

Log Message:
enable as3722pmic


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/JETSONTK1

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

Modified files:

Index: src/sys/arch/evbarm/conf/JETSONTK1
diff -u src/sys/arch/evbarm/conf/JETSONTK1:1.35 src/sys/arch/evbarm/conf/JETSONTK1:1.36
--- src/sys/arch/evbarm/conf/JETSONTK1:1.35	Mon Nov  9 23:05:58 2015
+++ src/sys/arch/evbarm/conf/JETSONTK1	Wed Nov 11 12:35:40 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: JETSONTK1,v 1.35 2015/11/09 23:05:58 jmcneill Exp $
+#	$NetBSD: JETSONTK1,v 1.36 2015/11/11 12:35:40 jmcneill Exp $
 #
 #	NVIDIA Jetson TK1 - Tegra K1 development kit
 #	https://developer.nvidia.com/jetson-tk1
@@ -93,6 +93,7 @@ iic3		at tegrai2c3
 ddc0		at iic3 addr 0x50		# HDMI DDC
 tegrai2c4	at tegraio? port 4	# I2C5
 iic4		at tegrai2c4
+as3722pmic0	at iic4 addr 0x40		# AMS AS3722 PMIC
 
 # RTC
 tegrartc0	at tegraio?		# RTC



CVS commit: src/tests/net/ndp

2015-11-11 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Nov 12 05:01:28 UTC 2015

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Fix up the header

Remove unnecessary shebang and add missing keyword expansion,
copyright and license.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/ndp/t_ra.sh

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

Modified files:

Index: src/tests/net/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.1 src/tests/net/ndp/t_ra.sh:1.2
--- src/tests/net/ndp/t_ra.sh:1.1	Wed Nov 11 07:52:57 2015
+++ src/tests/net/ndp/t_ra.sh	Thu Nov 12 05:01:28 2015
@@ -1,4 +1,30 @@
-#! /usr/bin/env atf-sh
+#	$NetBSD: t_ra.sh,v 1.2 2015/11/12 05:01:28 ozaki-r Exp $
+#
+# Copyright (c) 2015 Internet Initiative Japan Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
 RUMPFLAGS="-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6"
 RUMPFLAGS="${RUMPFLAGS} -lrumpnet_shmif"
 RUMPFLAGS="${RUMPFLAGS} -lrumpvfs -lrumpfs_ffs"



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

2015-11-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Nov 12 00:43:52 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: files.tegra tegra_drm.c tegra_drm.h
tegra_drm_fb.c tegra_drm_mode.c tegra_fb.c
Added Files:
src/sys/arch/arm/nvidia: tegra_drm_gem.c

Log Message:
Use GEM for memory management. Fixes a couple issues while here:
 - No longer needs to allocate 35MB (!) for framebuffer console.
 - Allows xrandr to switch to modes larger than the framebuffer console.
 - Removes hack that redirected mmap calls to wsdisplay0


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/nvidia/files.tegra
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_drm.c \
src/sys/arch/arm/nvidia/tegra_drm.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nvidia/tegra_drm_fb.c \
src/sys/arch/arm/nvidia/tegra_fb.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/nvidia/tegra_drm_gem.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra_drm_mode.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/nvidia/files.tegra
diff -u src/sys/arch/arm/nvidia/files.tegra:1.20 src/sys/arch/arm/nvidia/files.tegra:1.21
--- src/sys/arch/arm/nvidia/files.tegra:1.20	Mon Nov  9 23:05:58 2015
+++ src/sys/arch/arm/nvidia/files.tegra	Thu Nov 12 00:43:52 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.tegra,v 1.20 2015/11/09 23:05:58 jmcneill Exp $
+#	$NetBSD: files.tegra,v 1.21 2015/11/12 00:43:52 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -114,6 +114,7 @@ attach	tegradrm at tegraio with tegra_dr
 file	arch/arm/nvidia/tegra_drm.c		tegra_drm
 file	arch/arm/nvidia/tegra_drm_mode.c	tegra_drm
 file	arch/arm/nvidia/tegra_drm_fb.c		tegra_drm
+file	arch/arm/nvidia/tegra_drm_gem.c		tegra_drm
 
 # Framebuffer console
 device	tegrafb: tegrafbbus, drmfb, wsemuldisplaydev

Index: src/sys/arch/arm/nvidia/tegra_drm.c
diff -u src/sys/arch/arm/nvidia/tegra_drm.c:1.2 src/sys/arch/arm/nvidia/tegra_drm.c:1.3
--- src/sys/arch/arm/nvidia/tegra_drm.c:1.2	Tue Nov 10 22:14:05 2015
+++ src/sys/arch/arm/nvidia/tegra_drm.c	Thu Nov 12 00:43:52 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm.c,v 1.2 2015/11/10 22:14:05 jmcneill Exp $ */
+/* $NetBSD: tegra_drm.c,v 1.3 2015/11/12 00:43:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.2 2015/11/10 22:14:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.3 2015/11/12 00:43:52 jmcneill Exp $");
 
 #include 
 #include 
@@ -57,27 +57,30 @@ static int	tegra_drm_set_busid(struct dr
 static int	tegra_drm_load(struct drm_device *, unsigned long);
 static int	tegra_drm_unload(struct drm_device *);
 
-static int	tegra_drm_mmap_object(struct drm_device *, off_t, size_t,
-		vm_prot_t, struct uvm_object **, voff_t *, struct file *);
-
 static int	tegra_drm_dumb_create(struct drm_file *, struct drm_device *,
 		struct drm_mode_create_dumb *);
 static int	tegra_drm_dumb_map_offset(struct drm_file *,
 		struct drm_device *, uint32_t, uint64_t *);
-static int	tegra_drm_dumb_destroy(struct drm_file *, struct drm_device *,
-		uint32_t);
+
+static const struct uvm_pagerops tegra_drm_gem_uvm_ops = {
+	.pgo_reference = drm_gem_pager_reference,
+	.pgo_detach = drm_gem_pager_detach,
+	.pgo_fault = tegra_drm_gem_fault,
+};
 
 static struct drm_driver tegra_drm_driver = {
-	.driver_features = DRIVER_MODESET,
+	.driver_features = DRIVER_MODESET | DRIVER_GEM,
 	.dev_priv_size = 0,
 	.load = tegra_drm_load,
 	.unload = tegra_drm_unload,
 
-	.mmap_object = tegra_drm_mmap_object,
+	.gem_free_object = tegra_drm_gem_free_object,
+	.mmap_object = drm_gem_or_legacy_mmap_object,
+	.gem_uvm_ops = _drm_gem_uvm_ops,
 
 	.dumb_create = tegra_drm_dumb_create,
 	.dumb_map_offset = tegra_drm_dumb_map_offset,
-	.dumb_destroy = tegra_drm_dumb_destroy,
+	.dumb_destroy = drm_gem_dumb_destroy,
 
 	.get_vblank_counter = tegra_drm_get_vblank_counter,
 	.enable_vblank = tegra_drm_enable_vblank,
@@ -114,7 +117,7 @@ tegra_drm_attach(device_t parent, device
 	prop_dictionary_t prop = device_properties(self);
 	struct drm_driver * const driver = _drm_driver;
 	const char *pin, *dev;
-	int error, nsegs;
+	int error;
 
 	sc->sc_dev = self;
 	sc->sc_dmat = tio->tio_dmat;
@@ -145,24 +148,6 @@ tegra_drm_attach(device_t parent, device
 	aprint_naive("\n");
 	aprint_normal("\n");
 
-sc->sc_dmasize = 4096 * 2160 * 4;
-error = bus_dmamem_alloc(sc->sc_dmat, sc->sc_dmasize, PAGE_SIZE, 0,
-sc->sc_dmasegs, 1, , BUS_DMA_WAITOK);
-if (error)
-goto failed;
-error = bus_dmamem_map(sc->sc_dmat, sc->sc_dmasegs, nsegs,
-	sc->sc_dmasize, >sc_dmap, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
-if (error)
-goto free;
-error = bus_dmamap_create(sc->sc_dmat, 

CVS commit: src/sys/dev

2015-11-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 12 02:06:36 UTC 2015

Modified Files:
src/sys/dev: vnd.c

Log Message:
fix incorrect memset.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.252 src/sys/dev/vnd.c:1.253
--- src/sys/dev/vnd.c:1.252	Mon Nov  9 12:52:59 2015
+++ src/sys/dev/vnd.c	Wed Nov 11 21:06:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.252 2015/11/09 17:52:59 christos Exp $	*/
+/*	$NetBSD: vnd.c,v 1.253 2015/11/12 02:06:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.252 2015/11/09 17:52:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.253 2015/11/12 02:06:36 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -1075,7 +1075,7 @@ vndioctl_get(struct lwp *l, void *data, 
 	switch (error = vnd_cget(l, unit, (int *)data, va)) {
 	case -1:
 		/* unused is not an error */
-		memset(, 0, sizeof(va));
+		memset(va, 0, sizeof(*va));
 		/*FALLTHROUGH*/
 	case 0:
 		return 0;



CVS commit: src

2015-11-11 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Nov 12 05:05:25 UTC 2015

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/net/net: Makefile
Added Files:
src/tests/net/net: t_ipv6address.sh

Log Message:
Add tests of IPv6 link local address

>From s-yamaguchi@IIJ


To generate a diff of this commit:
cvs rdiff -u -r1.652 -r1.653 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.13 -r1.14 src/tests/net/net/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/net/t_ipv6address.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.652 src/distrib/sets/lists/tests/mi:1.653
--- src/distrib/sets/lists/tests/mi:1.652	Wed Nov 11 07:52:57 2015
+++ src/distrib/sets/lists/tests/mi	Thu Nov 12 05:05:24 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.652 2015/11/11 07:52:57 ozaki-r Exp $
+# $NetBSD: mi,v 1.653 2015/11/12 05:05:24 ozaki-r Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3192,6 +3192,7 @@
 ./usr/tests/net/net/Kyuafile			tests-net-tests		compattestfile,atf,kyua
 ./usr/tests/net/net/t_forwarding		tests-net-tests		atf,rump
 ./usr/tests/net/net/t_ipaddress			tests-net-tests		atf,rump
+./usr/tests/net/net/t_ipv6address		tests-net-tests		atf,rump
 ./usr/tests/net/net/t_ipv6_lifetime		tests-net-tests		atf,rump
 ./usr/tests/net/net/t_pktinfo			tests-net-tests		compattestfile,atf
 ./usr/tests/net/net/t_raw			tests-net-tests		atf,rump

Index: src/tests/net/net/Makefile
diff -u src/tests/net/net/Makefile:1.13 src/tests/net/net/Makefile:1.14
--- src/tests/net/net/Makefile:1.13	Wed Oct  7 05:24:41 2015
+++ src/tests/net/net/Makefile	Thu Nov 12 05:05:25 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2015/10/07 05:24:41 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.14 2015/11/12 05:05:25 ozaki-r Exp $
 #
 
 .include 
@@ -13,6 +13,7 @@ TESTS_C+=	t_pktinfo
 TESTS_C+=	t_raw
 TESTS_SH=	t_forwarding
 TESTS_SH+=	t_ipaddress
+TESTS_SH+=	t_ipv6address
 TESTS_SH+=	t_ipv6_lifetime
 .endif
 

Added files:

Index: src/tests/net/net/t_ipv6address.sh
diff -u /dev/null src/tests/net/net/t_ipv6address.sh:1.1
--- /dev/null	Thu Nov 12 05:05:25 2015
+++ src/tests/net/net/t_ipv6address.sh	Thu Nov 12 05:05:25 2015
@@ -0,0 +1,310 @@
+#	$NetBSD: t_ipv6address.sh,v 1.1 2015/11/12 05:05:25 ozaki-r Exp $
+#
+# Copyright (c) 2015 Internet Initiative Japan Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+SERVER="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
+SERVER6="$SERVER -lrumpnet_netinet6"
+
+SOCKSRC=unix://commsock1
+SOCKFWD=unix://commsock2
+SOCKDST=unix://commsock3
+IP6SRCNW=fc00:1::0/64
+IP6SRC=fc00:1::1
+IP6DSTNW=fc00:2::0/64
+IP6DST=fc00:2::1
+IP6FWD0=fc00:3::1
+BUS1=bus1
+BUS2=bus2
+BUSSRC=bus_src
+BUSDST=bus_dst
+
+DEBUG=false
+
+atf_test_case linklocal cleanup
+
+setup()
+{
+	atf_check -s exit:0 ${SERVER6} ${SOCKSRC}
+	atf_check -s exit:0 ${SERVER6} ${SOCKFWD}
+	atf_check -s exit:0 ${SERVER6} ${SOCKDST}
+
+	export RUMP_SERVER=${SOCKSRC}
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif1 create
+	unset RUMP_SERVER
+
+	export RUMP_SERVER=${SOCKDST}
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif1 create
+	unset RUMP_SERVER
+
+	export RUMP_SERVER=${SOCKFWD}
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif1 create
+	atf_check -s exit:0 -o match:"0 -> 1" rump.sysctl \
+	-w net.inet6.ip6.forwarding=1
+	unset RUMP_SERVER
+
+	setup_ifcfg
+
+	export RUMP_SERVER=${SOCKSRC}
+	$DEBUG && 

CVS commit: src/sys/rump/dev/lib

2015-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Nov 11 21:52:47 UTC 2015

Modified Files:
src/sys/rump/dev/lib: Makefile.inc
src/sys/rump/dev/lib/libmiiphy: Makefile
src/sys/rump/dev/lib/libpci_auich: Makefile
src/sys/rump/dev/lib/libpci_eap: Makefile
src/sys/rump/dev/lib/libpci_if_iwn: Makefile
src/sys/rump/dev/lib/libpci_if_pcn: Makefile
src/sys/rump/dev/lib/libpci_if_wm: Makefile
src/sys/rump/dev/lib/libpci_usbhc: Makefile
src/sys/rump/dev/lib/libpci_virtio: Makefile
src/sys/rump/dev/lib/libubt: Makefile
src/sys/rump/dev/lib/libugenhc: Makefile
src/sys/rump/dev/lib/libusb: Makefile
src/sys/rump/dev/lib/libvirtio_if_vioif: Makefile
src/sys/rump/dev/lib/libvirtio_ld: Makefile
src/sys/rump/dev/lib/libvirtio_viornd: Makefile
src/sys/rump/dev/lib/libvirtio_vioscsi: Makefile
Added Files:
src/sys/rump/dev/lib: component_simple.c
Removed Files:
src/sys/rump/dev/lib/libmiiphy: phy_at_mii.c
src/sys/rump/dev/lib/libpci_auich: auich_at_pci.c
src/sys/rump/dev/lib/libpci_eap: eap_at_pci.c
src/sys/rump/dev/lib/libpci_if_iwn: iwn_at_pci.c
src/sys/rump/dev/lib/libpci_if_pcn: pcn_at_pci.c
src/sys/rump/dev/lib/libpci_if_wm: wm_at_pci.c
src/sys/rump/dev/lib/libpci_usbhc: usbhc_at_pci.c
src/sys/rump/dev/lib/libpci_virtio: virtio_at_pci.c
src/sys/rump/dev/lib/libubt: ubt_at_usb.c
src/sys/rump/dev/lib/libugenhc: ugenhc_at_mainbus.c
src/sys/rump/dev/lib/libusb: usb_at_hc.c
src/sys/rump/dev/lib/libvirtio_if_vioif: vioif_at_virtio.c
src/sys/rump/dev/lib/libvirtio_viornd: viornd_at_virtio.c
src/sys/rump/dev/lib/libvirtio_vioscsi: vioscsi_at_virtio.c

Log Message:
Make it easier to create rump kernel components, part 1.

Reduce copypasteware for the component constructors.  If a constructor
calls only config_init_component(), handle it from a common source file
instead of copying the same(ish) file around to every component.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/component_simple.c
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/libmiiphy/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libmiiphy/phy_at_mii.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libpci_auich/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_auich/auich_at_pci.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libpci_eap/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_eap/eap_at_pci.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libpci_if_iwn/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_if_iwn/iwn_at_pci.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libpci_if_pcn/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_if_pcn/pcn_at_pci.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libpci_if_wm/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_if_wm/wm_at_pci.c
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/lib/libpci_usbhc/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_usbhc/usbhc_at_pci.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libpci_virtio/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libpci_virtio/virtio_at_pci.c
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/libubt/Makefile
cvs rdiff -u -r1.4 -r0 src/sys/rump/dev/lib/libubt/ubt_at_usb.c
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/dev/lib/libugenhc/Makefile
cvs rdiff -u -r1.3 -r0 src/sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/dev/lib/libusb/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/dev/lib/libusb/usb_at_hc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libvirtio_if_vioif/Makefile
cvs rdiff -u -r1.1 -r0 \
src/sys/rump/dev/lib/libvirtio_if_vioif/vioif_at_virtio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libvirtio_ld/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libvirtio_viornd/Makefile
cvs rdiff -u -r1.1 -r0 \
src/sys/rump/dev/lib/libvirtio_viornd/viornd_at_virtio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libvirtio_vioscsi/Makefile
cvs rdiff -u -r1.1 -r0 \
src/sys/rump/dev/lib/libvirtio_vioscsi/vioscsi_at_virtio.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/dev/lib/Makefile.inc
diff -u src/sys/rump/dev/lib/Makefile.inc:1.4 src/sys/rump/dev/lib/Makefile.inc:1.5
--- src/sys/rump/dev/lib/Makefile.inc:1.4	Mon Aug 24 23:01:58 2015
+++ src/sys/rump/dev/lib/Makefile.inc	Wed Nov 11 21:52:45 2015
@@ -1,7 +1,14 @@
-#	$NetBSD: Makefile.inc,v 1.4 2015/08/24 23:01:58 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2015/11/11 21:52:45 pooka Exp $
 #
 
 RUMPTOP=	${.CURDIR}/../../..
 CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpdev
 
+RUMPDEVLIBDIR:= ${.PARSEDIR}
+.ifdef COMPONENT_SIMPLE
+.PATH:	

CVS commit: src/sys

2015-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 08:20:22 UTC 2015

Modified Files:
src/sys/arch/x86/conf: files.x86
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c
Added Files:
src/sys/uvm/pmap: pmap_pvt.c pmap_pvt.h

Log Message:
Split out the pmap_pv_track stuff for use by others.

Discussed with riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.188 -r1.189 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r0 -r1.1 src/sys/uvm/pmap/pmap_pvt.c \
src/sys/uvm/pmap/pmap_pvt.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/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.84 src/sys/arch/x86/conf/files.x86:1.85
--- src/sys/arch/x86/conf/files.x86:1.84	Mon Apr 27 07:03:58 2015
+++ src/sys/arch/x86/conf/files.x86	Wed Nov 11 08:20:22 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.84 2015/04/27 07:03:58 knakahara Exp $
+#	$NetBSD: files.x86,v 1.85 2015/11/11 08:20:22 skrll Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -95,6 +95,8 @@ file	arch/x86/x86/x86_autoconf.c	machdep
 file	arch/x86/x86/x86_userconf.c	userconf
 file	arch/x86/x86/x86_machdep.c	machdep
 
+file 	uvm/pmap/pmap_pvt.c		machdep
+
 file	arch/x86/x86/cpu_ucode.c	cpu_ucode needs-flag
 file	arch/x86/x86/cpu_ucode_amd.c	cpu_ucode needs-flag
 file	arch/x86/x86/cpu_ucode_intel.c	cpu_ucode needs-flag

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.56 src/sys/arch/x86/include/pmap.h:1.57
--- src/sys/arch/x86/include/pmap.h:1.56	Fri Apr  3 01:04:23 2015
+++ src/sys/arch/x86/include/pmap.h	Wed Nov 11 08:20:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.56 2015/04/03 01:04:23 riastradh Exp $	*/
+/*	$NetBSD: pmap.h,v 1.57 2015/11/11 08:20:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -109,6 +109,7 @@
 
 #if defined(_KERNEL)
 #include 
+#include 
 
 /*
  * pmap data structures: see pmap.c for details of locking.

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.188 src/sys/arch/x86/x86/pmap.c:1.189
--- src/sys/arch/x86/x86/pmap.c:1.188	Fri Apr  3 01:04:24 2015
+++ src/sys/arch/x86/x86/pmap.c	Wed Nov 11 08:20:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.188 2015/04/03 01:04:24 riastradh Exp $	*/
+/*	$NetBSD: pmap.c,v 1.189 2015/11/11 08:20:22 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.188 2015/04/03 01:04:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.189 2015/11/11 08:20:22 skrll Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -191,10 +191,9 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include 
+#include 
 
 #include 
 
@@ -463,120 +462,6 @@ pvhash_remove(struct pv_hash_head *hh, s
 }
 
 /*
- * unmanaged pv-tracked ranges
- *
- * This is a linear list for now because the only user are the DRM
- * graphics drivers, with a single tracked range per device, for the
- * graphics aperture, so there are expected to be few of them.
- *
- * This is used only after the VM system is initialized well enough
- * that we can use kmem_alloc.
- */
-
-struct pv_track {
-	paddr_t			pvt_start;
-	psize_t			pvt_size;
-	struct pv_track		*pvt_next;
-	struct pmap_page	pvt_pages[];
-};
-
-static struct {
-	kmutex_t	lock;
-	pserialize_t	psz;
-	struct pv_track	*list;
-} pv_unmanaged __cacheline_aligned;
-
-void
-pmap_pv_init(void)
-{
-
-	mutex_init(_unmanaged.lock, MUTEX_DEFAULT, IPL_VM);
-	pv_unmanaged.psz = pserialize_create();
-	pv_unmanaged.list = NULL;
-}
-
-void
-pmap_pv_track(paddr_t start, psize_t size)
-{
-	struct pv_track *pvt;
-	size_t npages;
-
-	KASSERT(start == trunc_page(start));
-	KASSERT(size == trunc_page(size));
-
-	npages = size >> PAGE_SHIFT;
-	pvt = kmem_zalloc(offsetof(struct pv_track, pvt_pages[npages]),
-	KM_SLEEP);
-	pvt->pvt_start = start;
-	pvt->pvt_size = size;
-
-	mutex_enter(_unmanaged.lock);
-	pvt->pvt_next = pv_unmanaged.list;
-	membar_producer();
-	pv_unmanaged.list = pvt;
-	mutex_exit(_unmanaged.lock);
-}
-
-void
-pmap_pv_untrack(paddr_t start, psize_t size)
-{
-	struct pv_track **pvtp, *pvt;
-	size_t npages;
-
-	KASSERT(start == trunc_page(start));
-	KASSERT(size == trunc_page(size));
-
-	mutex_enter(_unmanaged.lock);
-	for (pvtp = _unmanaged.list;
-	 (pvt = *pvtp) != NULL;
-	 pvtp = >pvt_next) {
-		if (pvt->pvt_start != start)
-			continue;
-		if (pvt->pvt_size != size)
-			panic("pmap_pv_untrack: pv-tracking at 0x%"PRIxPADDR
-			": 0x%"PRIxPSIZE" bytes, not 0x%"PRIxPSIZE" bytes",
-			pvt->pvt_start, pvt->pvt_size, size);
-		*pvtp = 

CVS commit: src/sys/uvm/pmap

2015-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 08:22:36 UTC 2015

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

Log Message:
Remove #if 0 / #endif includes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/uvm/pmap/pmap_pvt.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_pvt.c
diff -u src/sys/uvm/pmap/pmap_pvt.c:1.1 src/sys/uvm/pmap/pmap_pvt.c:1.2
--- src/sys/uvm/pmap/pmap_pvt.c:1.1	Wed Nov 11 08:20:22 2015
+++ src/sys/uvm/pmap/pmap_pvt.c	Wed Nov 11 08:22:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_pvt.c,v 1.1 2015/11/11 08:20:22 skrll Exp $	*/
+/*	$NetBSD: pmap_pvt.c,v 1.2 2015/11/11 08:22:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,13 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pmap_pvt.c,v 1.1 2015/11/11 08:20:22 skrll Exp $");
-
-#if 0
-#include 
-#include 
-#include 
-#endif
+__RCSID("$NetBSD: pmap_pvt.c,v 1.2 2015/11/11 08:22:36 skrll Exp $");
 
 #include 
 #include