CVS commit: [matt-nb8-mediatek] src/sys/external/gpl2/dts/dist/arch/arm/boot/dts

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:33:19 UTC 2017

Added Files:
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts [matt-nb8-mediatek]:
mtkatlas.dts mtkmercury.dtsi

Log Message:
DTS files for the Mediatek ATLAS board


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/mtkatlas.dts \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/mtkmercury.dtsi

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

Added files:

Index: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/mtkatlas.dts
diff -u /dev/null src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/mtkatlas.dts:1.1.2.1
--- /dev/null	Wed Dec 13 01:33:19 2017
+++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/mtkatlas.dts	Wed Dec 13 01:33:19 2017
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2014-2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+
+#include "mtkmercury.dtsi"
+
+/ {
+	memory@ {
+		device_type = "memory";
+		reg = <0 0x4000 0 0x1800>;
+	};
+
+	aliases {
+		serial0 = 
+	};
+
+	/* chosen */
+	chosen {
+		stdout-path = "serial0:921600n8";
+	};
+};
+
+
+/* reg = <0 0x4000 0 0x2000>; */
+/* bootargs = "console=ttyS0,921600n1 root=/dev/ram initrd=0x44000200,0x20"; */
+
+ {
+	status = "okay";
+
+	pmic: mt6392 {
+		compatible = "mediatek,mt6392";
+
+		mediatek,system-power-controller;
+
+		mt6392keys: mt6392keys {
+			compatible = "mediatek,mt6392-keys";
+			mediatek,pwrkey-code = <116>;
+			mediatek,homekey-code = <114>;
+			mediatek,long-press-mode = <0>;
+			mediatek,long-press-duration = <0>;
+		};
+
+		mt6392pmic: mt6392pmic {
+			compatible = "mediatek,mt6392-pmic";
+		};
+
+		mt6392regulator: mt6392regulator {
+			compatible = "mediatek,mt6392-regulator";
+
+			mt6392_vproc_reg: buck_vproc {
+regulator-name = "vproc";
+regulator-min-microvolt = < 70>;
+regulator-max-microvolt = <135>;
+regulator-ramp-delay = <12500>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vsys_reg: buck_vsys {
+regulator-name = "vsys";
+regulator-min-microvolt = <140>;
+regulator-max-microvolt = <2987500>;
+regulator-ramp-delay = <25000>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vcore_reg: buck_vcore {
+regulator-name = "vcore";
+regulator-min-microvolt = < 70>;
+regulator-max-microvolt = <135>;
+regulator-ramp-delay = <12500>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vxo22_reg: ldo_vxo22 {
+regulator-name = "vxo22";
+regulator-min-microvolt = <220>;
+regulator-max-microvolt = <220>;
+regulator-enable-ramp-delay = <110>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vaud22_reg: ldo_vaud22 {
+regulator-name = "vaud22";
+regulator-min-microvolt = <180>;
+regulator-max-microvolt = <220>;
+regulator-enable-ramp-delay = <264>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vcama_reg: ldo_vcama {
+regulator-name = "vcama";
+regulator-min-microvolt = <280>;
+regulator-max-microvolt = <280>;
+regulator-enable-ramp-delay = <264>;
+			};
+
+			mt6392_vaud28_reg: ldo_vaud28 {
+regulator-name = "vaud28";
+regulator-min-microvolt = <280>;
+regulator-max-microvolt = <280>;
+regulator-enable-ramp-delay = <264>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vadc18_reg: ldo_vadc18 {
+regulator-name = "vadc18";
+regulator-min-microvolt = <180>;
+regulator-max-microvolt = <180>;
+regulator-enable-ramp-delay = <264>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vcn35_reg: ldo_vcn35 {
+regulator-name = "vcn35";
+regulator-min-microvolt = <330>;
+regulator-max-microvolt = <360>;
+regulator-enable-ramp-delay = <264>;
+			};
+
+			mt6392_vio28_reg: ldo_vio28 {
+regulator-name = "vio28";
+regulator-min-microvolt = <280>;
+regulator-max-microvolt = <280>;
+regulator-enable-ramp-delay = <264>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vusb_reg: ldo_vusb {
+regulator-name = "vusb";
+regulator-min-microvolt = <330>;
+regulator-max-microvolt = <330>;
+regulator-enable-ramp-delay = <264>;
+regulator-always-on;
+regulator-boot-on;
+			};
+
+			mt6392_vmc_reg: ldo_vmc {
+regulator-name = "vmc";
+regulator-min-microvolt = <180>;
+regulator-max-microvolt = 

CVS commit: [matt-nb8-mediatek] src/etc/etc.evbarm

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:25:47 UTC 2017

Modified Files:
src/etc/etc.evbarm [matt-nb8-mediatek]: Makefile.inc

Log Message:
Build MTKATLAS


To generate a diff of this commit:
cvs rdiff -u -r1.81.6.3 -r1.81.6.3.2.1 src/etc/etc.evbarm/Makefile.inc

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

Modified files:

Index: src/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.81.6.3 src/etc/etc.evbarm/Makefile.inc:1.81.6.3.2.1
--- src/etc/etc.evbarm/Makefile.inc:1.81.6.3	Fri Aug 25 14:38:31 2017
+++ src/etc/etc.evbarm/Makefile.inc	Wed Dec 13 01:25:47 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.81.6.3 2017/08/25 14:38:31 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.81.6.3.2.1 2017/12/13 01:25:47 matt Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -109,6 +109,8 @@ EVBARM_BOARDS.armv7+=		KOBO
 EVBARM_BOARDS.armv7hf+= 	KOBO
 EVBARM_BOARDS.armv7+=		MIRABOX
 EVBARM_BOARDS.armv7hf+=		MIRABOX
+EVBARM_BOARDS.armv7+=		MTKATLAS
+EVBARM_BOARDS.armv7hf+=		MTKATLAS
 #EVBARM_BOARDS.armv7+=		N900
 EVBARM_BOARDS.armv7+=		NETWALKER
 EVBARM_BOARDS.armv7hf+=		NETWALKER



CVS commit: [matt-nb8-mediatek] src/sys/arch/evbarm/conf

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:24:08 UTC 2017

Added Files:
src/sys/arch/evbarm/conf [matt-nb8-mediatek]: MTKATLAS MTKATLAS_INSTALL
files.mtkatlas mk.mtkatlas std.mtkatlas

Log Message:
Add Mediatek ATLAS configury


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/evbarm/conf/MTKATLAS \
src/sys/arch/evbarm/conf/MTKATLAS_INSTALL \
src/sys/arch/evbarm/conf/files.mtkatlas \
src/sys/arch/evbarm/conf/mk.mtkatlas \
src/sys/arch/evbarm/conf/std.mtkatlas

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/evbarm/conf/MTKATLAS
diff -u /dev/null src/sys/arch/evbarm/conf/MTKATLAS:1.1.2.1
--- /dev/null	Wed Dec 13 01:24:08 2017
+++ src/sys/arch/evbarm/conf/MTKATLAS	Wed Dec 13 01:24:08 2017
@@ -0,0 +1,159 @@
+# $NetBSD: MTKATLAS,v 1.1.2.1 2017/12/13 01:24:08 matt Exp $
+#
+#	MTK ATLAS board
+#
+
+include	"arch/evbarm/conf/std.mtkatlas"
+include	"arch/evbarm/conf/GENERIC.common"
+
+makeoptions	DTS="
+	mtkatlas.dts
+"
+
+no makeoptions	CPUFLAGS
+makeoptions	CPUFLAGS="-mcpu=cortex-a7 -mfpu=neon"
+#no makeoptions	BOARDTYPE
+#makeoptions	BOARDTYPE="mtkatlas"
+#no makeoptions	KERNEL_BASE_PHYS
+#no makeoptions	KERNEL_BASE_VIRT
+#makeoptions 	KERNEL_BASE_PHYS="0x4010"
+#makeoptions 	KERNEL_BASE_VIRT="0x8010"
+#options 	PMAP_NEED_ALLOC_POOLPAGE
+options 	CPU_CORTEXA7
+options 	CPU_CORTEXA35
+
+options 	MULTIPROCESSOR
+options 	MEMSIZE=384
+options 	MTK_CONSOLE_EARLY
+options 	MTK_MERCURY	# MTK chipname
+
+pseudo-device 	openfirm	# /dev/openfirm
+
+#options 	DEBUG
+options 	VERBOSE_INIT_ARM # verbose bootstraping messages
+makeoptions	DEBUG="-g"	# compile full symbol table
+makeoptions	COPY_SYMTAB=1
+
+## USB Debugging options
+options USB_DEBUG
+options MOTG_DEBUG
+options UMASS_DEBUG
+options UHUB_DEBUG
+options KERNHIST_PRINT
+
+config		netbsd		root on ? type ?
+
+# Device tree support
+armfdt0		at root
+fdt*		at fdtbus?
+
+# PMIC Pwrap
+mtkpwrap*	at fdt?
+pwrap0		at mtkpwrap?
+mt6392pmic*	at pwrap0
+mt6392reg*	at mt6392pmic?
+
+# CPUs
+cpus*		at fdt? pass 0
+cpu*		at cpus?
+
+# Power state coordination interface
+psci*		at fdt?
+
+# Timer
+gtmr*		at fdt? pass 1		# ARM Generic Timer
+armgtmr0	at gtmr?
+
+# Interrupt controller
+gic*		at fdt? pass 1		# GIC
+armgic0		at gic?
+
+# UART
+com*		at fdt?			# UART
+options 	CONADDR=0x11005000, CONSPEED=921600
+
+# SPI controller
+mtkspi0		at fdt?
+spi* 		at spibus?
+
+#spidev0 at spi? slave 0 flags 0
+
+# PWM
+mtkpwm*at fdt?
+
+# MMC/SD controllers
+mtkmmc0		at fdt? 
+sdmmc0		at mtkmmc0
+ld0			at sdmmc0
+
+# GPIO controller
+mtkgpio*	at fdt?
+
+# External interrupt controller
+eint*		at fdt?
+
+# On-board I2C busses
+mtki2c0		at fdt? 			# I2C0
+iic0		at mtki2c0
+seeprom0	at iic0 addr 0x50
+
+mtki2c1		at fdt? 			# I2C1
+iic1		at mtki2c1
+seeprom1	at iic1 addr 0x50
+
+mtki2c2		at fdt? 			# I2C2
+iic2		at mtki2c2
+seeprom2	at iic2 addr 0x50
+
+# SCSI bus support
+scsibus* at scsi?
+
+# SCSI devices
+sd*	at scsibus? target ? lun ?	# SCSI disk drives
+st*	at scsibus? target ? lun ?	# SCSI tape drives
+cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
+ch*	at scsibus? target ? lun ?	# SCSI autochangers
+ses*	at scsibus? target ? lun ?	# SCSI Enclosure Services devices
+ss*	at scsibus? target ? lun ?	# SCSI scanners
+uk*	at scsibus? target ? lun ?	# SCSI unknown
+
+# On-board MUSB 2.0 phy Port0
+usbphy*		at fdt?
+
+# On-board MUSB 2.0 Port0
+motg*		at fdt?
+
+usb*	at motg?
+
+# USB Hubs
+uhub*	at usb?
+uhub*	at uhub? port ?
+
+# USB HID device
+uhidev*	at uhub? port ? configuration ? interface ?
+# USB Mice
+ums*	at uhidev? reportid ?
+wsmouse* at ums? mux 0
+
+# USB Keyboards
+ukbd*	at uhidev? reportid ?
+wskbd*	at ukbd? console ? mux 1
+
+# USB serial adapter
+ucycom*	at uhidev? reportid ?
+
+# USB Generic HID devices
+uhid*	at uhidev? reportid ?
+
+# USB Mass Storage
+umass*	at uhub? port ? configuration ? interface ?
+wd* at umass?
+
+# Prolific PL2301/PL2302 host-to-host adapter
+upl*	at uhub? port ?
+
+# USB Generic driver
+ugen*	at uhub? port ?
+
+pseudo-device 	wsmux
+pseudo-device 	wsfont
Index: src/sys/arch/evbarm/conf/MTKATLAS_INSTALL
diff -u /dev/null src/sys/arch/evbarm/conf/MTKATLAS_INSTALL:1.1.2.1
--- /dev/null	Wed Dec 13 01:24:08 2017
+++ src/sys/arch/evbarm/conf/MTKATLAS_INSTALL	Wed Dec 13 01:24:08 2017
@@ -0,0 +1,10 @@
+# $NetBSD: MTKATLAS_INSTALL,v 1.1.2.1 2017/12/13 01:24:08 matt Exp $
+#
+#	installation-sized ramdisk
+#
+
+include "arch/evbarm/conf/MTKATLAS"
+include "arch/evbarm/conf/INSTALL"
+
+options 	BOOTHOWTO=RB_SINGLE
+#makeoption 	DEBUG
Index: src/sys/arch/evbarm/conf/files.mtkatlas
diff -u /dev/null src/sys/arch/evbarm/conf/files.mtkatlas:1.1.2.1
--- /dev/null	Wed Dec 13 01:24:08 2017
+++ src/sys/arch/evbarm/conf/files.mtkatlas	Wed Dec 13 01:24:08 2017
@@ -0,0 +1,9 @@
+# $NetBSD: files.mtkatlas,v 1.1.2.1 2017/12/13 01:24:08 matt Exp $
+#
+# Mediatek 

CVS commit: [matt-nb8-mediatek] src/sys/arch/evbarm/mediatek

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:22:35 UTC 2017

Added Files:
src/sys/arch/evbarm/mediatek [matt-nb8-mediatek]: genassym.cf
mtk_start.S platform.h

Log Message:
Add Mediatek ATLAS support


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/evbarm/mediatek/genassym.cf \
src/sys/arch/evbarm/mediatek/mtk_start.S \
src/sys/arch/evbarm/mediatek/platform.h

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/evbarm/mediatek/genassym.cf
diff -u /dev/null src/sys/arch/evbarm/mediatek/genassym.cf:1.1.2.1
--- /dev/null	Wed Dec 13 01:22:35 2017
+++ src/sys/arch/evbarm/mediatek/genassym.cf	Wed Dec 13 01:22:35 2017
@@ -0,0 +1,38 @@
+# $NetBSD: genassym.cf,v 1.1.2.1 2017/12/13 01:22:35 matt Exp $
+
+#-
+# Copyright (c) 2013 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Matt Thomas of 3am Software Foundry.
+#
+# 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 
+include 
+
+define	LSR_TXRDY		LSR_TXRDY
+define	LSR_TSRE		LSR_TSRE
+define	COM_DATA		com_data
+define	COM_LSR			com_lsr
Index: src/sys/arch/evbarm/mediatek/mtk_start.S
diff -u /dev/null src/sys/arch/evbarm/mediatek/mtk_start.S:1.1.2.1
--- /dev/null	Wed Dec 13 01:22:35 2017
+++ src/sys/arch/evbarm/mediatek/mtk_start.S	Wed Dec 13 01:22:35 2017
@@ -0,0 +1,188 @@
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 "opt_mtk.h"
+#include "opt_com.h"
+#include "opt_cpuoptions.h"
+#include "opt_cputypes.h"
+#include "opt_multiprocessor.h"
+#include "opt_arm_debug.h"
+#include "opt_fdt_arm.h"
+
+#include 
+#include 
+#include "assym.h"
+
+#include 
+#include 
+
+RCSID("$NetBSD: mtk_start.S,v 1.1.2.1 2017/12/13 01:22:35 matt Exp $")
+
+#if defined(VERBOSE_INIT_ARM)
+#define	XPUTC(n)	mov r0, n; bl xputc
+#if KERNEL_BASE_VOFFSET == 0
+#define	XPUTC2(n)	mov r0, n; bl xputc
+#else
+#define XPUTC2(n)	mov r0, n; blx r11
+#endif
+#ifdef __ARMEB__
+#define COM_BSWAP
+#endif
+#define COM_MULT	4
+#define X

CVS commit: [matt-nb8-mediatek] src/sys/arch/evbarm/conf

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:07:43 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf [matt-nb8-mediatek]: mk.sunxi

Log Message:
Deal with compiler options in the source itself


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.2 -r1.1.4.2.2.1 src/sys/arch/evbarm/conf/mk.sunxi

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/mk.sunxi
diff -u src/sys/arch/evbarm/conf/mk.sunxi:1.1.4.2 src/sys/arch/evbarm/conf/mk.sunxi:1.1.4.2.2.1
--- src/sys/arch/evbarm/conf/mk.sunxi:1.1.4.2	Tue Jul 18 19:13:09 2017
+++ src/sys/arch/evbarm/conf/mk.sunxi	Wed Dec 13 01:07:43 2017
@@ -1,11 +1,8 @@
-#	$NetBSD: mk.sunxi,v 1.1.4.2 2017/07/18 19:13:09 snj Exp $
+#	$NetBSD: mk.sunxi,v 1.1.4.2.2.1 2017/12/13 01:07:43 matt Exp $
 
 SYSTEM_FIRST_OBJ=	sunxi_start.o
 SYSTEM_FIRST_SFILE=	${THISARM}/sunxi/sunxi_start.S
 
-AFLAGS.sunxi_start.S+=	-Wa,-march=armv7-a+virt
-AFLAGS.psci_arm.S+=	-Wa,-march=armv7-a+sec+virt
-
 GENASSYM_EXTRAS+=	${THISARM}/sunxi/genassym.cf
 
 _OSRELEASE!=		${HOST_SH} $S/conf/osrelease.sh



CVS commit: [matt-nb8-mediatek] src/sys/arch/arm/cortex

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:04:52 UTC 2017

Modified Files:
src/sys/arch/arm/cortex [matt-nb8-mediatek]: a9_mpsubr.S

Log Message:
Add Cortex-A35 and make VIRT support simplier


To generate a diff of this commit:
cvs rdiff -u -r1.47.8.1 -r1.47.8.1.2.1 src/sys/arch/arm/cortex/a9_mpsubr.S

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

Modified files:

Index: src/sys/arch/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.47.8.1 src/sys/arch/arm/cortex/a9_mpsubr.S:1.47.8.1.2.1
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.47.8.1	Thu Jul  6 05:28:43 2017
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Wed Dec 13 01:04:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.47.8.1 2017/07/06 05:28:43 martin Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.47.8.1.2.1 2017/12/13 01:04:52 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 
 //#define MPDEBUG
 
-// Marco to call routines in .text
+// Macro to call routines in .text
 #if defined(KERNEL_BASES_EQUAL)
 #define CALL(f)		bl	_C_LABEL(f)
 #else
@@ -50,6 +50,12 @@
 	blx	ip
 #endif
 
+#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17) \
+|| defined(CPU_CORTEXA35)
+	.arch		armv7a
+	.arch_extension	virt
+#define CPU_CORTEXVIRT
+#endif
 
 // We'll modify va and pa at run time so we can use relocatable addresses.
 #define MMU_INIT(va,pa,n_sec,attr) \
@@ -162,7 +168,8 @@ arm_boot_l1pt_init:
 // bits to clear in the Control Register
 //
 #define CPU_CONTROL_CLR \
-	(CPU_CONTROL_AFLT_ENABLE_CLR)
+	(CPU_CONTROL_AFLT_ENABLE_CLR	|	\
+	 CPU_CONTROL_TR_ENABLE)
 
 arm_cpuinit:
 	// Because the MMU may already be on do a typical sequence to set
@@ -249,9 +256,7 @@ arm_cpuinit:
 	movt	r3, #:upper16:CPU_CONTROL_SET
 #endif
 	orr	r0, r1, r3
-#if defined(CPU_CONTROL_CLR) && (CPU_CONTROL_CLR != 0)
 	bic	r0, r0, #CPU_CONTROL_CLR
-#endif
 	//cmp	r0, r1			// any changes to SCTLR?
 	//bxeq	ip			//no, then return.
 
@@ -347,17 +352,19 @@ xputc:
 cortex_init:
 	mov	r10, lr// save lr
 
-#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17)
+#if defined(CPU_CORTEXVIRT)
 	/* Leave HYP mode and move into supervisor mode with IRQs/FIQs disabled. */
 	mrs	r0, cpsr
-	and	r0, r0, #(PSR_MODE)	/* Mode is in the low 5 bits of CPSR */
-	teq	r0, #(PSR_HYP32_MODE)	/* Hyp Mode? */
+	and	r1, r0, #(PSR_MODE)	/* Mode is in the low 5 bits of CPSR */
+	teq	r1, #(PSR_HYP32_MODE)	/* Hyp Mode? */
 	bne	1f
 
+	/* Set CNTVOFF to 0 */
+	mov	r1, #0
+	mcrr	p15, 4, r1, r1, c14
+
 	/* Ensure that IRQ, and FIQ will be disabled after eret */
-	mrs	r0, cpsr
-	bic	r0, r0, #(PSR_MODE)
-	orr	r0, r0, #(PSR_SVC32_MODE)
+	eor	r0, r0, #(PSR_SVC32_MODE^PSR_HYP32_MODE)
 	orr	r0, r0, #(I32_bit | F32_bit)
 	msr	spsr_cxsf, r0
 	/* Exit hypervisor mode */



CVS commit: [matt-nb8-mediatek] src/sys/arch/arm/cortex

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:03:41 UTC 2017

Modified Files:
src/sys/arch/arm/cortex [matt-nb8-mediatek]: armperiph.c

Log Message:
Add Cortex-A35 devices


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/arch/arm/cortex/armperiph.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/cortex/armperiph.c
diff -u src/sys/arch/arm/cortex/armperiph.c:1.11 src/sys/arch/arm/cortex/armperiph.c:1.11.6.1
--- src/sys/arch/arm/cortex/armperiph.c:1.11	Fri May 26 21:17:46 2017
+++ src/sys/arch/arm/cortex/armperiph.c	Wed Dec 13 01:03:41 2017
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: armperiph.c,v 1.11 2017/05/26 21:17:46 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: armperiph.c,v 1.11.6.1 2017/12/13 01:03:41 matt Exp $");
 
 #include 
 #include 
@@ -106,6 +106,14 @@ static const struct armperiph_info a17_d
 };
 #endif
 
+#ifdef CPU_CORTEXA35
+static const struct armperiph_info a35_devices[] = {
+	{ "armgic",  0, 0x4000 },
+	{ "armgtmr", 0, 0 },
+	{ "", 0, 0 },
+};
+#endif
+
 #ifdef CPU_CORTEXA57
 static const struct armperiph_info a57_devices[] = {
 	{ "armgic",  0x1000, 0x2000 },
@@ -135,6 +143,9 @@ static const struct mpcore_config {
 #ifdef CPU_CORTEXA17
 	{ a17_devices, 0x410fc0e0, 8*4096 },
 #endif
+#ifdef CPU_CORTEXA35
+	{ a35_devices, 0x410fd040, 8*4096 },
+#endif
 #ifdef CPU_CORTEXA57
 	{ a57_devices, 0x410fd070, 8*4096 },
 #endif



CVS commit: [matt-nb8-mediatek] src/sys/arch/arm/conf

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:01:07 UTC 2017

Modified Files:
src/sys/arch/arm/conf [matt-nb8-mediatek]: files.arm

Log Message:
Add a few more Cortex (A35, etc.)


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

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

Modified files:

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.132.2.1 src/sys/arch/arm/conf/files.arm:1.132.2.1.2.1
--- src/sys/arch/arm/conf/files.arm:1.132.2.1	Tue Jul 18 19:13:08 2017
+++ src/sys/arch/arm/conf/files.arm	Wed Dec 13 01:01:07 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.132.2.1 2017/07/18 19:13:08 snj Exp $
+#	$NetBSD: files.arm,v 1.132.2.1.2.1 2017/12/13 01:01:07 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -50,7 +50,9 @@ defflag	opt_cputypes.h		CPU_CORTEXA8: CP
 defflag	opt_cputypes.h		CPU_CORTEXA9: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA15: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA17: CPU_CORTEX
-defflag opt_cputypes.h		CPU_CORTEXA57: CPU_CORTEX
+defflag	opt_cputypes.h		CPU_CORTEXA35: CPU_CORTEX
+defflag	opt_cputypes.h		CPU_CORTEXA53: CPU_CORTEX
+defflag	opt_cputypes.h		CPU_CORTEXA57: CPU_CORTEX
 defflag	opt_cputypes.h		FPU_VFP
 
 defparam opt_cpuoptions.h	XSCALE_CCLKCFG



CVS commit: [matt-nb8-mediatek] src/sys/arch/arm/include

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 01:00:18 UTC 2017

Modified Files:
src/sys/arch/arm/include [matt-nb8-mediatek]: armreg.h

Log Message:
Add Cortex-A35 definitions


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.111.14.1 src/sys/arch/arm/include/armreg.h

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

Modified files:

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.111 src/sys/arch/arm/include/armreg.h:1.111.14.1
--- src/sys/arch/arm/include/armreg.h:1.111	Tue May 17 08:27:24 2016
+++ src/sys/arch/arm/include/armreg.h	Wed Dec 13 01:00:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.111 2016/05/17 08:27:24 msaitoh Exp $	*/
+/*	$NetBSD: armreg.h,v 1.111.14.1 2017/12/13 01:00:18 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -227,6 +227,7 @@
 #define CPU_ID_CORTEXA15R2	0x412fc0f0
 #define CPU_ID_CORTEXA15R3	0x413fc0f0
 #define CPU_ID_CORTEXA17R1	0x411fc0e0
+#define CPU_ID_CORTEXA35R0	0x410fd040
 #define CPU_ID_CORTEXA53R0	0x410fd030
 #define CPU_ID_CORTEXA57R0	0x410fd070
 #define CPU_ID_CORTEXA57R1	0x411fd070
@@ -238,6 +239,7 @@
 #define CPU_ID_CORTEX_A8_P(n)	((n & 0xff0ff0f0) == 0x410fc080)
 #define CPU_ID_CORTEX_A9_P(n)	((n & 0xff0ff0f0) == 0x410fc090)
 #define CPU_ID_CORTEX_A15_P(n)	((n & 0xff0ff0f0) == 0x410fc0f0)
+#define CPU_ID_CORTEX_A35_P(n)	((n & 0xff0ff0f0) == 0x410fd040)
 #define CPU_ID_CORTEX_A53_P(n)	((n & 0xff0ff0f0) == 0x410fd030)
 #define CPU_ID_CORTEX_A57_P(n)	((n & 0xff0ff0f0) == 0x410fd070)
 #define CPU_ID_CORTEX_A72_P(n)	((n & 0xff0ff0f0) == 0x410fd080)



CVS commit: [matt-nb8-mediatek] src/sys/arch/arm/arm32

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 00:59:12 UTC 2017

Modified Files:
src/sys/arch/arm/arm32 [matt-nb8-mediatek]: cpu.c

Log Message:
Add Cortex A35


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.6.1 src/sys/arch/arm/arm32/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/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.115 src/sys/arch/arm/arm32/cpu.c:1.115.6.1
--- src/sys/arch/arm/arm32/cpu.c:1.115	Thu Jun  1 02:45:05 2017
+++ src/sys/arch/arm/arm32/cpu.c	Wed Dec 13 00:59:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.115 2017/06/01 02:45:05 chs Exp $	*/
+/*	$NetBSD: cpu.c,v 1.115.6.1 2017/12/13 00:59:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.115 2017/06/01 02:45:05 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.115.6.1 2017/12/13 00:59:11 matt Exp $");
 
 #include 
 #include 
@@ -514,6 +514,8 @@ const struct cpuidtab cpuids[] = {
 	  pN_steppings, "7A" },
 	{ CPU_ID_CORTEXA17R1,	CPU_CLASS_CORTEX,	"Cortex-A17 r1",
 	  pN_steppings, "7A" },
+	{ CPU_ID_CORTEXA35R0,	CPU_CLASS_CORTEX,	"Cortex-A35 r0",
+	  pN_steppings, "8A" },
 	{ CPU_ID_CORTEXA53R0,	CPU_CLASS_CORTEX,	"Cortex-A53 r0",
 	  pN_steppings, "8A" },
 	{ CPU_ID_CORTEXA57R0,	CPU_CLASS_CORTEX,	"Cortex-A57 r0",



CVS commit: [matt-nb8-mediatek] src/sys/arch/arm/vfp

2017-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 13 00:57:58 UTC 2017

Modified Files:
src/sys/arch/arm/vfp [matt-nb8-mediatek]: vfp_init.c

Log Message:
Make the VFP is disabled after disabling it.


To generate a diff of this commit:
cvs rdiff -u -r1.53.2.1 -r1.53.2.1.2.1 src/sys/arch/arm/vfp/vfp_init.c

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

Modified files:

Index: src/sys/arch/arm/vfp/vfp_init.c
diff -u src/sys/arch/arm/vfp/vfp_init.c:1.53.2.1 src/sys/arch/arm/vfp/vfp_init.c:1.53.2.1.2.1
--- src/sys/arch/arm/vfp/vfp_init.c:1.53.2.1	Tue Oct 24 09:14:59 2017
+++ src/sys/arch/arm/vfp/vfp_init.c	Wed Dec 13 00:57:58 2017
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfp_init.c,v 1.53.2.1 2017/10/24 09:14:59 snj Exp $ */
+/*  $NetBSD: vfp_init.c,v 1.53.2.1.2.1 2017/12/13 00:57:58 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -642,6 +642,7 @@ vfp_setcontext(struct lwp *l, const mcon
 	struct pcb * const pcb = lwp_getpcb(l);
 
 	pcu_discard(_vfp_ops, l, true);
+	KASSERT((pcb->pcb_vfp.vfp_fpexc & VFP_FPEXC_EN) == 0);
 	pcb->pcb_vfp.vfp_fpscr = mcp->__fpu.__vfpregs.__vfp_fpscr;
 	memcpy(pcb->pcb_vfp.vfp_regs, mcp->__fpu.__vfpregs.__vfp_fstmx,
 	sizeof(mcp->__fpu.__vfpregs.__vfp_fstmx));



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

2017-11-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Nov 10 22:54:20 UTC 2017

Modified Files:
src/sys/arch/arm/cortex: a9_mpsubr.S

Log Message:
Add #define CPU_CORTEDVIRT to reduce copied complex ifdef.
Shrink HYP test


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/arm/cortex/a9_mpsubr.S

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

Modified files:

Index: src/sys/arch/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.52 src/sys/arch/arm/cortex/a9_mpsubr.S:1.53
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.52	Sat Nov  4 17:09:55 2017
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Fri Nov 10 22:54:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.52 2017/11/04 17:09:55 skrll Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.53 2017/11/10 22:54:20 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -50,9 +50,11 @@
 	blx	ip
 #endif
 
-#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17)
+#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17) \
+|| defined(CPU_CORTEXA35)
 	.arch		armv7a
-	.arch_extension virt
+	.arch_extension	virt
+#define CPU_CORTEXVIRT
 #endif
 
 // We'll modify va and pa at run time so we can use relocatable addresses.
@@ -350,21 +352,19 @@ xputc:
 cortex_init:
 	mov	r10, lr// save lr
 
-#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17)
+#if defined(CPU_CORTEXVIRT)
 	/* Leave HYP mode and move into supervisor mode with IRQs/FIQs disabled. */
 	mrs	r0, cpsr
-	and	r0, r0, #(PSR_MODE)	/* Mode is in the low 5 bits of CPSR */
-	teq	r0, #(PSR_HYP32_MODE)	/* Hyp Mode? */
+	and	r1, r0, #(PSR_MODE)	/* Mode is in the low 5 bits of CPSR */
+	teq	r1, #(PSR_HYP32_MODE)	/* Hyp Mode? */
 	bne	1f
 
 	/* Set CNTVOFF to 0 */
-	mov	r0, #0
-	mcrr	p15, 4, r0, r0, c14
+	mov	r1, #0
+	mcrr	p15, 4, r1, r1, c14
 
 	/* Ensure that IRQ, and FIQ will be disabled after eret */
-	mrs	r0, cpsr
-	bic	r0, r0, #(PSR_MODE)
-	orr	r0, r0, #(PSR_SVC32_MODE)
+	eor	r0, r0, #(PSR_SVC32_MODE^PSR_HYP32_MODE)
 	orr	r0, r0, #(I32_bit | F32_bit)
 	msr	spsr_cxsf, r0
 	/* Exit hypervisor mode */



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

2017-11-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Nov 10 22:07:30 UTC 2017

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

Log Message:
Add CPU_CORTEXA35


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

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

Modified files:

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.135 src/sys/arch/arm/conf/files.arm:1.136
--- src/sys/arch/arm/conf/files.arm:1.135	Sun Oct  8 15:29:33 2017
+++ src/sys/arch/arm/conf/files.arm	Fri Nov 10 22:07:30 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.135 2017/10/08 15:29:33 jmcneill Exp $
+#	$NetBSD: files.arm,v 1.136 2017/11/10 22:07:30 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -50,6 +50,7 @@ defflag	opt_cputypes.h		CPU_CORTEXA8: CP
 defflag	opt_cputypes.h		CPU_CORTEXA9: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA15: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA17: CPU_CORTEX
+defflag	opt_cputypes.h		CPU_CORTEXA35: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA53: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_CORTEXA57: CPU_CORTEX
 defflag	opt_cputypes.h		FPU_VFP



CVS commit: src/sys/arch/arm

2017-09-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep 16 00:47:16 UTC 2017

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

Log Message:
Add Cortex-A35 CPU ID.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/arm/include/armreg.h

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

Modified files:

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.115 src/sys/arch/arm/arm32/cpu.c:1.116
--- src/sys/arch/arm/arm32/cpu.c:1.115	Thu Jun  1 02:45:05 2017
+++ src/sys/arch/arm/arm32/cpu.c	Sat Sep 16 00:47:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.115 2017/06/01 02:45:05 chs Exp $	*/
+/*	$NetBSD: cpu.c,v 1.116 2017/09/16 00:47:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.115 2017/06/01 02:45:05 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.116 2017/09/16 00:47:16 matt Exp $");
 
 #include 
 #include 
@@ -514,6 +514,8 @@ const struct cpuidtab cpuids[] = {
 	  pN_steppings, "7A" },
 	{ CPU_ID_CORTEXA17R1,	CPU_CLASS_CORTEX,	"Cortex-A17 r1",
 	  pN_steppings, "7A" },
+	{ CPU_ID_CORTEXA35R0,	CPU_CLASS_CORTEX,	"Cortex-A35 r0",
+	  pN_steppings, "8A" },
 	{ CPU_ID_CORTEXA53R0,	CPU_CLASS_CORTEX,	"Cortex-A53 r0",
 	  pN_steppings, "8A" },
 	{ CPU_ID_CORTEXA57R0,	CPU_CLASS_CORTEX,	"Cortex-A57 r0",

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.111 src/sys/arch/arm/include/armreg.h:1.112
--- src/sys/arch/arm/include/armreg.h:1.111	Tue May 17 08:27:24 2016
+++ src/sys/arch/arm/include/armreg.h	Sat Sep 16 00:47:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.111 2016/05/17 08:27:24 msaitoh Exp $	*/
+/*	$NetBSD: armreg.h,v 1.112 2017/09/16 00:47:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -227,6 +227,7 @@
 #define CPU_ID_CORTEXA15R2	0x412fc0f0
 #define CPU_ID_CORTEXA15R3	0x413fc0f0
 #define CPU_ID_CORTEXA17R1	0x411fc0e0
+#define CPU_ID_CORTEXA35R0	0x410fd040
 #define CPU_ID_CORTEXA53R0	0x410fd030
 #define CPU_ID_CORTEXA57R0	0x410fd070
 #define CPU_ID_CORTEXA57R1	0x411fd070
@@ -238,6 +239,7 @@
 #define CPU_ID_CORTEX_A8_P(n)	((n & 0xff0ff0f0) == 0x410fc080)
 #define CPU_ID_CORTEX_A9_P(n)	((n & 0xff0ff0f0) == 0x410fc090)
 #define CPU_ID_CORTEX_A15_P(n)	((n & 0xff0ff0f0) == 0x410fc0f0)
+#define CPU_ID_CORTEX_A35_P(n)	((n & 0xff0ff0f0) == 0x410fd040)
 #define CPU_ID_CORTEX_A53_P(n)	((n & 0xff0ff0f0) == 0x410fd030)
 #define CPU_ID_CORTEX_A57_P(n)	((n & 0xff0ff0f0) == 0x410fd070)
 #define CPU_ID_CORTEX_A72_P(n)	((n & 0xff0ff0f0) == 0x410fd080)



CVS commit: src/share/mk

2017-01-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 18 02:33:25 UTC 2017

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

Log Message:
Resort _MKVARS.no


To generate a diff of this commit:
cvs rdiff -u -r1.1002 -r1.1003 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.1002 src/share/mk/bsd.own.mk:1.1003
--- src/share/mk/bsd.own.mk:1.1002	Tue Jan 10 13:47:18 2017
+++ src/share/mk/bsd.own.mk	Wed Jan 18 02:33:25 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1002 2017/01/10 13:47:18 skrll Exp $
+#	$NetBSD: bsd.own.mk,v 1.1003 2017/01/18 02:33:25 matt Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1094,23 +1094,28 @@ MKARZERO ?= ${MKREPRO}
 
 #
 # MK* options which default to "no".  Note that MKZFS has a different
-# default for some platforms, see above.
+# default for some platforms, see above.  Please keep alphabetically
+# sorted with at most one letter per line.
 #
 _MKVARS.no= \
 	MKARZERO \
 	MKBSDGREP MKBSDTAR \
-	MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCRYPTO_RC5 MKCTF MKDEBUG \
-	MKDEBUGLIB MKDTRACE MKEXTSRC MKGROFFHTMLDOC \
-	MKKYUA MKLLD MKLLDB MKLINT \
-	MKMANZ MKMCLINKER MKOBJDIRS \
-	MKSLJIT \
-	MKLIBCXX MKLLVM MKNSD MKPCC \
-	MKPIGZGZIP \
-	MKRADEONFIRMWARE \
-	MKREPRO \
-	MKSOFTFLOAT MKSTRIPIDENT MKTPM \
-	MKXORG_SERVER \
-	MKUNPRIVED MKUPDATE MKX11 MKX11MOTIF MKZFS
+	MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCRYPTO_RC5 MKCTF \
+	MKDEBUG MKDEBUGLIB MKDTRACE \
+	MKEXTSRC \
+	MKGROFFHTMLDOC \
+	MKKYUA \
+	MKLIBCXX MKLLD MKLLDB MKLLVM MKLINT \
+	MKMANZ MKMCLINKER \
+	MKNSD \
+	MKOBJDIRS \
+	MKPCC MKPIGZGZIP \
+	MKRADEONFIRMWARE MKREPRO \
+	MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \
+	MKTPM \
+	MKUNPRIVED MKUPDATE \
+	MKX11 MKX11MOTIF MKXORG_SERVER \
+	MKZFS
 .for var in ${_MKVARS.no}
 ${var}?=	${${var}.${MACHINE_ARCH}:Uno}
 .endfor



CVS commit: src/etc/mtree

2016-11-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 15 22:31:07 UTC 2016

Modified Files:
src/etc/mtree: Makefile

Log Message:
An awk file is not a directory.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/etc/mtree/Makefile

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

Modified files:

Index: src/etc/mtree/Makefile
diff -u src/etc/mtree/Makefile:1.35 src/etc/mtree/Makefile:1.36
--- src/etc/mtree/Makefile:1.35	Thu Jun  9 04:26:07 2016
+++ src/etc/mtree/Makefile	Tue Nov 15 22:31:07 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2016/06/09 04:26:07 christos Exp $
+#	$NetBSD: Makefile,v 1.36 2016/11/15 22:31:07 matt Exp $
 
 .include 
 
@@ -58,7 +58,7 @@ NetBSD.dist.xcompat: NetBSD.dist.xcompat
 
 NetBSD.dist.tests.compat: NetBSD.dist.tests mkcompattree.awk 
 	${MKCREATE}
-	${TOOL_AWK} -f ${.ALLSRC:M*.awk}/mkcompattree.awk \
+	${TOOL_AWK} -f ${.ALLSRC:M*.awk} \
 	-v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} -v S="usr/tests" \
 		${.ALLSRC:M*.tests} > ${.TARGET}
 



CVS commit: src/sys/uvm/pmap

2016-09-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep 16 17:27:10 UTC 2016

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

Log Message:
When removing a page, make sure to clear its execness regardless of whether
the page is clean or dirty.  This fixes the problem of execpages leaking
into the freepage lists.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/uvm/pmap/pmap.c

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

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.21 src/sys/uvm/pmap/pmap.c:1.22
--- src/sys/uvm/pmap/pmap.c:1.21	Sat Aug 20 20:09:47 2016
+++ src/sys/uvm/pmap/pmap.c	Fri Sep 16 17:27:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.21 2016/08/20 20:09:47 mrg Exp $	*/
+/*	$NetBSD: pmap.c,v 1.22 2016/09/16 17:27:09 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.21 2016/08/20 20:09:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.22 2016/09/16 17:27:09 matt Exp $");
 
 /*
  *	Manages physical address maps.
@@ -713,6 +713,15 @@ pmap_page_remove(struct vm_page *pg)
 
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(pmaphist);
 
+	UVMHIST_LOG(pmapexechist, "pg %p (pa %#"PRIxPADDR")%s: %s",
+	pg, VM_PAGE_TO_PHYS(pg), " [page removed]", "execpage cleared");
+#ifdef PMAP_VIRTUAL_CACHE_ALIASES
+	pmap_page_clear_attributes(mdpg, VM_PAGEMD_EXECPAGE|VM_PAGEMD_UNCACHED);
+#else
+	pmap_page_clear_attributes(mdpg, VM_PAGEMD_EXECPAGE);
+#endif
+	PMAP_COUNT(exec_uncached_remove);
+
 	pv_entry_t pv = >mdpg_first;
 	if (pv->pv_pmap == NULL) {
 		VM_PAGEMD_PVLIST_UNLOCK(mdpg);
@@ -800,9 +809,6 @@ pmap_page_remove(struct vm_page *pg)
 		}
 	}
 
-#ifdef PMAP_VIRTUAL_CACHE_ALIASES
-	pmap_page_clear_attributes(mdpg, VM_PAGEMD_UNCACHED);
-#endif
 	pmap_pvlist_check(mdpg);
 	VM_PAGEMD_PVLIST_UNLOCK(mdpg);
 	kpreempt_enable();



CVS commit: src/sys/uvm/pmap

2016-08-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 18 21:42:27 UTC 2016

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

Log Message:
Don't track kenter_pa/kremove PVs unless we are worrying about cache aliasing.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/uvm/pmap/pmap.c

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

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.19 src/sys/uvm/pmap/pmap.c:1.20
--- src/sys/uvm/pmap/pmap.c:1.19	Fri Aug  5 20:54:28 2016
+++ src/sys/uvm/pmap/pmap.c	Thu Aug 18 21:42:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.19 2016/08/05 20:54:28 jakllsch Exp $	*/
+/*	$NetBSD: pmap.c,v 1.20 2016/08/18 21:42:27 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.19 2016/08/05 20:54:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.20 2016/08/18 21:42:27 matt Exp $");
 
 /*
  *	Manages physical address maps.
@@ -1358,7 +1358,8 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 	 * No need to track non-managed pages or PMAP_KMPAGEs pages for aliases
 	 */
 #ifdef PMAP_VIRTUAL_CACHE_ALIASES
-	if (pg != NULL && (flags & PMAP_KMPAGE) == 0) {
+	if (pg != NULL && (flags & PMAP_KMPAGE) == 0
+	&& pmap_md_virtual_cache_aliasing_p()) {
 		pmap_enter_pv(pmap, va, pg, , PV_KENTER);
 	}
 #endif
@@ -1411,9 +1412,11 @@ pmap_pte_kremove(pmap_t pmap, vaddr_t sv
 
 		PMAP_COUNT(kremove_pages);
 		struct vm_page * const pg = PHYS_TO_VM_PAGE(pte_to_paddr(pte));
-		if (pg != NULL) {
+#ifdef PMAP_VIRTUAL_CACHE_ALIASES
+		if (pg != NULL && pmap_md_virtual_cache_aliasing_p()) {
 			pmap_remove_pv(pmap, sva, pg, !pte_readonly_p(pte));
 		}
+#endif
 
 		pmap_md_tlb_miss_lock_enter();
 		*ptep = new_pte;



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

2016-07-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 06:29:28 UTC 2016

Modified Files:
src/sys/arch/mips/mips: bus_dma.c

Log Message:
Supply lastvaddr to load_buffer.  Fix printf formats.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mips/mips/bus_dma.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/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.36 src/sys/arch/mips/mips/bus_dma.c:1.37
--- src/sys/arch/mips/mips/bus_dma.c:1.36	Fri Jul 22 19:50:44 2016
+++ src/sys/arch/mips/mips/bus_dma.c	Sat Jul 30 06:29:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.36 2016/07/22 19:50:44 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.37 2016/07/30 06:29:28 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.36 2016/07/22 19:50:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.37 2016/07/30 06:29:28 matt Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -104,10 +104,10 @@ paddr_t kvtophys(vaddr_t);	/* XXX */
 static int
 _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map,
 void *buf, bus_size_t buflen, struct vmspace *vm, int flags,
-int *segp, bool first)
+int *segp, vaddr_t lastvaddr, bool first)
 {
 	paddr_t baddr, curaddr, lastaddr;
-	vaddr_t vaddr = (vaddr_t)buf, lastvaddr;
+	vaddr_t vaddr = (vaddr_t)buf;
 	bus_dma_segment_t *ds = >dm_segs[*segp];
 	bus_dma_segment_t * const eds = >dm_segs[map->_dm_segcnt];
 	const bus_addr_t bmask = ~(map->_dm_boundary - 1);
@@ -115,7 +115,6 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 	(mips_options.mips_cpu_flags & CPU_MIPS_D_CACHE_COHERENT) != 0;
 
 	lastaddr = ds->ds_addr + ds->ds_len;
-	lastvaddr = ds->_ds_vaddr + ds->ds_len;
 
 	while (buflen > 0) {
 		/*
@@ -166,12 +165,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		 * Insert chunk into a segment, coalescing with
 		 * the previous segment if possible.
 		 */
-		if (first) {
-			ds->ds_addr = curaddr;
-			ds->ds_len = sgsize;
-			ds->_ds_vaddr = vaddr;
-			first = false;
-		} else if (curaddr == lastaddr
+		if (!first
+		&& curaddr == lastaddr
 		&& (d_cache_coherent
 #ifndef __mips_o32
 			|| !MIPS_CACHE_VIRTUAL_ALIAS
@@ -182,11 +177,12 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 			|| ((ds->ds_addr ^ curaddr) & bmask) == 0)) {
 			ds->ds_len += sgsize;
 		} else {
-			if (++ds >= eds)
+			if (!first && ++ds >= eds)
 break;
 			ds->ds_addr = curaddr;
 			ds->ds_len = sgsize;
-			ds->_ds_vaddr = vaddr;
+			ds->_ds_vaddr = (intptr_t)vaddr;
+			first = false;
 			/*
 			 * If this segment uses the correct color, try to see
 			 * if we can use a direct-mapped VA for the segment.
@@ -206,6 +202,9 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 MIPS_PHYS_TO_XKPHYS_CACHED(curaddr);
 #endif
 			}
+			/* Make sure this is a valid kernel address */
+			KASSERTMSG(ds->_ds_vaddr < 0,
+			"_ds_vaddr %#"PRIxREGISTER, ds->_ds_vaddr);
 		}
 
 		lastaddr = curaddr + sgsize;
@@ -266,7 +265,7 @@ _bus_dma_load_bouncebuf(bus_dma_tag_t t,
 	cookie->id_buftype = buftype;
 	seg = 0;
 	error = _bus_dmamap_load_buffer(t, map, cookie->id_bouncebuf,
-	buflen, vm, flags, , true);
+	buflen, vm, flags, , 0, true);
 	if (error)
 		return (error);
 
@@ -457,7 +456,7 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 
 	seg = 0;
 	error = _bus_dmamap_load_buffer(t, map, buf, buflen,
-	vm, flags, , true);
+	vm, flags, , 0, true);
 	if (error == 0) {
 		map->dm_mapsize = buflen;
 		map->dm_nsegs = seg + 1;
@@ -502,7 +501,6 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 	int seg, error;
 	struct mbuf *m;
 	struct vmspace * vm = vmspace_kernel();
-	bool first;
 
 	if (map->dm_nsegs > 0) {
 #ifdef _MIPS_NEED_BUS_DMA_BOUNCE
@@ -533,15 +531,17 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 	if (m0->m_pkthdr.len > map->_dm_size)
 		return (EINVAL);
 
-	first = true;
+	vaddr_t lastvaddr = 0;
+	bool first = true;
 	seg = 0;
 	error = 0;
 	for (m = m0; m != NULL && error == 0; m = m->m_next) {
 		if (m->m_len == 0)
 			continue;
 		error = _bus_dmamap_load_buffer(t, map, m->m_data, m->m_len,
-		vm, flags, , first);
+		vm, flags, , lastvaddr, first);
 		first = false;
+		lastvaddr = (vaddr_t)m->m_data + m->m_len;
 	}
 	if (error == 0) {
 		map->dm_mapsize = m0->m_pkthdr.len;
@@ -572,7 +572,6 @@ _bus_dmamap_load_uio(bus_dma_tag_t t, bu
 struct uio *uio, int flags)
 {
 	int seg, i, error;
-	bool first;
 	bus_size_t minlen, resid;
 	struct iovec *iov;
 	void *addr;
@@ -600,7 +599,8 @@ _bus_dmamap_load_uio(bus_dma_tag_t t, bu
 	resid = uio->uio_resid;
 	iov = uio->uio_iov;
 
-	first = true;
+	vaddr_t lastvaddr = 0;
+	bool first = true;
 	seg = 0;
 	error = 0;
 	for (i = 0; i < uio->uio_iovcnt && resid != 0 && error == 0; i++) {
@@ -612,8 +612,9 @@ _bus_dmamap_load_uio(bus_dma_tag_t t, bu

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

2016-07-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 06:27:45 UTC 2016

Modified Files:
src/sys/arch/mips/include: psl.h

Log Message:
KX needs to set on !O32 kernels


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/include/psl.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/mips/include/psl.h
diff -u src/sys/arch/mips/include/psl.h:1.18 src/sys/arch/mips/include/psl.h:1.19
--- src/sys/arch/mips/include/psl.h:1.18	Mon Dec 14 00:46:05 2009
+++ src/sys/arch/mips/include/psl.h	Sat Jul 30 06:27:45 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.18 2009/12/14 00:46:05 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.19 2016/07/30 06:27:45 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -48,11 +48,7 @@
 #define	MIPS3_PSL_LOWIPL	(MIPS3_INT_MASK | MIPS_SR_INT_IE)
 
 #if !defined(__mips_o32)
-# ifdef _LP64
-#  define MIPS3_PSL_XFLAGS	(MIPS3_SR_XX | MIPS_SR_KX)
-# else
-#  define MIPS3_PSL_XFLAGS	(MIPS3_SR_XX)
-# endif
+# define MIPS3_PSL_XFLAGS	(MIPS3_SR_XX | MIPS_SR_KX)
 #else
 # define MIPS3_PSL_XFLAGS	(0)
 #endif



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

2016-07-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 06:28:05 UTC 2016

Modified Files:
src/sys/arch/mips/include: bus_dma_defs.h

Log Message:
Use register_t for _ds_vaddr


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/include/bus_dma_defs.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/mips/include/bus_dma_defs.h
diff -u src/sys/arch/mips/include/bus_dma_defs.h:1.2 src/sys/arch/mips/include/bus_dma_defs.h:1.3
--- src/sys/arch/mips/include/bus_dma_defs.h:1.2	Thu Jun 11 08:22:09 2015
+++ src/sys/arch/mips/include/bus_dma_defs.h	Sat Jul 30 06:28:05 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma_defs.h,v 1.2 2015/06/11 08:22:09 matt Exp $ */
+/* $NetBSD: bus_dma_defs.h,v 1.3 2016/07/30 06:28:05 matt Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@ typedef struct mips_bus_dmamap	*bus_dmam
 struct mips_bus_dma_segment {
 	bus_addr_t	ds_addr;	/* DMA address */
 	bus_size_t	ds_len;		/* length of transfer */
-	bus_addr_t	_ds_vaddr;	/* virtual address, 0 if invalid */
+	register_t	_ds_vaddr;	/* virtual address, 0 if invalid */
 };
 typedef struct mips_bus_dma_segment	bus_dma_segment_t;
 



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

2016-07-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 06:20:54 UTC 2016

Modified Files:
src/sys/arch/mips/mips: vm_machdep.c

Log Message:
For LP64 and N32 make sure KX is set in the trapframe as well.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/mips/mips/vm_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/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.148 src/sys/arch/mips/mips/vm_machdep.c:1.149
--- src/sys/arch/mips/mips/vm_machdep.c:1.148	Sat Jul 30 05:58:15 2016
+++ src/sys/arch/mips/mips/vm_machdep.c	Sat Jul 30 06:20:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.148 2016/07/30 05:58:15 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.149 2016/07/30 06:20:54 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.148 2016/07/30 05:58:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.149 2016/07/30 06:20:54 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_coredump.h"
@@ -144,6 +144,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	pcb2->pcb_context.val[_L_RA] =
 	   mips_locore_jumpvec.ljv_lwp_trampoline;			/* RA */
 #if defined(_LP64) || defined(__mips_n32)
+	KASSERT(tf->tf_regs[_R_SR] & MIPS_SR_KX);
 	KASSERT(pcb2->pcb_context.val[_L_SR] & MIPS_SR_KX);
 #endif
 	KASSERTMSG(pcb2->pcb_context.val[_L_SR] & MIPS_SR_INT_IE,



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

2016-07-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 05:55:34 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Fix typo.  N32 doesn't want UX on.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.273 src/sys/arch/mips/mips/mips_machdep.c:1.274
--- src/sys/arch/mips/mips/mips_machdep.c:1.273	Mon Jul 25 22:10:03 2016
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jul 30 05:55:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.273 2016/07/25 22:10:03 macallan Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.274 2016/07/30 05:55:34 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.273 2016/07/25 22:10:03 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.274 2016/07/30 05:55:34 matt Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2069,9 +2069,9 @@ mips_init_lwp0_uarea(void)
 
 	pcb->pcb_context.val[_L_SR] = MIPS_SR_INT_IE
 	| (ipl_sr_map.sr_bits[IPL_SCHED] ^ MIPS_INT_MASK);
-#ifdef _mips_n32
-	pcb->pcb_context.val[_L_SR] |= MIPS_SR_KX | MIPS_SR_UX;
-	l->l_md.md_utf->tf_regs[_R_SR] = MIPS_SR_KX | MIPS_SR_UX;
+#ifdef __mips_n32
+	pcb->pcb_context.val[_L_SR] |= MIPS_SR_KX;
+	l->l_md.md_utf->tf_regs[_R_SR] = MIPS_SR_KX;
 #endif
 #ifdef _LP64
 	pcb->pcb_context.val[_L_SR] |= MIPS_SR_KX | MIPS_SR_UX;



CVS commit: src/sys/uvm/pmap

2016-07-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 23 20:06:25 UTC 2016

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

Log Message:
Lock the tlbinfo if it wasn't when doing a pmap_tlb_pai_check


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/uvm/pmap/pmap_tlb.c:1.18
--- src/sys/uvm/pmap/pmap_tlb.c:1.17	Thu Jul 14 15:50:31 2016
+++ src/sys/uvm/pmap/pmap_tlb.c	Sat Jul 23 20:06:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.17 2016/07/14 15:50:31 skrll Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.18 2016/07/23 20:06:25 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.17 2016/07/14 15:50:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.18 2016/07/23 20:06:25 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -204,10 +204,12 @@ pmap_tlb_intersecting_onproc_p(pmap_t pm
 #endif
 
 static void
-pmap_tlb_pai_check(struct pmap_tlb_info *ti)
+pmap_tlb_pai_check(struct pmap_tlb_info *ti, bool locked_p)
 {
 #ifdef DIAGNOSTIC
 	struct pmap_asid_info *pai;
+	if (!locked_p)
+		TLBINFO_LOCK(ti);
 	LIST_FOREACH(pai, >ti_pais, pai_link) {
 		KASSERT(pai != NULL);
 		KASSERT(PAI_PMAP(pai, ti) != pmap_kernel());
@@ -220,6 +222,8 @@ pmap_tlb_pai_check(struct pmap_tlb_info 
 		KASSERT(pmap_tlb_intersecting_active_p(PAI_PMAP(pai, ti), ti));
 #endif
 	}
+	if (!locked_p)
+		TLBINFO_UNLOCK(ti);
 #endif
 }
 
@@ -412,7 +416,7 @@ pmap_tlb_asid_reinitialize(struct pmap_t
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
 	UVMHIST_LOG(maphist, "(ti=%p, op=%u)", ti, op, 0, 0);
 
-	pmap_tlb_pai_check(ti);
+	pmap_tlb_pai_check(ti, true);
 
 	ti->ti_evcnt_asid_reinits.ev_count++;
 
@@ -907,7 +911,7 @@ pmap_tlb_asid_acquire(pmap_t pm, struct 
 	TLBINFO_LOCK(ti);
 	KASSERT(pai->pai_asid <= KERNEL_PID || pai->pai_link.le_prev != NULL);
 	KASSERT(pai->pai_asid > KERNEL_PID || pai->pai_link.le_prev == NULL);
-	pmap_tlb_pai_check(ti);
+	pmap_tlb_pai_check(ti, true);
 	if (__predict_false(!PMAP_PAI_ASIDVALID_P(pai, ti))) {
 		/*
 		 * If we've run out ASIDs, reinitialize the ASID space.
@@ -925,7 +929,7 @@ pmap_tlb_asid_acquire(pmap_t pm, struct 
 		pmap_tlb_asid_alloc(ti, pm, pai);
 		UVMHIST_LOG(maphist, "allocated asid %#x", pai->pai_asid, 0, 0, 0);
 	}
-	pmap_tlb_pai_check(ti);
+	pmap_tlb_pai_check(ti, true);
 #if defined(MULTIPROCESSOR)
 	KASSERT(kcpuset_isset(pm->pm_active, cpu_index(ci)));
 #endif
@@ -981,7 +985,7 @@ pmap_tlb_asid_deactivate(pmap_t pm)
 	curcpu()->ci_pmap_asid_cur = KERNEL_PID;
 	UVMHIST_LOG(maphist, " <-- done (pm=%p)", pm, 0, 0, 0);
 	tlb_set_asid(KERNEL_PID);
-	pmap_tlb_pai_check(cpu_tlb_info(curcpu()));
+	pmap_tlb_pai_check(cpu_tlb_info(curcpu()), false);
 #if defined(DEBUG)
 	pmap_tlb_asid_check();
 #endif



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

2016-07-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 22 19:50:45 UTC 2016

Modified Files:
src/sys/arch/mips/mips: bus_dma.c

Log Message:
When mapping a dmamem page, make sure to trunc_pae the starting address


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/mips/mips/bus_dma.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/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.35 src/sys/arch/mips/mips/bus_dma.c:1.36
--- src/sys/arch/mips/mips/bus_dma.c:1.35	Sat Jul 16 21:33:46 2016
+++ src/sys/arch/mips/mips/bus_dma.c	Fri Jul 22 19:50:44 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.35 2016/07/16 21:33:46 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.36 2016/07/22 19:50:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.35 2016/07/16 21:33:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.36 2016/07/22 19:50:44 matt Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -1115,7 +1115,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 	*kvap = (void *)va;
 
 	for (curseg = 0; curseg < nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
+		for (addr = trunc_page(segs[curseg].ds_addr);
 		addr < (segs[curseg].ds_addr + segs[curseg].ds_len);
 		addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
 			if (size == 0)



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

2016-07-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 16 21:33:46 UTC 2016

Modified Files:
src/sys/arch/mips/mips: bus_dma.c

Log Message:
When doing dmamap syncs, try to use KSEG0/XKPHYS address if possible.
XXX once hard page coloring is supported XKPHYS could be used all the time.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mips/mips/bus_dma.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/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.34 src/sys/arch/mips/mips/bus_dma.c:1.35
--- src/sys/arch/mips/mips/bus_dma.c:1.34	Tue Feb 17 09:58:33 2015
+++ src/sys/arch/mips/mips/bus_dma.c	Sat Jul 16 21:33:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.34 2015/02/17 09:58:33 macallan Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.35 2016/07/16 21:33:46 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.34 2015/02/17 09:58:33 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.35 2016/07/16 21:33:46 matt Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -106,18 +106,16 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 void *buf, bus_size_t buflen, struct vmspace *vm, int flags,
 int *segp, bool first)
 {
-	bus_size_t sgsize;
 	paddr_t baddr, curaddr, lastaddr;
 	vaddr_t vaddr = (vaddr_t)buf, lastvaddr;
-	int seg = *segp;
-	bus_dma_segment_t *ds = >dm_segs[seg];
+	bus_dma_segment_t *ds = >dm_segs[*segp];
 	bus_dma_segment_t * const eds = >dm_segs[map->_dm_segcnt];
+	const bus_addr_t bmask = ~(map->_dm_boundary - 1);
 	const bool d_cache_coherent =
 	(mips_options.mips_cpu_flags & CPU_MIPS_D_CACHE_COHERENT) != 0;
 
 	lastaddr = ds->ds_addr + ds->ds_len;
 	lastvaddr = ds->_ds_vaddr + ds->ds_len;
-	const bus_size_t bmask = ~(map->_dm_boundary - 1);
 
 	while (buflen > 0) {
 		/*
@@ -146,7 +144,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		/*
 		 * Compute the segment size, and adjust counts.
 		 */
-		sgsize = PAGE_SIZE - ((uintptr_t)vaddr & PGOFSET);
+		bus_size_t sgsize = PAGE_SIZE - ((uintptr_t)vaddr & PGOFSET);
 		if (sgsize > buflen) {
 			sgsize = buflen;
 		}
@@ -174,8 +172,12 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 			ds->_ds_vaddr = vaddr;
 			first = false;
 		} else if (curaddr == lastaddr
-		&& (d_cache_coherent || lastvaddr == vaddr)
-		&& ds->ds_len + sgsize <= map->dm_maxsegsz
+		&& (d_cache_coherent
+#ifndef __mips_o32
+			|| !MIPS_CACHE_VIRTUAL_ALIAS
+#endif
+			|| vaddr == lastvaddr)
+		&& (ds->ds_len + sgsize) <= map->dm_maxsegsz
 		&& (map->_dm_boundary == 0
 			|| ((ds->ds_addr ^ curaddr) & bmask) == 0)) {
 			ds->ds_len += sgsize;
@@ -185,6 +187,25 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 			ds->ds_addr = curaddr;
 			ds->ds_len = sgsize;
 			ds->_ds_vaddr = vaddr;
+			/*
+			 * If this segment uses the correct color, try to see
+			 * if we can use a direct-mapped VA for the segment.
+			 */
+			if (!mips_cache_badalias(curaddr, vaddr)) {
+#ifdef __mips_o32
+if (MIPS_KSEG0_P(curaddr + sgsize - 1)) {
+	ds->_ds_vaddr =
+	MIPS_PHYS_TO_KSEG0(curaddr);
+}
+#else
+/*
+ * All physical addresses can be accessed
+ * via XKPHYS.
+ */
+				ds->_ds_vaddr =
+MIPS_PHYS_TO_XKPHYS_CACHED(curaddr);
+#endif
+			}
 		}
 
 		lastaddr = curaddr + sgsize;
@@ -496,6 +517,7 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 #endif
 		STAT_INCR(unloads);
 	}
+
 	/*
 	 * Make sure that on error condition we return "no valid mappings."
 	 */
@@ -803,6 +825,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	|| (ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) == 0)
 		goto bounce_it;
 
+#ifdef _mips_o32
 	/*
 	 * If the mapping belongs to the kernel, or it belongs
 	 * to the currently-running process (XXX actually, vmspace),
@@ -812,6 +835,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	 */
 	const bool useindex = (!VMSPACE_IS_KERNEL_P(map->_dm_vmspace)
 	&& map->_dm_vmspace != curproc->p_vmspace);
+#endif
 
 	bus_dma_segment_t *seg = map->dm_segs;
 	bus_dma_segment_t * const lastseg = seg + map->dm_nsegs;
@@ -827,7 +851,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 		 * Now at the first segment to sync; nail each segment until we
 		 * have exhausted the length.
 		 */
-		vaddr_t vaddr = seg->_ds_vaddr + offset;
+		register_t vaddr = (intptr_t)seg->_ds_vaddr + offset;
 		minlen = ulmin(len, seg->ds_len - offset);
 
 #ifdef BUS_DMA_DEBUG
@@ -843,13 +867,15 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 		 * If we are forced to use Index ops, it's always a
 		 * Write-back,Invalidate, so just do one test.
 		 */
-		if (__predict_false(useindex)) {
+#ifdef mips_o32
+		if (__predict_false(useindex || vaddr == 0)) {
 			mips_dcache_wbinv_range_index(vaddr, minlen);
 #ifdef BUS_DMA_DEBUG
 			printf("\n");
 #endif
 			continue;
 		

CVS commit: src/lib/libc_fp

2016-07-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 14 01:59:19 UTC 2016

Added Files:
src/lib/libc_fp: Makefile gcc-softfloat.c
src/lib/libc_fp/arch/mips: Makefile.inc fpdf.S fpsf.S shlib_version

Log Message:
Library which implements the softfloat primitives using FP instructions
Currently contains only untested MIPS routines.
XXX move arm libc_vfp to here.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libc_fp/Makefile \
src/lib/libc_fp/gcc-softfloat.c
cvs rdiff -u -r0 -r1.1 src/lib/libc_fp/arch/mips/Makefile.inc \
src/lib/libc_fp/arch/mips/fpdf.S src/lib/libc_fp/arch/mips/fpsf.S \
src/lib/libc_fp/arch/mips/shlib_version

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

Added files:

Index: src/lib/libc_fp/Makefile
diff -u /dev/null src/lib/libc_fp/Makefile:1.1
--- /dev/null	Thu Jul 14 01:59:19 2016
+++ src/lib/libc_fp/Makefile	Thu Jul 14 01:59:18 2016
@@ -0,0 +1,26 @@
+#	$NetBSD: Makefile,v 1.1 2016/07/14 01:59:18 matt Exp $
+#
+
+USE_SHLIBDIR=	yes
+
+.include 
+
+LIBC_MACHINE_CPU?= ${MACHINE_CPU}
+
+.if exists(arch/${LIBC_MACHINE_CPU})
+.include "arch/${LIBC_MACHINE_CPU}/Makefile.inc"
+.PATH: ${.CURDIR}/arch/${LIBC_MACHINE_CPU}
+.elif exists(arch/${MACHINE_ARCH})
+.include "arch/${MACHINE_ARCH}/Makefile.inc"
+.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}
+.elif exists(arch/${MACHINE}
+.include "arch/${MACHINE}/Makefile.inc"
+.PATH: ${.CURDIR}/arch/${MACHINE}
+.endif
+
+.if !empty(SRCS)
+
+LIB?=		c_fp
+
+.include 
+.endif
Index: src/lib/libc_fp/gcc-softfloat.c
diff -u /dev/null src/lib/libc_fp/gcc-softfloat.c:1.1
--- /dev/null	Thu Jul 14 01:59:19 2016
+++ src/lib/libc_fp/gcc-softfloat.c	Thu Jul 14 01:59:18 2016
@@ -0,0 +1,217 @@
+/* $NetBSD: gcc-softfloat.c,v 1.1 2016/07/14 01:59:18 matt Exp $ */
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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.
+ */
+
+/*
+ * This contain the softfloat primitives used by GCC.
+ * It can be used to verify the functions invoked by tGCC to do softfloat.
+ * It can also be used to what FP instructions GCC generates to implement the
+ * various primitives.  Your arch-dependent code should provide all of these
+ * that are easy to implement.  
+ */
+
+long long
+xfixdfdi(double a)
+{
+	return (long long)a;
+}
+
+int
+xfixdfsi(double a)
+{
+	return (int)a;
+}
+
+unsigned long long
+xfixunsdfdi(double a)
+{
+	return (unsigned long long)a;
+}
+
+unsigned int
+xfixunsdfsi(double a)
+{
+	return (unsigned int)a;
+}
+
+double
+xfloatundidf(unsigned long long a)
+{
+	return (double) a;
+}
+
+double
+xfloatunsidf(unsigned int a)
+{
+	return (double) a;
+}
+
+double
+xfloatdidf(long long a)
+{
+	return (double) a;
+}
+
+double
+xfloatsidf(int a)
+{
+	return (double) a;
+}
+
+double
+xextendsfdf2(float a)
+{
+	return (double) a;
+}
+
+int
+xeqdf2(double a, double b)
+{
+	return a == b;
+}
+
+int
+xnedf2(double a, double b)
+{
+	return a != b;
+}
+
+int
+xledf2(double a, double b)
+{
+	return a <= b;
+}
+
+int
+xgtdf2(double a, double b)
+{
+	return a > b;
+}
+
+int
+xltdf2(double a, double b)
+{
+	return a < b;
+}
+
+int
+xgedf2(double a, double b)
+{
+	return a >= b;
+}
+
+long long
+xfixsfdi(float a)
+{
+	return (long long)a;
+}
+
+int
+xfixsfsi(float a)
+{
+	return (int)a;
+}
+
+unsigned long long
+xfixunssfdi(float a)
+{
+	return (unsigned long long)a;
+}
+
+unsigned int
+xfixunssfsi(float a)
+{
+	return (unsigned int)a;
+}
+
+float
+xfloatundisf(unsigned long 

CVS commit: src/distrib/sets/lists/tests

2016-07-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul 13 15:58:37 UTC 2016

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Fix libproc compat setting


To generate a diff of this commit:
cvs rdiff -u -r1.677 -r1.678 src/distrib/sets/lists/tests/mi

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.677 src/distrib/sets/lists/tests/mi:1.678
--- src/distrib/sets/lists/tests/mi:1.677	Fri Jul  1 22:46:20 2016
+++ src/distrib/sets/lists/tests/mi	Wed Jul 13 15:58:37 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.677 2016/07/01 22:46:20 christos Exp $
+# $NetBSD: mi,v 1.678 2016/07/13 15:58:37 matt Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2938,10 +2938,10 @@
 ./usr/tests/lib/libppath/Atffile		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libppath/Kyuafile		tests-lib-tests		compattestfile,atf,kyua
 ./usr/tests/lib/libppath/t_ppath		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libproc		tests-lib-debug	compattestdir
-./usr/tests/lib/libproc/Atffile	tests-lib-debug	compattestfile,atf,dtrace
-./usr/tests/lib/libproc/proc_testtests-lib-debug	compattestfile,atf,dtrace
-./usr/tests/lib/libproc/target_progtests-lib-debug	compattestfile,atf,dtrace
+./usr/tests/lib/libproctests-lib-debug		compattestfile,atf
+./usr/tests/lib/libproc/Atffile			tests-lib-debug		compattestfile,atf,dtrace
+./usr/tests/lib/libproc/proc_test		tests-lib-debug		compattestfile,atf,dtrace
+./usr/tests/lib/libproc/target_prog		tests-lib-debug		compattestfile,atf,dtrace
 ./usr/tests/lib/libproptests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libprop/Atffile			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libprop/Kyuafile		tests-lib-tests		compattestfile,atf,kyua



CVS commit: src/sys/arch/arc/arc

2016-07-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 12 23:53:18 UTC 2016

Modified Files:
src/sys/arch/arc/arc: bus_space_sparse.c

Log Message:
Put back cacheable


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arc/arc/bus_space_sparse.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/arc/arc/bus_space_sparse.c
diff -u src/sys/arch/arc/arc/bus_space_sparse.c:1.19 src/sys/arch/arc/arc/bus_space_sparse.c:1.20
--- src/sys/arch/arc/arc/bus_space_sparse.c:1.19	Mon Jul 11 16:18:55 2016
+++ src/sys/arch/arc/arc/bus_space_sparse.c	Tue Jul 12 23:53:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space_sparse.c,v 1.19 2016/07/11 16:18:55 matt Exp $	*/
+/*	$NetBSD: bus_space_sparse.c,v 1.20 2016/07/12 23:53:18 matt Exp $	*/
 /*	NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp 	*/
 
 /*-
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.19 2016/07/11 16:18:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.20 2016/07/12 23:53:18 matt Exp $");
 
 #include 
 #include 
@@ -75,9 +75,8 @@ arc_sparse_bus_space_compose_handle(bus_
 	 * Since all buses can be linearly mappable, we don't have to check
 	 * BUS_SPACE_MAP_LINEAR and BUS_SPACE_MAP_PREFETCHABLE.
 	 */
-	const u_int pmap_flags = (flags & BUS_SPACE_MAP_CACHEABLE)
-	? PMAP_WRITE_BACK
-	: 0;
+	const bool cacheable = (flags & BUS_SPACE_MAP_CACHEABLE) != 0;
+	const u_int pmap_flags = cacheable ? PMAP_WRITE_BACK : 0;
 
 	/*
 	 * XXX - `bst->bs_pbase' must be page aligned,



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

2016-07-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 12 06:03:11 UTC 2016

Removed Files:
src/sys/arch/mips/mips: pmap_segtab.c pmap_tlb.c

Log Message:
We use the common uvm pmap now.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r0 src/sys/arch/mips/mips/pmap_segtab.c
cvs rdiff -u -r1.11 -r0 src/sys/arch/mips/mips/pmap_tlb.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/mips/mips

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 12 03:49:32 UTC 2016

Modified Files:
src/sys/arch/mips/mips: bus_space_alignstride_chipdep.c

Log Message:
Use mips3_ld


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/sys/arch/mips/mips/bus_space_alignstride_chipdep.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/mips/bus_space_alignstride_chipdep.c
diff -u src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.26 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.27
--- src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.26	Mon Jul 11 19:05:02 2016
+++ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c	Tue Jul 12 03:49:32 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.26 2016/07/11 19:05:02 skrll Exp $ */
+/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.27 2016/07/12 03:49:32 matt Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -86,7 +86,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space_alignstride_chipdep.c,v 1.26 2016/07/11 19:05:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space_alignstride_chipdep.c,v 1.27 2016/07/12 03:49:32 matt Exp $");
 
 #ifdef CHIP_EXTENT
 #include 
@@ -727,7 +727,7 @@ __BS(read_2)(void *v, bus_space_handle_t
 	const int shift = (h & (CHIP_ACCESS_SIZE - 1)) * 8;
 	h &= ~((bus_space_handle_t)(CHIP_ACCESS_SIZE - 1));
 #if CHIP_ACCESS_SIZE == 8
-	const CHIP_TYPE val = mips_ld(h);
+	const CHIP_TYPE val = mips3_ld(h);
 #elif CHIP_ACCESS_SIZE == 4
 	const CHIP_TYPE val = mips_lwu(h);
 #else



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

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 12 03:34:50 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Fix busted #if/endif


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/mips/mips/mipsX_subr.S

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

Modified files:

Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.70 src/sys/arch/mips/mips/mipsX_subr.S:1.71
--- src/sys/arch/mips/mips/mipsX_subr.S:1.70	Mon Jul 11 19:00:04 2016
+++ src/sys/arch/mips/mips/mipsX_subr.S	Tue Jul 12 03:34:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.70 2016/07/11 19:00:04 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.71 2016/07/12 03:34:50 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1874,7 +1874,7 @@ LEAF_NOPROFILE(MIPSX(kern_tlb_invalid_ex
 	PTR_L	k1, (k1)			# load segtab address
 	beqz	k1, _C_LABEL(MIPSX(kern_gen_exception))
 	 nop
-#endif
+#endif /* _LP64 */
 #ifdef MIPSNNR2
 	_EXT	k0, k0, SEGSHIFT, SEGLENGTH
 	_INS	k1, k0, PTR_SCALESHIFT, SEGLENGTH
@@ -1900,7 +1900,6 @@ LEAF_NOPROFILE(MIPSX(kern_tlb_invalid_ex
 
 	mfc0	k0, MIPS_COP_0_TLB_INDEX
 	MFC0_HAZARD
-#endif
 	bltz	k0, _C_LABEL(MIPSX(kern_gen_exception)) # ASSERT(TLB entry exists)
 	 nop	# - delay slot -
 
@@ -2000,6 +1999,7 @@ MIPSX(kern_tlbi_odd):
 #endif
 	eret
 END(MIPSX(kern_tlb_invalid_exception))
+#endif /* (PGSHIFT & 1) == 0 */
 
 /*
  * Mark where code entered from exception hander jumptable



CVS commit: src/sys/arch/mips/cavium/dev

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 12 03:34:25 UTC 2016

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_dwctwo.c

Log Message:
Use mips_lwu


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/cavium/dev/octeon_dwctwo.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/cavium/dev/octeon_dwctwo.c
diff -u src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.8 src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.9
--- src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.8	Mon Jul 11 16:15:35 2016
+++ src/sys/arch/mips/cavium/dev/octeon_dwctwo.c	Tue Jul 12 03:34:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_dwctwo.c,v 1.8 2016/07/11 16:15:35 matt Exp $	*/
+/*	$NetBSD: octeon_dwctwo.c,v 1.9 2016/07/12 03:34:25 matt Exp $	*/
 
 /*
  * Copyright (c) 2015 Masao Uebayashi 
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_dwctwo.c,v 1.8 2016/07/11 16:15:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_dwctwo.c,v 1.9 2016/07/12 03:34:25 matt Exp $");
 
 #include "opt_octeon.h"
 #include "opt_usb.h"
@@ -321,7 +321,7 @@ octeon_dwc2_rd_4(void *v, bus_space_hand
 {
 
 	/* dwc2 uses little-endian addressing */
-	return mips_lw((h + off) ^ 4);
+	return mips_lwu((h + off) ^ 4);
 }
 
 static void



CVS commit: src/sys/arch/mips

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 23:06:54 UTC 2016

Modified Files:
src/sys/arch/mips/conf: files.mips
src/sys/arch/mips/include: cache_r4k.h
src/sys/arch/mips/mips: cache.c cache_r4k.c

Log Message:
Use sdcache routines.
Remove old cache support.
Switch to new cache routines.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/include/cache_r4k.h
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/mips/mips/cache.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/cache_r4k.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/conf/files.mips
diff -u src/sys/arch/mips/conf/files.mips:1.74 src/sys/arch/mips/conf/files.mips:1.75
--- src/sys/arch/mips/conf/files.mips:1.74	Mon Jul 11 16:15:35 2016
+++ src/sys/arch/mips/conf/files.mips	Mon Jul 11 23:06:53 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mips,v 1.74 2016/07/11 16:15:35 matt Exp $
+#	$NetBSD: files.mips,v 1.75 2016/07/11 23:06:53 matt Exp $
 #
 
 defflag	opt_cputype.h		NOFPU FPEMUL
@@ -77,12 +77,12 @@ file	arch/mips/mips/cache_octeon.c		mips
 file	arch/mips/mips/cache_mipsNN.c		mips32|mips32r2|mips64|mips64r2
 file	arch/mips/mips/cache_r4k_pcache16.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
 file	arch/mips/mips/cache_r4k_pcache32.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
-file	arch/mips/mips/cache_r4k_pcache64.S	mips32|mips32r2|mips64|mips64r2
-file	arch/mips/mips/cache_r4k_pcache128.S	mips32|mips32r2|mips64|mips64r2
-#file	arch/mips/mips/cache_r4k_scache16.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
-#file	arch/mips/mips/cache_r4k_scache32.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
-#file	arch/mips/mips/cache_r4k_scache64.S	mips32|mips32r2|mips64|mips64r2
-#file	arch/mips/mips/cache_r4k_scache128.S	mips32|mips32r2|mips64|mips64r2
+file	arch/mips/mips/cache_r4k_pcache64.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
+file	arch/mips/mips/cache_r4k_pcache128.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
+file	arch/mips/mips/cache_r4k_scache16.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
+file	arch/mips/mips/cache_r4k_scache32.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
+file	arch/mips/mips/cache_r4k_scache64.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
+file	arch/mips/mips/cache_r4k_scache128.S	mips3|mips4|mips32|mips32r2|mips64|mips64r2
 
 file	arch/mips/mips/mips_fputrap.c		!nofpu | fpemul
 file	arch/mips/mips/mips_emul.c

Index: src/sys/arch/mips/include/cache_r4k.h
diff -u src/sys/arch/mips/include/cache_r4k.h:1.13 src/sys/arch/mips/include/cache_r4k.h:1.14
--- src/sys/arch/mips/include/cache_r4k.h:1.13	Mon Jul 11 19:06:33 2016
+++ src/sys/arch/mips/include/cache_r4k.h	Mon Jul 11 23:06:54 2016
@@ -57,6 +57,7 @@
 
 #if !defined(_LOCORE)
 
+#if 1
 /*
  * cache_r4k_op_line:
  *
@@ -306,49 +307,15 @@ cache_r4k_op_8lines_NN_4way(size_t n, re
 	cache_r4k_op_8lines_NN_4way(64, (va1), (va2), (va3), (va4), (op))
 #define	cache_r4k_op_8lines_128_4way(va1, va2, va3, va4, op) \
 	cache_r4k_op_8lines_NN_4way(128, (va1), (va2), (va3), (va4), (op))
+#endif
 
-void	r4k_icache_sync_all_16(void);
-void	r4k_icache_sync_range_16(register_t, vsize_t);
-void	r4k_icache_sync_range_index_16(vaddr_t, vsize_t);
-
-void	r4k_icache_sync_all_32(void);
-void	r4k_icache_sync_range_32(register_t, vsize_t);
-void	r4k_icache_sync_range_index_32(vaddr_t, vsize_t);
-
-void	r4k_pdcache_wbinv_all_16(void);
-void	r4k_pdcache_wbinv_range_16(register_t, vsize_t);
-void	r4k_pdcache_wbinv_range_index_16(vaddr_t, vsize_t);
-
-void	r4k_pdcache_inv_range_16(register_t, vsize_t);
-void	r4k_pdcache_wb_range_16(register_t, vsize_t);
-
-void	r4k_pdcache_wbinv_all_32(void);
-void	r4k_pdcache_wbinv_range_32(register_t, vsize_t);
-void	r4k_pdcache_wbinv_range_index_32(vaddr_t, vsize_t);
-
-void	r4k_pdcache_inv_range_32(register_t, vsize_t);
-void	r4k_pdcache_wb_range_32(register_t, vsize_t);
-
-void	r4k_sdcache_wbinv_all_32(void);
-void	r4k_sdcache_wbinv_range_32(register_t, vsize_t);
-void	r4k_sdcache_wbinv_range_index_32(vaddr_t, vsize_t);
-
-void	r4k_sdcache_inv_range_32(register_t, vsize_t);
-void	r4k_sdcache_wb_range_32(register_t, vsize_t);
-
-void	r4k_sdcache_wbinv_all_128(void);
-void	r4k_sdcache_wbinv_range_128(register_t, vsize_t);
-void	r4k_sdcache_wbinv_range_index_128(vaddr_t, vsize_t);
-
-void	r4k_sdcache_inv_range_128(register_t, vsize_t);
-void	r4k_sdcache_wb_range_128(register_t, vsize_t);
+/* cache_r4k.c */
 
+void	r4k_icache_sync_all_generic(void);
+void	r4k_icache_sync_range_generic(register_t, vsize_t);
+void	r4k_icache_sync_range_index_generic(vaddr_t, vsize_t);
+void	r4k_pdcache_wbinv_all_generic(void);
 void	r4k_sdcache_wbinv_all_generic(void);
-void	r4k_sdcache_wbinv_range_generic(register_t, vsize_t);
-void	r4k_sdcache_wbinv_range_index_generic(vaddr_t, vsize_t);
-
-void	r4k_sdcache_inv_range_generic(register_t, 

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

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 18:07:33 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Remove extra #endif


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mips/mips/mipsX_subr.S

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

Modified files:

Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.68 src/sys/arch/mips/mips/mipsX_subr.S:1.69
--- src/sys/arch/mips/mips/mipsX_subr.S:1.68	Mon Jul 11 16:15:36 2016
+++ src/sys/arch/mips/mips/mipsX_subr.S	Mon Jul 11 18:07:33 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.68 2016/07/11 16:15:36 matt Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.69 2016/07/11 18:07:33 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -2008,7 +2008,6 @@ END(MIPSX(kern_tlb_invalid_exception))
 
 	.globl	_C_LABEL(MIPSX(exceptionentry_end))
 _C_LABEL(MIPSX(exceptionentry_end)):
-#endif /* (PGSHIFT & 1) == 0 */
 
 	.set	at
 



CVS commit: src/sys/arch

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 16:18:56 UTC 2016

Modified Files:
src/sys/arch/arc/arc: bus_space_sparse.c c_nec_eisa.c
src/sys/arch/emips/emips: interrupt.c xilinx_ml40x.c xs_bee3.c
src/sys/arch/evbmips/cavium: machdep.c
src/sys/arch/evbmips/gdium: machdep.c
src/sys/arch/evbmips/malta: machdep.c
src/sys/arch/hpcmips/hpcmips: bus_space.c
src/sys/arch/hpcmips/tx: tx3912video.c

Log Message:
Use pmap_kenter flags to create cached/uncached entries.
#include  when appropriate


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arc/arc/bus_space_sparse.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arc/arc/c_nec_eisa.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/emips/interrupt.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/xilinx_ml40x.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/emips/xs_bee3.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/cavium/machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbmips/gdium/machdep.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbmips/malta/machdep.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hpcmips/hpcmips/bus_space.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/hpcmips/tx/tx3912video.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/arc/arc/bus_space_sparse.c
diff -u src/sys/arch/arc/arc/bus_space_sparse.c:1.18 src/sys/arch/arc/arc/bus_space_sparse.c:1.19
--- src/sys/arch/arc/arc/bus_space_sparse.c:1.18	Fri Jul  1 19:28:00 2011
+++ src/sys/arch/arc/arc/bus_space_sparse.c	Mon Jul 11 16:18:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space_sparse.c,v 1.18 2011/07/01 19:28:00 dyoung Exp $	*/
+/*	$NetBSD: bus_space_sparse.c,v 1.19 2016/07/11 16:18:55 matt Exp $	*/
 /*	NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp 	*/
 
 /*-
@@ -39,42 +39,21 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.18 2011/07/01 19:28:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.19 2016/07/11 16:18:55 matt Exp $");
 
 #include 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
 
 #include 
 
-#include 
+#include 
 #include 
 
-#include 
-
 extern paddr_t kvtophys(vaddr_t);	/* XXX */
 
-static void arc_kseg2_make_cacheable(vaddr_t vaddr, vsize_t size);
-
-static void
-arc_kseg2_make_cacheable(vaddr_t vaddr, vsize_t size)
-{
-	vaddr_t start, end;
-	pt_entry_t *pte;
-	uint32_t entry, mask;
-
-	start = mips_trunc_page(vaddr);
-	end = mips_round_page(vaddr + size);
-	mask = ~(CPUISMIPS3 ? MIPS3_PG_UNCACHED : MIPS1_PG_N);
-	for (; start < end; start += PAGE_SIZE) {
-		pte = kvtopte(start);
-		entry = pte->pt_entry & mask;
-		pte->pt_entry &= entry;
-		tlb_update(start, entry);
-	}
-}
-
 void
 arc_sparse_bus_space_init(bus_space_tag_t bst, const char *name, paddr_t paddr,
 bus_addr_t start, bus_size_t size)
@@ -96,7 +75,9 @@ arc_sparse_bus_space_compose_handle(bus_
 	 * Since all buses can be linearly mappable, we don't have to check
 	 * BUS_SPACE_MAP_LINEAR and BUS_SPACE_MAP_PREFETCHABLE.
 	 */
-	int cacheable = (flags & BUS_SPACE_MAP_CACHEABLE);
+	const u_int pmap_flags = (flags & BUS_SPACE_MAP_CACHEABLE)
+	? PMAP_WRITE_BACK
+	: 0;
 
 	/*
 	 * XXX - `bst->bs_pbase' must be page aligned,
@@ -111,22 +92,20 @@ arc_sparse_bus_space_compose_handle(bus_
 		MIPS_PHYS_TO_KSEG0(start) :
 		MIPS_PHYS_TO_KSEG1(start));
 	} else {
-		vaddr_t va,
-		vaddr = uvm_km_alloc(kernel_map, (vsize_t)(end - start), 0,
-		UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
+		vaddr_t vaddr = uvm_km_alloc(kernel_map, (vsize_t)(end - start),
+		0, UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 
 		if (vaddr == 0)
 			panic("arc_sparse_bus_space_compose_handle: "
 			  "cannot allocate KVA 0x%llx..0x%llx",
 			  start, end);
-		for (va = vaddr; start < end;
-		 start += PAGE_SIZE, va += PAGE_SIZE)
-			pmap_kenter_pa(va, start,
-			VM_PROT_READ|VM_PROT_WRITE, 0);
+		for (vaddr_t va = vaddr; start < end;
+		 start += PAGE_SIZE, va += PAGE_SIZE) {
+			pmap_kenter_pa(va, start, VM_PROT_READ|VM_PROT_WRITE,
+			pmap_flags);
+		}
 		pmap_update(pmap_kernel());
 		vaddr += (offset & PGOFSET);
-		if (cacheable)
-			arc_kseg2_make_cacheable(vaddr, size);
 		*bshp = vaddr;
 	}
 	return 0;

Index: src/sys/arch/arc/arc/c_nec_eisa.c
diff -u src/sys/arch/arc/arc/c_nec_eisa.c:1.16 src/sys/arch/arc/arc/c_nec_eisa.c:1.17
--- src/sys/arch/arc/arc/c_nec_eisa.c:1.16	Sun Feb 20 07:52:42 2011
+++ src/sys/arch/arc/arc/c_nec_eisa.c	Mon Jul 11 16:18:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_nec_eisa.c,v 1.16 2011/02/20 07:52:42 matt Exp $	*/
+/*	$NetBSD: c_nec_eisa.c,v 1.17 2016/07/11 16:18:55 matt Exp $	*/
 
 /*-
  * Copyright (c) 2003 Izumi Tsutsui.  All rights reserved.
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: c_nec_eisa.c,v 1.16 2011/02/20 07:52:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: c_nec_eisa.c,v 1.17 2016/07/11 

CVS commit: src/sys/dev

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 16:13:28 UTC 2016

Modified Files:
src/sys/dev: mm.c mm.h

Log Message:
Add mm_md_page_color hook and use to support better page coloring.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/mm.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/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/dev/mm.c
diff -u src/sys/dev/mm.c:1.20 src/sys/dev/mm.c:1.21
--- src/sys/dev/mm.c:1.20	Sun Jan 17 23:17:04 2016
+++ src/sys/dev/mm.c	Mon Jul 11 16:13:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.c,v 1.20 2016/01/17 23:17:04 christos Exp $	*/
+/*	$NetBSD: mm.c,v 1.21 2016/07/11 16:13:28 matt Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2008, 2010 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.20 2016/01/17 23:17:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.21 2016/07/11 16:13:28 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -128,11 +128,11 @@ mm_init(void)
  * constant, general mapping address otherwise.
  */
 static inline vaddr_t
-dev_mem_getva(paddr_t pa)
+dev_mem_getva(paddr_t pa, int color)
 {
 #ifdef __HAVE_MM_MD_CACHE_ALIASING
 	return uvm_km_alloc(kernel_map, PAGE_SIZE,
-	atop(pa) & uvmexp.colormask,
+	color & uvmexp.colormask,
 	UVM_KMF_VAONLY | UVM_KMF_WAITVA | UVM_KMF_COLORMATCH);
 #else
 	return dev_mem_addr;
@@ -161,6 +161,7 @@ dev_mem_readwrite(struct uio *uio, struc
 	size_t len, offset;
 	bool have_direct;
 	int error;
+	int color = 0;
 
 	/* Check for wrap around. */
 	if ((intptr_t)uio->uio_offset != uio->uio_offset) {
@@ -175,16 +176,24 @@ dev_mem_readwrite(struct uio *uio, struc
 	offset = uio->uio_offset & PAGE_MASK;
 	len = MIN(uio->uio_resid, PAGE_SIZE - offset);
 
+#ifdef __HAVE_MM_MD_CACHE_ALIASING
+	have_direct = mm_md_page_color(paddr, );
+#else
+	have_direct = true;
+	color = 0;
+#endif
+
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 	/* Is physical address directly mapped?  Return VA. */
-	have_direct = mm_md_direct_mapped_phys(paddr, );
+	if (have_direct)
+		have_direct = mm_md_direct_mapped_phys(paddr, );
 #else
 	vaddr = 0;
 	have_direct = false;
 #endif
 	if (!have_direct) {
 		/* Get a special virtual address. */
-		const vaddr_t va = dev_mem_getva(paddr);
+		const vaddr_t va = dev_mem_getva(paddr, color);
 
 		/* Map selected KVA to physical address. */
 		mutex_enter(_mem_lock);

Index: src/sys/dev/mm.h
diff -u src/sys/dev/mm.h:1.2 src/sys/dev/mm.h:1.3
--- src/sys/dev/mm.h:1.2	Sun Jun 12 03:35:51 2011
+++ src/sys/dev/mm.h	Mon Jul 11 16:13:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.h,v 1.2 2011/06/12 03:35:51 rmind Exp $	*/
+/*	$NetBSD: mm.h,v 1.3 2016/07/11 16:13:28 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008 Joerg Sonnenberger .
@@ -88,8 +88,10 @@ bool	mm_md_direct_mapped_io(void *, padd
 
 /*
  * Some architectures may need to deal with cache aliasing issues.
- *
- * machine/types.h must define __HAVE_MM_MD_CACHE_ALIASING to note that.
+ * Optional hook to fetch a page's current color and returns whether
+ * that page can be direct mapped.
+ * machine/types.h must define __HAVE_MM_MD_CACHE_ALIASING to use this.
  */
+bool	mm_md_page_color(paddr_t, int *);
 
 #endif /* _SYS_DEV_MM_H_ */



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

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 16:09:27 UTC 2016

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

Log Message:
Adapt to common pmap changes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/arm32/arm32_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/arch/arm/arm32/arm32_tlb.c
diff -u src/sys/arch/arm/arm32/arm32_tlb.c:1.9 src/sys/arch/arm/arm32/arm32_tlb.c:1.10
--- src/sys/arch/arm/arm32/arm32_tlb.c:1.9	Thu Mar 26 08:45:05 2015
+++ src/sys/arch/arm/arm32/arm32_tlb.c	Mon Jul 11 16:09:27 2016
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: arm32_tlb.c,v 1.9 2015/03/26 08:45:05 hsuenaga Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_tlb.c,v 1.10 2016/07/11 16:09:27 matt Exp $");
 
 #include 
 #include 
@@ -77,6 +77,7 @@ tlb_invalidate_all(void)
 			armreg_iciallu_write(0);
 		}
 	}
+	arm_dsb();
 	arm_isb();
 }
 
@@ -99,6 +100,7 @@ tlb_invalidate_asids(tlb_asid_t lo, tlb_
 			armreg_tlbiasid_write(lo);
 #endif
 		}
+		arm_dsb();
 		arm_isb();
 		if (__predict_false(vivt_icache_p)) {
 #ifdef MULTIPROCESSOR
@@ -130,7 +132,6 @@ tlb_invalidate_addr(vaddr_t va, tlb_asid
 #endif
 		//armreg_tlbiall_write(asid);
 	}
-	arm_dsb();
 	arm_isb();
 }
 
@@ -143,7 +144,7 @@ tlb_update_addr(vaddr_t va, tlb_asid_t a
 
 #if !defined(MULTIPROCESSOR) && defined(CPU_CORTEXA5)
 static u_int
-tlb_cortex_a5_record_asids(u_long *mapp)
+tlb_cortex_a5_record_asids(u_long *mapp, tlb_asid_t asid_max)
 {
 	u_int nasids = 0;
 	for (size_t va_index = 0; va_index < 63; va_index++) {
@@ -175,7 +176,7 @@ tlb_cortex_a5_record_asids(u_long *mapp)
 
 #if !defined(MULTIPROCESSOR) && defined(CPU_CORTEXA7)
 static u_int
-tlb_cortex_a7_record_asids(u_long *mapp)
+tlb_cortex_a7_record_asids(u_long *mapp, tlb_asid_t asid_max)
 {
 	u_int nasids = 0;
 	for (size_t va_index = 0; va_index < 128; va_index++) {
@@ -207,16 +208,16 @@ tlb_cortex_a7_record_asids(u_long *mapp)
 #endif
 
 u_int
-tlb_record_asids(u_long *mapp)
+tlb_record_asids(u_long *mapp, tlb_asid_t asid_max)
 {
 #ifndef MULTIPROCESSOR
 #ifdef CPU_CORTEXA5
 	if (CPU_ID_CORTEX_A5_P(curcpu()->ci_arm_cpuid))
-		return tlb_cortex_a5_record_asids(mapp);
+		return tlb_cortex_a5_record_asids(mapp, asid_max);
 #endif
 #ifdef CPU_CORTEXA7
 	if (CPU_ID_CORTEX_A7_P(curcpu()->ci_arm_cpuid))
-		return tlb_cortex_a7_record_asids(mapp);
+		return tlb_cortex_a7_record_asids(mapp, asid_max);
 #endif
 #endif /* MULTIPROCESSOR */
 #ifdef DIAGNOSTIC



CVS commit: src/sys/sys

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 16:10:10 UTC 2016

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

Log Message:
Welcome 7.99.34


To generate a diff of this commit:
cvs rdiff -u -r1.499 -r1.500 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.499 src/sys/sys/param.h:1.500
--- src/sys/sys/param.h:1.499	Mon Jul  4 07:44:08 2016
+++ src/sys/sys/param.h	Mon Jul 11 16:10:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.499 2016/07/04 07:44:08 pgoyette Exp $	*/
+/*	$NetBSD: param.h,v 1.500 2016/07/11 16:10:10 matt Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799003300	/* NetBSD 7.99.33 */
+#define	__NetBSD_Version__	799003400	/* NetBSD 7.99.34 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/arch/powerpc

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 16:06:52 UTC 2016

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c booke_pmap.c booke_stubs.c
e500_tlb.c
src/sys/arch/powerpc/include/booke: pmap.h pte.h

Log Message:
Adapt to common pmap changes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/booke/booke_machdep.c \
src/sys/arch/powerpc/booke/booke_pmap.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/booke/booke_stubs.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/booke/e500_tlb.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/booke/pmap.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/booke/pte.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/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.23 src/sys/arch/powerpc/booke/booke_machdep.c:1.24
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.23	Fri Jan 23 07:27:05 2015
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Mon Jul 11 16:06:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.23 2015/01/23 07:27:05 nonaka Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.24 2016/07/11 16:06:52 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.23 2015/01/23 07:27:05 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.24 2016/07/11 16:06:52 matt Exp $");
 
 #include "opt_modular.h"
 
@@ -130,6 +130,7 @@ struct cpu_info cpu_info[] = {
 		.ci_softc = _softc[0],
 		.ci_cpl = IPL_HIGH,
 		.ci_idepth = -1,
+		.ci_pmap_kern_segtab = _kern_segtab,
 	},
 #ifdef MULTIPROCESSOR
 	[CPU_MAXNUM-1] = {
@@ -138,6 +139,7 @@ struct cpu_info cpu_info[] = {
 		.ci_softc = _softc[CPU_MAXNUM-1],
 		.ci_cpl = IPL_HIGH,
 		.ci_idepth = -1,
+		.ci_pmap_kern_segtab = _kern_segtab,
 	},
 #endif
 };
Index: src/sys/arch/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.23 src/sys/arch/powerpc/booke/booke_pmap.c:1.24
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.23	Thu Nov  5 06:26:15 2015
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Mon Jul 11 16:06:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.23 2015/11/05 06:26:15 pgoyette Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.24 2016/07/11 16:06:52 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.23 2015/11/05 06:26:15 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.24 2016/07/11 16:06:52 matt Exp $");
 
 #include 
 #include 
@@ -53,19 +53,11 @@ __KERNEL_RCSID(0, "$NetBSD: booke_pmap.c
 kmutex_t pmap_tlb_miss_lock;
 #endif
 
-/*
- * Initialize the kernel pmap.
- */
-#ifdef MULTIPROCESSOR
-#define	PMAP_SIZE	offsetof(struct pmap, pm_pai[PMAP_TLB_MAX])
-#else
-#define	PMAP_SIZE	sizeof(struct pmap)
-#endif
+PMAP_COUNTER(zeroed_pages, "pages zeroed");
+PMAP_COUNTER(copied_pages, "pages copied");
 
 CTASSERT(sizeof(pmap_segtab_t) == NBPG);
 
-pmap_segtab_t pmap_kernel_segtab;
-
 void
 pmap_procwr(struct proc *p, vaddr_t va, size_t len)
 {
@@ -140,7 +132,7 @@ kvtopte(const pmap_segtab_t *stp, vaddr_
 vaddr_t
 pmap_kvptefill(vaddr_t sva, vaddr_t eva, pt_entry_t pt_entry)
 {
-	const pmap_segtab_t * const stp = pmap_kernel()->pm_segtab;
+	pmap_segtab_t * const stp = _kern_segtab;
 	KASSERT(sva == trunc_page(sva));
 	pt_entry_t *ptep = kvtopte(stp, sva);
 	for (; sva < eva; sva += NBPG) {
@@ -158,13 +150,7 @@ vaddr_t
 pmap_bootstrap(vaddr_t startkernel, vaddr_t endkernel,
 	phys_ram_seg_t *avail, size_t cnt)
 {
-	pmap_segtab_t * const stp = _kernel_segtab;
-
-	/*
-	 * Initialize the kernel segment table.
-	 */
-	pmap_kernel()->pm_segtab = stp;
-	curcpu()->ci_pmap_kern_segtab = stp;
+	pmap_segtab_t * const stp = _kern_segtab;
 
 	KASSERT(endkernel == trunc_page(endkernel));
 
@@ -350,6 +336,7 @@ pmap_md_unmap_poolpage(vaddr_t va, vsize
 void
 pmap_zero_page(paddr_t pa)
 {
+	PMAP_COUNT(zeroed_pages);
 	vaddr_t va = pmap_md_map_poolpage(pa, NBPG);
 	dcache_zero_page(va);
 
@@ -365,6 +352,8 @@ pmap_copy_page(paddr_t src, paddr_t dst)
 	vaddr_t dst_va = pmap_md_map_poolpage(dst, NBPG);
 	const vaddr_t end = src_va + PAGE_SIZE;
 
+	PMAP_COUNT(copied_pages);
+
 	while (src_va < end) {
 		__asm __volatile(
 			"dcbt	%2,%0"	"\n\t"	/* touch next src cacheline */

Index: src/sys/arch/powerpc/booke/booke_stubs.c
diff -u src/sys/arch/powerpc/booke/booke_stubs.c:1.9 src/sys/arch/powerpc/booke/booke_stubs.c:1.10
--- src/sys/arch/powerpc/booke/booke_stubs.c:1.9	Thu Jun 30 00:52:58 2011
+++ src/sys/arch/powerpc/booke/booke_stubs.c	Mon Jul 11 16:06:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_stubs.c,v 1.9 2011/06/30 00:52:58 matt Exp $	*/
+/*	$NetBSD: booke_stubs.c,v 1.10 2016/07/11 

CVS commit: src/sys/uvm/pmap

2016-07-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 16:06:09 UTC 2016

Modified Files:
src/sys/uvm/pmap: pmap.c pmap.h pmap_segtab.c pmap_synci.c pmap_tlb.c
pmap_tlb.h tlb.h vmpagemd.h
Added Files:
src/sys/uvm/pmap: pmap_synci.h

Log Message:
Changes so that MIPS can use the common pmap.
Change/augment the virtual cache alias callbacks.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.6 -r1.7 src/sys/uvm/pmap/pmap.h
cvs rdiff -u -r1.2 -r1.3 src/sys/uvm/pmap/pmap_segtab.c \
src/sys/uvm/pmap/pmap_synci.c src/sys/uvm/pmap/tlb.h \
src/sys/uvm/pmap/vmpagemd.h
cvs rdiff -u -r0 -r1.1 src/sys/uvm/pmap/pmap_synci.h
cvs rdiff -u -r1.12 -r1.13 src/sys/uvm/pmap/pmap_tlb.c
cvs rdiff -u -r1.8 -r1.9 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.c
diff -u src/sys/uvm/pmap/pmap.c:1.14 src/sys/uvm/pmap/pmap.c:1.15
--- src/sys/uvm/pmap/pmap.c:1.14	Thu Jul  7 06:55:44 2016
+++ src/sys/uvm/pmap/pmap.c	Mon Jul 11 16:06:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.14 2016/07/07 06:55:44 msaitoh Exp $	*/
+/*	$NetBSD: pmap.c,v 1.15 2016/07/11 16:06:09 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.14 2016/07/07 06:55:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.15 2016/07/11 16:06:09 matt Exp $");
 
 /*
  *	Manages physical address maps.
@@ -102,22 +102,22 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
 #define __PMAP_PRIVATE
 
 #include 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 	/* XXX: for sock_loan_thresh */
 
 #include 
 
-#define	PMAP_COUNT(name)	(pmap_evcnt_##name.ev_count++ + 0)
-#define PMAP_COUNTER(name, desc) \
-static struct evcnt pmap_evcnt_##name = \
-	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "pmap", desc); \
-EVCNT_ATTACH_STATIC(pmap_evcnt_##name)
+#if defined(MULTIPROCESSOR) && defined(PMAP_VIRTUAL_CACHE_ALIASES) \
+&& !defined(PMAP_NO_PV_UNCACHED)
+#error PMAP_VIRTUAL_CACHE_ALIASES with MULTIPROCESSOR requires \
+ PMAP_NO_PV_UNCACHED to be defined
+#endif
 
 PMAP_COUNTER(remove_kernel_calls, "remove kernel calls");
 PMAP_COUNTER(remove_kernel_pages, "kernel pages unmapped");
@@ -132,8 +132,6 @@ PMAP_COUNTER(prefer_requests, "prefer re
 PMAP_COUNTER(prefer_adjustments, "prefer adjustments");
 
 PMAP_COUNTER(idlezeroed_pages, "pages idle zeroed");
-PMAP_COUNTER(zeroed_pages, "pages zeroed");
-PMAP_COUNTER(copied_pages, "pages copied");
 
 PMAP_COUNTER(kenter_pa, "kernel fast mapped pages");
 PMAP_COUNTER(kenter_pa_bad, "kernel fast mapped pages (bad color)");
@@ -190,20 +188,22 @@ PMAP_COUNTER(page_protect, "page_protect
 #define PMAP_ASID_RESERVED 0
 CTASSERT(PMAP_ASID_RESERVED == 0);
 
-/*
- * Initialize the kernel pmap.
- */
-#ifdef MULTIPROCESSOR
-#define	PMAP_SIZE	offsetof(struct pmap, pm_pai[PMAP_TLB_MAX])
-#else
-#define	PMAP_SIZE	sizeof(struct pmap)
-kmutex_t pmap_pvlist_mutex __aligned(COHERENCY_UNIT);
+#ifndef PMAP_SEGTAB_ALIGN
+#define PMAP_SEGTAB_ALIGN	/* nothing */
+#endif
+#ifdef _LP64
+pmap_segtab_t	pmap_kstart_segtab PMAP_SEGTAB_ALIGN; /* first mid-level segtab for kernel */
+#endif
+pmap_segtab_t	pmap_kern_segtab PMAP_SEGTAB_ALIGN = { /* top level segtab for kernel */
+#ifdef _LP64
+	.seg_seg[(VM_MIN_KERNEL_ADDRESS & XSEGOFSET) >> SEGSHIFT] = _kstart_segtab,
 #endif
+};
 
 struct pmap_kernel kernel_pmap_store = {
 	.kernel_pmap = {
 		.pm_count = 1,
-		.pm_segtab = PMAP_INVALID_SEGTAB_ADDRESS,
+		.pm_segtab = _kern_segtab,
 		.pm_minaddr = VM_MIN_KERNEL_ADDRESS,
 		.pm_maxaddr = VM_MAX_KERNEL_ADDRESS,
 	},
@@ -211,7 +211,7 @@ struct pmap_kernel kernel_pmap_store = {
 
 struct pmap * const kernel_pmap_ptr = _pmap_store.kernel_pmap;
 
-struct pmap_limits pmap_limits = {
+struct pmap_limits pmap_limits = {	/* VA and PA limits */
 	.virtual_start = VM_MIN_KERNEL_ADDRESS,
 };
 
@@ -231,23 +231,24 @@ struct pool pmap_pv_pool;
 #ifndef PMAP_PV_LOWAT
 #define	PMAP_PV_LOWAT	16
 #endif
-int		pmap_pv_lowat = PMAP_PV_LOWAT;
+int	pmap_pv_lowat = PMAP_PV_LOWAT;
 
-bool		pmap_initialized = false;
+bool	pmap_initialized = false;
 #define	PMAP_PAGE_COLOROK_P(a, b) \
 		int)(a) ^ (int)(b)) & pmap_page_colormask) == 0)
-u_int		pmap_page_colormask;
+u_int	pmap_page_colormask;
 
-#define PAGE_IS_MANAGED(pa)	\
-	(pmap_initialized == true && vm_physseg_find(atop(pa), NULL) != -1)
+#define PAGE_IS_MANAGED(pa)	(pmap_initialized && uvm_pageismanaged(pa))
 
 #define PMAP_IS_ACTIVE(pm)		\
 	((pm) == pmap_kernel() || 	\
 	 (pm) == curlwp->l_proc->p_vmspace->vm_map.pmap)
 
 /* Forward function declarations */
+void pmap_page_remove(struct vm_page *);
+static void pmap_pvlist_check(struct vm_page_md *);
 void pmap_remove_pv(pmap_t, vaddr_t, struct vm_page *, bool);
-void 

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

2016-07-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 03:45:59 UTC 2016

Modified Files:
src/sys/arch/evbmips/conf: INSTALL_MALTA32

Log Message:
Add makeoptionsNEED_MDSETIMAGE="yes"


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/conf/INSTALL_MALTA32

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/evbmips/conf/INSTALL_MALTA32
diff -u src/sys/arch/evbmips/conf/INSTALL_MALTA32:1.2 src/sys/arch/evbmips/conf/INSTALL_MALTA32:1.3
--- src/sys/arch/evbmips/conf/INSTALL_MALTA32:1.2	Mon Dec 14 00:46:01 2009
+++ src/sys/arch/evbmips/conf/INSTALL_MALTA32	Mon Jul 11 03:45:59 2016
@@ -1,8 +1,8 @@
-# $NetBSD: INSTALL_MALTA32,v 1.2 2009/12/14 00:46:01 matt Exp $
+# $NetBSD: INSTALL_MALTA32,v 1.3 2016/07/11 03:45:59 matt Exp $
 
 include		"arch/evbmips/conf/MALTA32"
 
-#ident 		"INSTALL_MALTA32-$Revision: 1.2 $"
+#ident 		"INSTALL_MALTA32-$Revision: 1.3 $"
 
 # Enable the hooks used for initializing the root memory-disk.
 # The ramdisk size must be kept in sync manually with the size of
@@ -12,3 +12,7 @@ options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT		# force root on memory disk
 options 	MEMORY_DISK_SERVER=0		# no userspace memory disk
 options 	MEMORY_DISK_ROOT_SIZE=12288	# size of memory disk, in blocks
+
+#options 	UVMHIST
+#options 	UVMHIST_PRINT
+makeoptions	NEED_MDSETIMAGE="yes"



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

2016-07-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul 11 01:50:17 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Add machdep.fpu_present sysctl node


To generate a diff of this commit:
cvs rdiff -u -r1.269 -r1.270 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.269 src/sys/arch/mips/mips/mips_machdep.c:1.270
--- src/sys/arch/mips/mips/mips_machdep.c:1.269	Thu Jun 11 15:48:57 2015
+++ src/sys/arch/mips/mips/mips_machdep.c	Mon Jul 11 01:50:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.269 2015/06/11 15:48:57 matt Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.270 2016/07/11 01:50:17 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.269 2015/06/11 15:48:57 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.270 2016/07/11 01:50:17 matt Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -1719,6 +1719,16 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 		   NULL, MIPS_HAS_LMMI, NULL, 0,
 		   CTL_MACHDEP, CPU_LMMI, CTL_EOL);
 #endif
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
+   CTLTYPE_INT, "fpu_present", NULL,
+   NULL,
+#ifdef NOFPU
+		   0,
+#else
+		   1,
+#endif
+		   NULL, 0, CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 }
 
 /*



CVS commit: src/sys/rump

2016-07-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul  9 05:52:22 UTC 2016

Modified Files:
src/sys/rump: Makefile.rump

Log Message:
Pass down ${CPUFLAGS}


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/rump/Makefile.rump

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/Makefile.rump
diff -u src/sys/rump/Makefile.rump:1.120 src/sys/rump/Makefile.rump:1.121
--- src/sys/rump/Makefile.rump:1.120	Sun Nov 15 13:50:10 2015
+++ src/sys/rump/Makefile.rump	Sat Jul  9 05:52:22 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rump,v 1.120 2015/11/15 13:50:10 pooka Exp $
+#	$NetBSD: Makefile.rump,v 1.121 2016/07/09 05:52:22 matt Exp $
 #
 
 .if !defined(_RUMP_MK)
@@ -149,19 +149,19 @@ RUMPCOMP_USER_WERROR = ${${_NOWERROR} ==
 .for rcusrc in ${RUMPCOMP_USER_SRCS:R}
 ${rcusrc}.d: ${rcusrc}.c
 	${_MKTARGET_CREATE}
-	${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*${rcusrc}.c}
+	${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${CPUFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*${rcusrc}.c}
 
 ${rcusrc}.o: ${rcusrc}.c
 	${_MKTARGET_COMPILE}
-	${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
+	${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
 
 ${rcusrc}.pico: ${rcusrc}.c
 	${_MKTARGET_COMPILE}
-	${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
+	${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
 
 ${rcusrc}.po: ${rcusrc}.c
 	${_MKTARGET_COMPILE}
-	${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
+	${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
 
 RUMPOBJ_NORENAME+=${rcusrc}.o ${rcusrc}.pico ${rcusrc}.po
 SRCS+=${rcusrc}.c



CVS commit: src/share/mk

2016-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  7 20:52:53 UTC 2016

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

Log Message:
Add placeholder for compiing earmv7* with -mthumb.
Preserve $d/$a/$t for all ARM binaries regardless of endian.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/share/mk/bsd.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/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.259 src/share/mk/bsd.sys.mk:1.260
--- src/share/mk/bsd.sys.mk:1.259	Tue Jun 14 13:26:45 2016
+++ src/share/mk/bsd.sys.mk	Thu Jul  7 20:52:53 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.259 2016/06/14 13:26:45 christos Exp $
+#	$NetBSD: bsd.sys.mk,v 1.260 2016/07/07 20:52:53 matt Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -159,6 +159,11 @@ COPTS+=		-mhard-float
 FOPTS+=		-mhard-float
 .endif
 
+#.if !empty(MACHINE_ARCH:Mearmv7*)
+#COPTS+=		-mthumb
+#FOPTS+=		-mthumb
+#.endif
+
 .if ${MKIEEEFP:Uno} != "no"
 .if ${MACHINE_ARCH} == "alpha"
 CFLAGS+=	-mieee
@@ -289,7 +294,7 @@ YFLAGS+=	${YPREFIX:D-p${YPREFIX}} ${YHEA
 .if ${MACHINE_ARCH} == aarch64eb
 # AARCH64 big endian needs to preserve $x/$d symbols for the linker.
 OBJCOPYLIBFLAGS_EXTRA=-w -K '[$$][dx]' -K '[$$][dx]\.*'
-.elif !empty(MACHINE_ARCH:M*arm*eb)
+.elif ${MACHINE_CPU} == "arm"
 # ARM big endian needs to preserve $a/$d/$t symbols for the linker.
 OBJCOPYLIBFLAGS_EXTRA=-w -K '[$$][adt]' -K '[$$][adt]\.*'
 .endif



CVS commit: src/distrib/evbppc/ramdisk

2016-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  7 06:28:57 UTC 2016

Modified Files:
src/distrib/evbppc/ramdisk: list

Log Message:
Add sbin/sysctl


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/evbppc/ramdisk/list

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

Modified files:

Index: src/distrib/evbppc/ramdisk/list
diff -u src/distrib/evbppc/ramdisk/list:1.20 src/distrib/evbppc/ramdisk/list:1.21
--- src/distrib/evbppc/ramdisk/list:1.20	Tue Jul 24 20:50:14 2012
+++ src/distrib/evbppc/ramdisk/list	Thu Jul  7 06:28:57 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.20 2012/07/24 20:50:14 matt Exp $
+#	$NetBSD: list,v 1.21 2016/07/07 06:28:57 matt Exp $
 
 SRCDIRS	bin sbin usr.bin usr.sbin
 
@@ -54,6 +54,7 @@ PROG	sbin/restore	sbin/rrestore
 PROG	sbin/route
 PROG	sbin/shutdown
 PROG	sbin/swapctl
+PROG	sbin/sysctl
 PROG	sbin/umount
 
 PROG	usr/bin/cksum	usr/bin/md5	usr/bin/sha1	usr/bin/sum



CVS commit: src/distrib/evbarm/instkernel/ramdisk

2016-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  7 06:28:20 UTC 2016

Modified Files:
src/distrib/evbarm/instkernel/ramdisk: Makefile

Log Message:
When building earmv7 ramdisks, compile with -mthumb -mthumb-interwork
to save space.  Think of it as -Os on steriods.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/evbarm/instkernel/ramdisk/Makefile

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

Modified files:

Index: src/distrib/evbarm/instkernel/ramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/ramdisk/Makefile:1.13 src/distrib/evbarm/instkernel/ramdisk/Makefile:1.14
--- src/distrib/evbarm/instkernel/ramdisk/Makefile:1.13	Thu Jan  9 22:48:16 2014
+++ src/distrib/evbarm/instkernel/ramdisk/Makefile	Thu Jul  7 06:28:20 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2014/01/09 22:48:16 matt Exp $
+#	$NetBSD: Makefile,v 1.14 2016/07/07 06:28:20 matt Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -9,6 +9,9 @@ MAKEFS_FLAGS=	-f 15
 
 WARNS=		1
 DBG=		-Os
+.if !empty(MACHINE_ARCH:Mearmv7*)
+DBG+=		-mthumb -mthumb-interwork
+.endif
 
 CRUNCHBIN=	ramdiskbin
 LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst



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

2015-08-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 24 04:51:18 UTC 2015

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

Log Message:
Fix mbuf dmasyncing for extended MMU kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/arm/arm32/bus_dma.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/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.92 src/sys/arch/arm/arm32/bus_dma.c:1.93
--- src/sys/arch/arm/arm32/bus_dma.c:1.92	Fri Aug 21 20:52:47 2015
+++ src/sys/arch/arm/arm32/bus_dma.c	Mon Aug 24 04:51:18 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.92 2015/08/21 20:52:47 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.93 2015/08/24 04:51:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include opt_arm_bus_space.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.92 2015/08/21 20:52:47 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.93 2015/08/24 04:51:18 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -775,13 +775,19 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 
 	switch (ops) {
 	case BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE:
+#ifdef ARM_MMU_EXTENDED
+		(void)readonly_p;
+#else
 		if (!readonly_p) {
+#endif
 			STAT_INCR(sync_prereadwrite);
 			cpu_dcache_wbinv_range(va, len);
 			cpu_sdcache_wbinv_range(va, pa, len);
 			break;
+#ifndef ARM_MMU_EXTENDED
 		}
 		/* FALLTHROUGH */
+#endif
 
 	case BUS_DMASYNC_PREREAD: {
 		const size_t line_size = arm_dcache_align;
@@ -909,7 +915,8 @@ _bus_dmamap_sync_mbuf(bus_dma_tag_t t, b
 
 		/*
 		 * We can save a lot of work here if we know the mapping
-		 * is read-only at the MMU:
+		 * is read-only at the MMU and we aren't using the armv6+
+		 * MMU:
 		 *
 		 * If a mapping is read-only, no dirty cache blocks will
 		 * exist for it.  If a writable mapping was made read-only,



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

2015-08-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 21 20:52:47 UTC 2015

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

Log Message:
Assert we aren't trying to sync a read-only mbuf as PREREAD.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/arm/arm32/bus_dma.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/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.91 src/sys/arch/arm/arm32/bus_dma.c:1.92
--- src/sys/arch/arm/arm32/bus_dma.c:1.91	Wed Feb 25 13:52:42 2015
+++ src/sys/arch/arm/arm32/bus_dma.c	Fri Aug 21 20:52:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.91 2015/02/25 13:52:42 joerg Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.92 2015/08/21 20:52:47 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include opt_arm_bus_space.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.91 2015/02/25 13:52:42 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.92 2015/08/21 20:52:47 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -924,9 +924,15 @@ _bus_dmamap_sync_mbuf(bus_dma_tag_t t, b
 		 * cache), this will have to be revisited.
 		 */
 
-		if ((ds-_ds_flags  _BUS_DMAMAP_COHERENT) == 0)
+		if ((ds-_ds_flags  _BUS_DMAMAP_COHERENT) == 0) {
+			/*
+			 * If we are doing preread (DMAing into the mbuf),
+			 * this mbuf better not be readonly, 
+			 */
+			KASSERT(!(ops  BUS_DMASYNC_PREREAD) || !M_ROMAP(m));
 			_bus_dmamap_sync_segment(va, pa, seglen, ops,
 			M_ROMAP(m));
+		}
 		voff += seglen;
 		ds_off += seglen;
 		len -= seglen;



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm32

2015-08-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 13 00:07:15 UTC 2015

Modified Files:
src/sys/arch/arm/arm32 [matt-nb5-mips64]: arm32_kvminit.c

Log Message:
Make sure the amount of direct mapped memory doesn't cross over into the
mappable KVA range.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.3 -r1.22.2.4 src/sys/arch/arm/arm32/arm32_kvminit.c

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

Modified files:

Index: src/sys/arch/arm/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.3 src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.4
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.3	Mon Mar 24 07:37:39 2014
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Thu Aug 13 00:07:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.22.2.3 2014/03/24 07:37:39 matt Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.22.2.4 2015/08/13 00:07:15 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.22.2.3 2014/03/24 07:37:39 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.22.2.4 2015/08/13 00:07:15 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -773,6 +773,14 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 		}
 	}
 
+	// The amount we can direct is limited by the start of the
+	// virtual part of the kernel address space.  Don't overrun
+	// into it. 
+	if (mapallmem_p  cur_pv.pv_va + cur_pv.pv_size  kernel_vm_base) {
+		cur_pv.pv_size = kernel_vm_base - cur_pv.pv_va;
+	}
+
+
 	/*
 	 * Now we map the final chunk.
 	 */



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

2015-07-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul 29 04:59:48 UTC 2015

Modified Files:
src/sys/arch/arm/cortex: gic.c

Log Message:
Adjust some of IPLs of various IPIs.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/cortex/gic.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/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.19 src/sys/arch/arm/cortex/gic.c:1.20
--- src/sys/arch/arm/cortex/gic.c:1.19	Wed Apr 15 15:45:06 2015
+++ src/sys/arch/arm/cortex/gic.c	Wed Jul 29 04:59:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.19 2015/04/15 15:45:06 matt Exp $	*/
+/*	$NetBSD: gic.c,v 1.20 2015/07/29 04:59:48 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 #define _INTR_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gic.c,v 1.19 2015/04/15 15:45:06 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: gic.c,v 1.20 2015/07/29 04:59:48 matt Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -612,13 +612,13 @@ armgic_attach(device_t parent, device_t 
 #ifdef MULTIPROCESSOR
 	intr_establish(ARMGIC_SGI_IPIBASE + IPI_AST, IPL_VM,
 	IST_MPSAFE | IST_EDGE, pic_ipi_ast, (void *)-1);
-	intr_establish(ARMGIC_SGI_IPIBASE + IPI_XCALL, IPL_VM,
+	intr_establish(ARMGIC_SGI_IPIBASE + IPI_XCALL, IPL_HIGH,
 	IST_MPSAFE | IST_EDGE, pic_ipi_xcall, (void *)-1);
-	intr_establish(ARMGIC_SGI_IPIBASE + IPI_GENERIC, IPL_VM,
+	intr_establish(ARMGIC_SGI_IPIBASE + IPI_GENERIC, IPL_HIGH,
 	IST_MPSAFE | IST_EDGE, pic_ipi_generic, (void *)-1);
 	intr_establish(ARMGIC_SGI_IPIBASE + IPI_NOP, IPL_VM,
 	IST_MPSAFE | IST_EDGE, pic_ipi_nop, (void *)-1);
-	intr_establish(ARMGIC_SGI_IPIBASE + IPI_SHOOTDOWN, IPL_VM,
+	intr_establish(ARMGIC_SGI_IPIBASE + IPI_SHOOTDOWN, IPL_SCHED,
 	IST_MPSAFE | IST_EDGE, pic_ipi_shootdown, (void *)-1);
 #ifdef DDB
 	intr_establish(ARMGIC_SGI_IPIBASE + IPI_DDB, IPL_HIGH,



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

2015-07-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul 26 00:15:53 UTC 2015

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

Log Message:
KASSERT-KASSERTMSG


To generate a diff of this commit:
cvs rdiff -u -r1.325 -r1.326 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.325 src/sys/arch/arm/arm32/pmap.c:1.326
--- src/sys/arch/arm/arm32/pmap.c:1.325	Tue Jun  9 10:44:55 2015
+++ src/sys/arch/arm/arm32/pmap.c	Sun Jul 26 00:15:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.325 2015/06/09 10:44:55 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.326 2015/07/26 00:15:53 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -216,7 +216,7 @@
 
 #include arm/locore.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.325 2015/06/09 10:44:55 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.326 2015/07/26 00:15:53 matt Exp $);
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -7875,7 +7875,7 @@ pmap_map_poolpage(paddr_t pa)
 {
 	bool ok __diagused;
 	vaddr_t va = pmap_direct_mapped_phys(pa, ok, 0);
-	KASSERT(ok);
+	KASSERTMSG(ok, pa %#lx not direct mappable, pa);
 #if defined(PMAP_CACHE_VIPT)  !defined(ARM_MMU_EXTENDED)
 	if (arm_cache_prefer_mask != 0) {
 		struct vm_page * const pg = PHYS_TO_VM_PAGE(pa);



CVS commit: src/sys/sys

2015-07-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 24 21:09:25 UTC 2015

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

Log Message:
Add a few more EM_*


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/sys/exec_elf.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/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.146 src/sys/sys/exec_elf.h:1.147
--- src/sys/sys/exec_elf.h:1.146	Wed May 20 04:08:54 2015
+++ src/sys/sys/exec_elf.h	Fri Jul 24 21:09:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.146 2015/05/20 04:08:54 matt Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.147 2015/07/24 21:09:25 matt Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -305,8 +305,15 @@ typedef struct {
 #define EM_SEP		108	/* Sharp embedded microprocessor */
 #define EM_ARCA		109	/* Arca RISC microprocessor */
 #define EM_UNICORE	110	/* UNICORE from PKU-Unity Ltd. and MPRC Peking University */
+#define EM_ALTERA_NIOS2	113	/* Altera Nios II soft-core processor */
 #define EM_AARCH64	183	/* AArch64 64-bit ARM microprocessor */
-#define EM_RISCV	243	/* RISCV */
+#define EM_AVR32	185	/* Atmel Corporation 32-bit microprocessor family*/
+#define EM_TILE64	187	/* Tilera TILE64 multicore architecture family */
+#define EM_TILEPRO	188	/* Tilera TILEPro multicore architecture family */
+#define EM_MICROBLAZE	189	/* Xilinx MicroBlaze 32-bit RISC soft processor core */
+#define EM_TILEGX	192	/* Tilera TILE-GX multicore architecture family */
+#define EM_Z80		220	/* Zilog Z80 */
+#define EM_RISCV	243	/* RISC-V */
 
 /* Unofficial machine types follow */
 #define EM_AVR32	6317	/* used by NetBSD/avr32 */



CVS commit: src/sys/sys

2015-07-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 24 21:27:03 UTC 2015

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

Log Message:
Remove unofficial AVR32


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/sys/exec_elf.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/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.147 src/sys/sys/exec_elf.h:1.148
--- src/sys/sys/exec_elf.h:1.147	Fri Jul 24 21:09:25 2015
+++ src/sys/sys/exec_elf.h	Fri Jul 24 21:27:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.147 2015/07/24 21:09:25 matt Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.148 2015/07/24 21:27:03 matt Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -316,7 +316,6 @@ typedef struct {
 #define EM_RISCV	243	/* RISC-V */
 
 /* Unofficial machine types follow */
-#define EM_AVR32	6317	/* used by NetBSD/avr32 */
 #define EM_ALPHA_EXP	36902	/* used by NetBSD/alpha; obsolete */
 #define EM_NUM		36903
 



CVS commit: src/sys/netinet

2015-07-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 24 04:31:21 UTC 2015

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
Make sure that snd_win doesn't go negative.


To generate a diff of this commit:
cvs rdiff -u -r1.342 -r1.343 src/sys/netinet/tcp_input.c

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

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.342 src/sys/netinet/tcp_input.c:1.343
--- src/sys/netinet/tcp_input.c:1.342	Wed Jul 15 09:20:18 2015
+++ src/sys/netinet/tcp_input.c	Fri Jul 24 04:31:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.342 2015/07/15 09:20:18 ozaki-r Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.343 2015/07/24 04:31:20 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.342 2015/07/15 09:20:18 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.343 2015/07/24 04:31:20 matt Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -2713,7 +2713,10 @@ after_listen:
 tp-t_lastm = NULL;
 			sbdrop(so-so_snd, acked);
 			tp-t_lastoff -= acked;
-			tp-snd_wnd -= acked;
+			if (tp-snd_wnd  acked)
+tp-snd_wnd -= acked;
+			else
+tp-snd_wnd = 0;
 			ourfinisacked = 0;
 		}
 		sowwakeup(so);



CVS commit: src/sys/netinet

2015-07-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 24 04:33:50 UTC 2015

Modified Files:
src/sys/netinet: tcp_output.c

Log Message:
If we are sending a window probe and there's unacked data in the socket, make
sure at least the persist timer is running.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/netinet/tcp_output.c

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

Modified files:

Index: src/sys/netinet/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.183 src/sys/netinet/tcp_output.c:1.184
--- src/sys/netinet/tcp_output.c:1.183	Sat May 16 01:15:34 2015
+++ src/sys/netinet/tcp_output.c	Fri Jul 24 04:33:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_output.c,v 1.183 2015/05/16 01:15:34 kefren Exp $	*/
+/*	$NetBSD: tcp_output.c,v 1.184 2015/07/24 04:33:50 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.183 2015/05/16 01:15:34 kefren Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.184 2015/07/24 04:33:50 matt Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -1533,14 +1533,24 @@ send:
 		 * of retransmit time.
 		 */
 timer:
-		if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0 
-			((sack_rxmit  tp-snd_nxt != tp-snd_max) ||
-		tp-snd_nxt != tp-snd_una)) {
-			if (TCP_TIMER_ISARMED(tp, TCPT_PERSIST)) {
-TCP_TIMER_DISARM(tp, TCPT_PERSIST);
+		if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0) {
+			if ((sack_rxmit  tp-snd_nxt != tp-snd_max)
+			|| tp-snd_nxt != tp-snd_una) {
+if (TCP_TIMER_ISARMED(tp, TCPT_PERSIST)) {
+	TCP_TIMER_DISARM(tp, TCPT_PERSIST);
+	tp-t_rxtshift = 0;
+}
+TCP_TIMER_ARM(tp, TCPT_REXMT, tp-t_rxtcur);
+			} else if (len == 0  so-so_snd.sb_cc  0
+			 TCP_TIMER_ISARMED(tp, TCPT_PERSIST) == 0) {
+/*
+ * If we are sending a window probe and there's
+ * unacked data in the socket, make sure at
+ * least the persist timer is running.
+ */
 tp-t_rxtshift = 0;
+tcp_setpersist(tp);
 			}
-			TCP_TIMER_ARM(tp, TCPT_REXMT, tp-t_rxtcur);
 		}
 	} else
 		if (SEQ_GT(tp-snd_nxt + len, tp-snd_max))



CVS commit: src/distrib/zaurus/ramdisk

2015-07-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 21 01:53:44 UTC 2015

Modified Files:
src/distrib/zaurus/ramdisk: Makefile

Log Message:
Adding -DNDEBUG saves about 5KB of text and disable asserts.
Adding -mthumb -mthumb-interwork, knowing this is Xscale which
has thumb, saves about 340KB of text.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/distrib/zaurus/ramdisk/Makefile

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

Modified files:

Index: src/distrib/zaurus/ramdisk/Makefile
diff -u src/distrib/zaurus/ramdisk/Makefile:1.19 src/distrib/zaurus/ramdisk/Makefile:1.20
--- src/distrib/zaurus/ramdisk/Makefile:1.19	Sun Jul 19 09:23:53 2015
+++ src/distrib/zaurus/ramdisk/Makefile	Tue Jul 21 01:53:44 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2015/07/19 09:23:53 martin Exp $
+#	$NetBSD: Makefile,v 1.20 2015/07/21 01:53:44 matt Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -9,6 +9,8 @@ MAKEFS_FLAGS=	-f 14
 
 WARNS=		1
 DBG=		-Os
+DBG+=		-mthumb -mthumb-interwork
+DBG+=		-DNDEBUG
 
 CRUNCHBIN=	ramdiskbin
 LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 17 20:32:27 UTC 2015

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Deal with  1GB of memory.


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.3 -r1.7.4.4 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_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/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.4
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3	Wed Mar 26 02:15:02 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Fri Jul 17 20:32:27 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_broadcom.h
@@ -258,6 +258,20 @@ initarm(void *arg)
 #endif
 	const bool bigmem_p = (memsize  PGSHIFT)  bp_first256.bp_pages;
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+	const bool mapallmem_p = true;
+#ifndef PMAP_NEED_ALLOC_POOLPAGE
+	if (memsize  KERNEL_VM_BASE - KERNEL_BASE) {
+		printf(%s: dropping RAM size from %luMB to %uMB\n,
+		   __func__, (unsigned long) (ram_size  20),
+		   (KERNEL_VM_BASE - KERNEL_BASE)  20);
+		memsize = KERNEL_VM_BASE - KERNEL_BASE;
+	}
+#endif
+#else
+	const bool mapallmem_p = false;
+#endif
+	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 	arm32_bootmem_init(KERN_VTOPHYS(KERNEL_BASE), memsize,
 	(paddr_t)KERNEL_BASE_phys);
 
@@ -273,7 +287,8 @@ initarm(void *arg)
 	 * abtstack, undstack, kernelstack, msgbufphys will be set to point to
 	 * the memory that was allocated for them.
 	 */
-	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap, true);
+	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
+	mapallmem_p);
 
 	cpu_reset_address = bcm53xx_system_reset;
 	/* we've a specific device_register routine */



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

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 18 00:57:10 UTC 2015

Added Files:
src/sys/arch/evbarm/conf: CUBOX-I_INSTALL

Log Message:
Add install kernel for cubox-i


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/CUBOX-I_INSTALL

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/evbarm/conf/CUBOX-I_INSTALL
diff -u /dev/null src/sys/arch/evbarm/conf/CUBOX-I_INSTALL:1.1
--- /dev/null	Sat Jul 18 00:57:10 2015
+++ src/sys/arch/evbarm/conf/CUBOX-I_INSTALL	Sat Jul 18 00:57:10 2015
@@ -0,0 +1,10 @@
+#	$NetBSD: CUBOX-I_INSTALL,v 1.1 2015/07/18 00:57:10 matt Exp $
+#
+#	CUBOX-I_INSTALL -- CUBOX-I kernel with installation-sized
+#	ramdisk
+#
+
+include arch/evbarm/conf/CUBOX-I
+include arch/evbarm/conf/INSTALL
+
+options BOOTHOWTO=RB_SINGLE



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

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 17 20:29:29 UTC 2015

Modified Files:
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c

Log Message:
Deal with more than 1GB of RAM.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/bcm53xx/bcm53xx_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/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.8 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.9
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.8	Sat Mar 29 14:02:46 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Fri Jul 17 20:29:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.8 2014/03/29 14:02:46 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.9 2015/07/17 20:29:29 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.8 2014/03/29 14:02:46 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.9 2015/07/17 20:29:29 matt Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_broadcom.h
@@ -250,6 +250,20 @@ initarm(void *arg)
 #endif
 	const bool bigmem_p = (memsize  20)  256; 
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+	const bool mapallmem_p = true;
+#ifndef PMAP_NEED_ALLOC_POOLPAGE
+	if (memsize  KERNEL_VM_BASE - KERNEL_BASE) {
+		printf(%s: dropping RAM size from %luMB to %uMB\n,
+		   __func__, (unsigned long) (ram_size  20),
+		   (KERNEL_VM_BASE - KERNEL_BASE)  20);
+		memsize = KERNEL_VM_BASE - KERNEL_BASE;
+	}
+#endif
+#else
+	const bool mapallmem_p = false;
+#endif
+	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 	arm32_bootmem_init(KERN_VTOPHYS(KERNEL_BASE), memsize,
 	(paddr_t)KERNEL_BASE_phys);
 
@@ -265,7 +279,8 @@ initarm(void *arg)
 	 * abtstack, undstack, kernelstack, msgbufphys will be set to point to
 	 * the memory that was allocated for them.
 	 */
-	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap, true);
+	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
+	mapallmem_p);
 
 	cpu_reset_address = bcm53xx_system_reset;
 	/* we've a specific device_register routine */



CVS commit: src/etc/etc.evbarm

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 18 00:57:35 UTC 2015

Modified Files:
src/etc/etc.evbarm: Makefile.inc

Log Message:
Build CUBOX-I kernels


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/etc/etc.evbarm/Makefile.inc

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

Modified files:

Index: src/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.77 src/etc/etc.evbarm/Makefile.inc:1.78
--- src/etc/etc.evbarm/Makefile.inc:1.77	Wed Jul 15 11:27:13 2015
+++ src/etc/etc.evbarm/Makefile.inc	Sat Jul 18 00:57:35 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.77 2015/07/15 11:27:13 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.78 2015/07/18 00:57:35 matt Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -98,6 +98,8 @@ EVBARM_BOARDS.armv7+=		CUBIEBOARD
 EVBARM_BOARDS.armv7hf+= 	CUBIEBOARD
 EVBARM_BOARDS.armv7+=		CUBIETRUCK
 EVBARM_BOARDS.armv7hf+= 	CUBIETRUCK
+EVBARM_BOARDS.armv7+=		CUBOX-I
+EVBARM_BOARDS.armv7hf+= 	CUBOX-I
 EVBARM_BOARDS.armv7+=		HUMMINGBIRD_A31
 EVBARM_BOARDS.armv7hf+=		HUMMINGBIRD_A31
 #EVBARM_BOARDS.armv7+=		IGEPV2



CVS commit: src/share/mk

2015-07-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  9 14:50:08 UTC 2015

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

Log Message:
Add _MKTARGET_LINK


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/share/mk/bsd.kmodule.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.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.54 src/share/mk/bsd.kmodule.mk:1.55
--- src/share/mk/bsd.kmodule.mk:1.54	Wed Jun 24 13:42:53 2015
+++ src/share/mk/bsd.kmodule.mk	Thu Jul  9 14:50:08 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.54 2015/06/24 13:42:53 matt Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.55 2015/07/09 14:50:08 matt Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -176,6 +176,7 @@ ${PROG}: ${KMOD}_tmp.o ${KMOD}_tramp.o
 .endif
 .else
 ${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT}
+	${_MKTARGET_LINK}
 	${CC} ${LDFLAGS} -nostdlib -r -Wl,-T,${KMODSCRIPT},-d \
 		-Wl,-Map=${.TARGET}.map \
 		-o ${.TARGET} ${OBJS}



CVS commit: src/sys/modules

2015-07-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  9 14:41:30 UTC 2015

Modified Files:
src/sys/modules: Makefile

Log Message:
Don't build compat_netbsd32 if mips64  building mips-n32


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/modules/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.155 src/sys/modules/Makefile:1.156
--- src/sys/modules/Makefile:1.155	Sun May 17 05:21:38 2015
+++ src/sys/modules/Makefile	Thu Jul  9 14:41:30 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.155 2015/05/17 05:21:38 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.156 2015/07/09 14:41:30 matt Exp $
 
 .include bsd.own.mk
 
@@ -206,7 +206,8 @@ SUBDIR+=	wmihp
 SUBDIR+=	wmimsi
 .endif
 
-.if ${MACHINE_CPU} == arm || !empty(MACHINE_ARCH:Mmips64*)
+.if ${MACHINE_CPU} == arm \
+|| (!empty(MACHINE_ARCH:Mmips64*)  !defined(BSD_MK_COMPAT_FILE))
 SUBDIR+=	compat_netbsd32
 .endif
 



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

2015-07-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  9 14:41:54 UTC 2015

Modified Files:
src/sys/arch/mips/mips: genassym.cf

Log Message:
More ifndef _MODULE


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/mips/mips/genassym.cf

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/mips/genassym.cf
diff -u src/sys/arch/mips/mips/genassym.cf:1.63 src/sys/arch/mips/mips/genassym.cf:1.64
--- src/sys/arch/mips/mips/genassym.cf:1.63	Wed Jul  8 15:05:24 2015
+++ src/sys/arch/mips/mips/genassym.cf	Thu Jul  9 14:41:54 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.63 2015/07/08 15:05:24 matt Exp $
+#	$NetBSD: genassym.cf,v 1.64 2015/07/09 14:41:54 matt Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -124,12 +124,14 @@ define	L_PRIORITY		offsetof(struct lwp, 
 define	L_PRIVATE		offsetof(struct lwp, l_private)
 define	L_PROC			offsetof(struct lwp, l_proc)
 define	L_STAT			offsetof(struct lwp, l_stat)
+ifndef _MODULE
 define	L_MD_UTF		offsetof(struct lwp, l_md.md_utf)
 if USPACE  PAGE_SIZE
 define	L_MD_UPTE_0		offsetof(struct lwp, l_md.md_upte[0])
 define	L_MD_UPTE_1		offsetof(struct lwp, l_md.md_upte[1])
 endif
 define	L_MD_ASTPENDING		offsetof(struct lwp, l_md.md_astpending)
+endif
 define	L_WCHAN			offsetof(struct lwp, l_wchan)
 
 define	P_RASLIST		offsetof(struct proc, p_raslist)



CVS commit: src/distrib/sets

2015-07-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul  9 18:19:34 UTC 2015

Modified Files:
src/distrib/sets: sets.subr
src/distrib/sets/lists/modules: ad.mips

Log Message:
Add nocompatmodules keyword to stop the expanding of a kmod to compatmodules.
Use for compat_netbsd32 on mips


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/distrib/sets/sets.subr
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/modules/ad.mips

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/sets.subr
diff -u src/distrib/sets/sets.subr:1.171 src/distrib/sets/sets.subr:1.172
--- src/distrib/sets/sets.subr:1.171	Sun Jun 28 23:49:33 2015
+++ src/distrib/sets/sets.subr	Thu Jul  9 18:19:34 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.171 2015/06/28 23:49:33 matt Exp $
+#	$NetBSD: sets.subr,v 1.172 2015/07/09 18:19:34 matt Exp $
 #
 
 #
@@ -179,7 +179,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.171 2015/06/28 23:49:33 matt Exp $
+# 	# $NetBSD: sets.subr,v 1.172 2015/07/09 18:19:34 matt Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -395,11 +395,13 @@ list_set_files()
 	iscompatdir = 1
 } else if (kw in compatfilekeywords) {
 	iscompatfile = 1
+} else if (kw == nocompatmodules) {
+	havekmod = -1
 } else if (kw in ignoredkeywords) {
 	# ignore
 } else if (! (kw in wanted)) {
 	show = 0
-} else if (kw == kmod) {
+} else if (kw == kmod  havekmod == 0) {
 	havekmod = 1
 }
 if (kw == obsolete)
@@ -411,7 +413,7 @@ list_set_files()
 next
 
 			list[$1] = $0
-			if (havekmod  substr($1,1,l_kmodpat) == kmodpat) {
+			if (havekmod  0  substr($1,1,l_kmodpat) == kmodpat) {
 for (d in kmodarchdirs) {
 	xd = ./stand/ kmodarchdirs[d]
 	xfile = xd substr($1, l_kmodpat+1)

Index: src/distrib/sets/lists/modules/ad.mips
diff -u src/distrib/sets/lists/modules/ad.mips:1.4 src/distrib/sets/lists/modules/ad.mips:1.5
--- src/distrib/sets/lists/modules/ad.mips:1.4	Sat May  9 14:22:34 2015
+++ src/distrib/sets/lists/modules/ad.mips	Thu Jul  9 18:19:34 2015
@@ -1,5 +1,5 @@
-# $NetBSD: ad.mips,v 1.4 2015/05/09 14:22:34 matt Exp $
-./@MODULEDIR@/compat_netbsd32			base-kernel-modules	kmod,arch64
-./@MODULEDIR@/compat_netbsd32/compat_netbsd32.kmod	base-kernel-modules	kmod,arch64
+# $NetBSD: ad.mips,v 1.5 2015/07/09 18:19:34 matt Exp $
+./@MODULEDIR@/compat_netbsd32			base-kernel-modules	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32/compat_netbsd32.kmod	base-kernel-modules	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/exec_elf32			base-kernel-modules	kmod
 ./@MODULEDIR@/exec_elf32/exec_elf32.kmod	base-kernel-modules	kmod



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

2015-07-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul  8 14:53:07 UTC 2015

Modified Files:
src/sys/arch/mips/mips: genassym.cf

Log Message:
Add ifndef _MODULE around VM parameters.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/mips/genassym.cf

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/mips/genassym.cf
diff -u src/sys/arch/mips/mips/genassym.cf:1.61 src/sys/arch/mips/mips/genassym.cf:1.62
--- src/sys/arch/mips/mips/genassym.cf:1.61	Thu Jun 11 15:50:17 2015
+++ src/sys/arch/mips/mips/genassym.cf	Wed Jul  8 14:53:07 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.61 2015/06/11 15:50:17 matt Exp $
+#	$NetBSD: genassym.cf,v 1.62 2015/07/08 14:53:07 matt Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -91,11 +91,17 @@ include mips/vmparam.h
 include mips/pte.h
 include mips/locore.h
 
+define	SIGFPE		 	SIGFPE
+define	SIGILL		 	SIGILL
+define	SIGSEGV			SIGSEGV
+
+ifndef _MODULE
 define	PAGE_SIZE		PAGE_SIZE
 define	PGSHIFT			PGSHIFT
 define	NBPG			NBPG
 define	USPACE			USPACE
 define	UPAGES			UPAGES
+#endif
 
 ifdef __HAVE_FAST_SOFTINTS
 define	__HAVE_FAST_SOFTINTS	1
@@ -140,13 +146,10 @@ define	VM_MAX_KERNEL_ADDRESS	VM_MAX_KERN
 
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
 
-define	SIGFPE		 	SIGFPE
-define	SIGILL		 	SIGILL
-define	SIGSEGV			SIGSEGV
-
 #/* XXX */
 define	MIPSX_FLUSHICACHE	0
 
+ifndef _MODULE
 define	PG_ASID			PG_ASID
 define	MIPS1_PG_G		MIPS1_PG_G
 define	MIPS1_PG_V		MIPS1_PG_V
@@ -155,6 +158,7 @@ define	MIPS3_PG_V		MIPS3_PG_V
 define	MIPS3_PG_HVPN		MIPS3_PG_HVPN
 define	MIPS3_PG_ASID		MIPS3_PG_ASID
 define	MIPS3_PG_ODDPG		MIPS3_PG_ODDPG
+endif
 
 define	TF_SIZ			sizeof(struct trapframe)
 define	TF_REG_ZERO		offsetof(struct trapframe, tf_regs[_R_ZERO])



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

2015-07-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul  8 15:05:25 UTC 2015

Modified Files:
src/sys/arch/mips/mips: genassym.cf

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/mips/mips/genassym.cf

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/mips/genassym.cf
diff -u src/sys/arch/mips/mips/genassym.cf:1.62 src/sys/arch/mips/mips/genassym.cf:1.63
--- src/sys/arch/mips/mips/genassym.cf:1.62	Wed Jul  8 14:53:07 2015
+++ src/sys/arch/mips/mips/genassym.cf	Wed Jul  8 15:05:24 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.62 2015/07/08 14:53:07 matt Exp $
+#	$NetBSD: genassym.cf,v 1.63 2015/07/08 15:05:24 matt Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -101,7 +101,7 @@ define	PGSHIFT			PGSHIFT
 define	NBPG			NBPG
 define	USPACE			USPACE
 define	UPAGES			UPAGES
-#endif
+endif
 
 ifdef __HAVE_FAST_SOFTINTS
 define	__HAVE_FAST_SOFTINTS	1



CVS commit: src/lib/libc/arch/aarch64/gen

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul  7 21:40:19 UTC 2015

Modified Files:
src/lib/libc/arch/aarch64/gen: Makefile.inc
Added Files:
src/lib/libc/arch/aarch64/gen: fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
Add the fpset* routines for tests


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/aarch64/gen/fpsetmask.c \
src/lib/libc/arch/aarch64/gen/fpsetround.c \
src/lib/libc/arch/aarch64/gen/fpsetsticky.c

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

Modified files:

Index: src/lib/libc/arch/aarch64/gen/Makefile.inc
diff -u src/lib/libc/arch/aarch64/gen/Makefile.inc:1.1 src/lib/libc/arch/aarch64/gen/Makefile.inc:1.2
--- src/lib/libc/arch/aarch64/gen/Makefile.inc:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/Makefile.inc	Tue Jul  7 21:40:19 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2014/08/10 05:47:36 matt Exp $
+# $NetBSD: Makefile.inc,v 1.2 2015/07/07 21:40:19 matt Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S byte_swap_8.S
 SRCS+=	flt_rounds.c
@@ -6,6 +6,8 @@ SRCS+=	flt_rounds.c
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_ieee754.c
 SRCS+=	fpclassifyf_ieee754.c fpclassifyd_ieee754.c fpclassifyl_ieee754.c
+SRCS+=	fpgetmask.c fpgetround.c fpgetsticky.c
+SRCS+=	fpsetmask.c fpsetround.c fpsetsticky.c
 SRCS+=	isfinitef_ieee754.c isfinited_ieee754.c isfinitel_ieee754.c
 SRCS+=	isinff_ieee754.c isinfd_ieee754.c isinfl_ieee754.c
 SRCS+=	isnanf_ieee754.c isnand_ieee754.c isnanl_ieee754.c

Added files:

Index: src/lib/libc/arch/aarch64/gen/fpsetmask.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.1
--- /dev/null	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetmask.c	Tue Jul  7 21:40:19 2015
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 sys/cdefs.h
+
+__RCSID($NetBSD: fpsetmask.c,v 1.1 2015/07/07 21:40:19 matt Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/bitops.h
+
+#include namespace.h
+
+#include ieeefp.h
+
+#include aarch64/armreg.h
+
+__weak_alias(fpsetmask,_fpsetmask);
+
+fp_except_t
+fpsetmask(fp_except_t mask)
+{
+	const uint32_t old_fpcr = reg_fpcr_read();
+	const uint32_t new_fpcr = (old_fpcr  ~FPCR_ESUM)
+	| __SHIFTIN(mask, FPCR_ESUM);
+	reg_fpcr_write(new_fpcr);
+	return __SHIFTOUT(old_fpcr, FPCR_ESUM);
+}
Index: src/lib/libc/arch/aarch64/gen/fpsetround.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpsetround.c:1.1
--- /dev/null	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetround.c	Tue Jul  7 21:40:19 2015
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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

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

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul  7 21:43:46 UTC 2015

Modified Files:
src/sys/arch/arm/pic: picvar.h

Log Message:
Protect #include opt_multiprocessor.h with _KERNEL_OPT


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/pic/picvar.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/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.15 src/sys/arch/arm/pic/picvar.h:1.16
--- src/sys/arch/arm/pic/picvar.h:1.15	Wed Apr 15 15:45:06 2015
+++ src/sys/arch/arm/pic/picvar.h	Tue Jul  7 21:43:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: picvar.h,v 1.15 2015/04/15 15:45:06 matt Exp $	*/
+/*	$NetBSD: picvar.h,v 1.16 2015/07/07 21:43:46 matt Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,9 @@
 #ifndef _ARM_PIC_PICVAR_H_
 #define _ARM_PIC_PICVAR_H_
 
+#ifdef _KERNEL_OPT
 #include opt_multiprocessor.h
+#endif
 
 #ifdef MULTIPROCESSOR
 #include sys/kcpuset.h



CVS commit: src/distrib/sets

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul  8 01:06:01 UTC 2015

Modified Files:
src/distrib/sets: mkvars.mk

Log Message:
Add g to sed commands so it can deal with more than 2 archdirs.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/mkvars.mk

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

Modified files:

Index: src/distrib/sets/mkvars.mk
diff -u src/distrib/sets/mkvars.mk:1.22 src/distrib/sets/mkvars.mk:1.23
--- src/distrib/sets/mkvars.mk:1.22	Mon Jun 22 19:04:21 2015
+++ src/distrib/sets/mkvars.mk	Wed Jul  8 01:06:01 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mkvars.mk,v 1.22 2015/06/22 19:04:21 matt Exp $
+# $NetBSD: mkvars.mk,v 1.23 2015/07/08 01:06:01 matt Exp $
 
 MKEXTRAVARS= \
 	MACHINE \
@@ -95,12 +95,12 @@ mkextravars: .PHONY
 	@echo $i=${$i}
 .endfor
 .if ${MKCOMPAT} != no
-	@echo COMPATARCHDIRS=${COMPATARCHDIRS} | ${TOOL_SED} -e's/ /,/'
+	@echo COMPATARCHDIRS=${COMPATARCHDIRS} | ${TOOL_SED} -e's/ /,/g'
 .else
 	@echo COMPATARCHDIRS=
 .endif
 .if ${MKKMOD} != no  ${MKCOMPATMODULES} != no
-	@echo KMODARCHDIRS=${KMODARCHDIRS} | ${TOOL_SED} -e's/ /,/'
+	@echo KMODARCHDIRS=${KMODARCHDIRS} | ${TOOL_SED} -e's/ /,/g'
 .else
 	@echo KMODARCHDIRS=
 .endif



CVS commit: src/usr.sbin/sysinst/arch/evbarm64

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul  8 01:12:48 UTC 2015

Modified Files:
src/usr.sbin/sysinst/arch/evbarm64: Makefile md.c md.h
Added Files:
src/usr.sbin/sysinst/arch/evbarm64: msg.md.en

Log Message:
Stub out enough so this builds for evbarm64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/evbarm64/Makefile \
src/usr.sbin/sysinst/arch/evbarm64/md.h
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/evbarm64/md.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/arch/evbarm64/msg.md.en

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

Modified files:

Index: src/usr.sbin/sysinst/arch/evbarm64/Makefile
diff -u src/usr.sbin/sysinst/arch/evbarm64/Makefile:1.1 src/usr.sbin/sysinst/arch/evbarm64/Makefile:1.2
--- src/usr.sbin/sysinst/arch/evbarm64/Makefile:1.1	Sun Dec 28 11:51:11 2014
+++ src/usr.sbin/sysinst/arch/evbarm64/Makefile	Wed Jul  8 01:12:48 2015
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile,v 1.1 2014/12/28 11:51:11 martin Exp $
+#	$NetBSD: Makefile,v 1.2 2015/07/08 01:12:48 matt Exp $
 #
 # Makefile for evbarm64
 #
 
-#MENUS_MD= menus.md.${SYSINSTLANG} menus.mbr
-#MSG_MD= msg.md.${SYSINSTLANG} msg.mbr.${SYSINSTLANG}
-#MD_OPTIONS=	AOUT2ELF
+MENUS_MD=
+MENUS_MD+= menus.mbr
+MSG_MD= msg.md.${SYSINSTLANG} msg.mbr.${SYSINSTLANG}
+LANGUAGES=en
 
 .include ../../Makefile.inc
Index: src/usr.sbin/sysinst/arch/evbarm64/md.h
diff -u src/usr.sbin/sysinst/arch/evbarm64/md.h:1.1 src/usr.sbin/sysinst/arch/evbarm64/md.h:1.2
--- src/usr.sbin/sysinst/arch/evbarm64/md.h:1.1	Sun Dec 28 11:51:11 2014
+++ src/usr.sbin/sysinst/arch/evbarm64/md.h	Wed Jul  8 01:12:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.1 2014/12/28 11:51:11 martin Exp $	*/
+/*	$NetBSD: md.h,v 1.2 2015/07/08 01:12:48 matt Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -40,8 +40,6 @@
 /* Constants and defines */
 #define PART_BOOT		PART_E
 #define PART_BOOT_MSDOS		PART_BOOT
-#define PART_BOOT_PI_MOUNT	/boot
-#define PART_BOOT_PI_FLAGS	PIF_MOUNT
 
 /* Megs required for a full X installation. */
 #define XNEEDMB 60
@@ -53,19 +51,12 @@
  *  or upgrade. The standard sets are:
  *  base etc comp games man misc tests text xbase xcomp xetc xfont xserver
  */
-#define SET_KERNEL_1_NAME	kern-ADI_BRH
-#define SET_KERNEL_2_NAME	kern-INTEGRATOR
-#define SET_KERNEL_3_NAME	kern-IQ80310
-#define SET_KERNEL_4_NAME	kern-IQ80321
-#define SET_KERNEL_5_NAME	kern-MINI2440
-#define SET_KERNEL_6_NAME	kern-TEAMASA_NPWR
-#define SET_KERNEL_7_NAME	kern-TS7200
-#define SET_KERNEL_8_NAME	kern-RPI
-#define SET_KERNEL_9_NAME	kern-KUROBOX_PRO
-#define SET_KERNEL_RPI		SET_KERNEL_8
+#define SET_KERNEL_1_NAME	kern-A64EMUL
 
 #define MD_SETS_SELECTED SET_SYSTEM
 
+#define md_may_remove_boot_medium()	0
+
 /*
  * Machine-specific command to write a new label to a disk.
  * For example, shark uses /sbin/disklabel -w -r.
@@ -78,5 +69,4 @@
 
 /* Special board type routines need a switch */
 #define BOARD_TYPE_NORMAL	0
-#define BOARD_TYPE_RPI		1
 int boardtype;

Index: src/usr.sbin/sysinst/arch/evbarm64/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm64/md.c:1.2 src/usr.sbin/sysinst/arch/evbarm64/md.c:1.3
--- src/usr.sbin/sysinst/arch/evbarm64/md.c:1.2	Sun May 10 10:14:02 2015
+++ src/usr.sbin/sysinst/arch/evbarm64/md.c	Wed Jul  8 01:12:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.2 2015/05/10 10:14:02 martin Exp $ */
+/*	$NetBSD: md.c,v 1.3 2015/07/08 01:12:48 matt Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -49,13 +49,9 @@
 #include msg_defs.h
 #include menu_defs.h
 
-int boardtype = 0, rpi_bootpart = PART_A;
-
 void
 md_prelim_menu(void)
 {
-	/* get the boardtype from the user */
-	process_menu(MENU_prelim, NULL);
 }
 
 void
@@ -66,8 +62,6 @@ md_init(void)
 void
 md_init_set_status(int flags)
 {
-	if (boardtype == BOARD_TYPE_RPI)
-		set_kernel_set(SET_KERNEL_RPI);
 }
 
 int
@@ -77,24 +71,21 @@ md_get_info(void)
 	int fd;
 	char dev_name[100];
 
-	if (boardtype == BOARD_TYPE_RPI)
-		return set_bios_geom_with_mbr_guess();
-
-	if (no_mbr)
+	if (pm-no_mbr)
 		return 1;
 
-	if (read_mbr(diskdev, mbr)  0)
+	if (read_mbr(pm-diskdev, mbr)  0)
 		memset(mbr.mbr, 0, sizeof(mbr.mbr)-2);
 
 	if (edit_mbr(mbr) == 0)
 		return 0;
 
-	if (strncmp(diskdev, wd, 2) == 0)
-		disktype = ST506;
+	if (strncmp(pm-diskdev, wd, 2) == 0)
+		pm-disktype = ST506;
 	else
-		disktype = SCSI;
+		pm-disktype = SCSI;
 
-	snprintf(dev_name, 100, /dev/r%sc, diskdev);
+	snprintf(dev_name, sizeof(dev_name), /dev/r%sc, pm-diskdev);
 
 	fd = open(dev_name, O_RDONLY, 0);
 	if (fd  0) {
@@ -110,11 +101,11 @@ md_get_info(void)
 	}
 	close(fd);
 
-	dlcyl = disklabel.d_ncylinders;
-	dlhead = disklabel.d_ntracks;
-	dlsec = disklabel.d_nsectors;
-	sectorsize = disklabel.d_secsize;
-	dlcylsize = disklabel.d_secpercyl;
+	pm-dlcyl = disklabel.d_ncylinders;
+	pm-dlhead = disklabel.d_ntracks;
+	pm-dlsec = disklabel.d_nsectors;
+	pm-sectorsize = 

CVS commit: src/lib

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul  8 01:08:24 UTC 2015

Modified Files:
src/lib: Makefile
src/lib/libc_vfp: Makefile

Log Message:
Possibly build libc_vfp if MACHINE_CPU is aarch64 too.
Use AFLAGS to pass -mfpu=vfp


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/lib/Makefile
cvs rdiff -u -r1.3 -r1.4 src/lib/libc_vfp/Makefile

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

Modified files:

Index: src/lib/Makefile
diff -u src/lib/Makefile:1.225 src/lib/Makefile:1.226
--- src/lib/Makefile:1.225	Tue Jun 23 16:33:21 2015
+++ src/lib/Makefile	Wed Jul  8 01:08:24 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.225 2015/06/23 16:33:21 matt Exp $
+#	$NetBSD: Makefile,v 1.226 2015/07/08 01:08:24 matt Exp $
 #	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
 
 .include bsd.own.mk
@@ -33,7 +33,7 @@ SUBDIR+=	libarch \
 SUBDIR+=	libkern
 .endif
 
-.if (${MACHINE_CPU} == arm)
+.if (${MACHINE_CPU} == arm || ${MACHINE_CPU} == aarch64)
 LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
 .if empty(LIBC_MACHINE_ARCH:M*hf*)
 SUBDIR+=	libc_vfp

Index: src/lib/libc_vfp/Makefile
diff -u src/lib/libc_vfp/Makefile:1.3 src/lib/libc_vfp/Makefile:1.4
--- src/lib/libc_vfp/Makefile:1.3	Mon Aug 19 22:22:23 2013
+++ src/lib/libc_vfp/Makefile	Wed Jul  8 01:08:24 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2013/08/19 22:22:23 matt Exp $
+#	$NetBSD: Makefile,v 1.4 2015/07/08 01:08:24 matt Exp $
 #
 
 LIB=		c_vfp
@@ -10,5 +10,7 @@ USE_SHLIBDIR=	yes
 CPUFLAGS+=	-mfpu=vfp -marm
 
 SRCS=		vfpsf.S vfpdf.S
+AFLAGS.vfpsf.S+=	-mfpu=vfp
+AFLAGS.vfpdf.S+=	-mfpu=vfp
 
 .include bsd.lib.mk



CVS commit: src/tests/lib/libc/gen

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul  8 01:09:25 UTC 2015

Modified Files:
src/tests/lib/libc/gen: Makefile

Log Message:
Build t_fpgetmask/t_fpgetround for aarch64 since they are now in libc


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/tests/lib/libc/gen/Makefile

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

Modified files:

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.44 src/tests/lib/libc/gen/Makefile:1.45
--- src/tests/lib/libc/gen/Makefile:1.44	Sat Dec 27 18:00:13 2014
+++ src/tests/lib/libc/gen/Makefile	Wed Jul  8 01:09:25 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2014/12/27 18:00:13 martin Exp $
+# $NetBSD: Makefile,v 1.45 2015/07/08 01:09:25 matt Exp $
 
 .include bsd.own.mk
 
@@ -17,10 +17,8 @@ TESTS_C+=	t_floatunditf
 TESTS_C+=	t_fmtcheck
 TESTS_C+=	t_fnmatch
 TESTS_C+=	t_fpclassify
-.if ${MACHINE_CPU} != aarch64
 TESTS_C+=	t_fpsetmask
 TESTS_C+=	t_fpsetround
-.endif
 TESTS_C+=	t_ftok
 TESTS_C+=	t_getcwd
 TESTS_C+=	t_getgrent



CVS commit: src/distrib/sets/lists/debug

2015-07-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 09:17:24 UTC 2015

Modified Files:
src/distrib/sets/lists/debug: ad.arm

Log Message:
Fix one last time.  mark libarm_g.a libpmc_g.a as compatfile, add
oabi/libc_vfp_g.a as compat.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/distrib/sets/lists/debug/ad.arm

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/debug/ad.arm
diff -u src/distrib/sets/lists/debug/ad.arm:1.71 src/distrib/sets/lists/debug/ad.arm:1.72
--- src/distrib/sets/lists/debug/ad.arm:1.71	Mon Jul  6 09:07:39 2015
+++ src/distrib/sets/lists/debug/ad.arm	Mon Jul  6 09:17:24 2015
@@ -1,13 +1,11 @@
-# $NetBSD: ad.arm,v 1.71 2015/07/06 09:07:39 martin Exp $
-./usr/lib/libarm_g.acomp-c-debuglib		debuglib
+# $NetBSD: ad.arm,v 1.72 2015/07/06 09:17:24 matt Exp $
+./usr/lib/libarm_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libc_vfp_g.acomp-c-debuglib		debuglib,softfloat
-./usr/lib/libpmc_g.acomp-c-debuglib		debuglib
-./usr/lib/oabi/libarm_g.a			comp-c-debuglib		compat
-./usr/lib/oabi/libc_vfp_g.a			comp-c-debuglib		compat
+./usr/lib/libpmc_g.acomp-c-debuglib		debuglib,compatfile
+./usr/lib/oabi/libc_vfp_g.a			comp-c-debuglib		debuglib,compat
 ./usr/lib/oabi/libgmp_g.a			comp-c-debuglib		obsolete
 ./usr/lib/oabi/libmpc_g.a			comp-c-debuglib		obsolete
 ./usr/lib/oabi/libmpfr_g.a			comp-c-debuglib		obsolete
-./usr/lib/oabi/libpmc_g.a			comp-c-debuglib		compat
 ./usr/libdata/debug/lib/libc_vfp.so.0.0.debug	comp-sys-debug		debug,pic,softfloat
 ./usr/libdata/debug/libexec/ld.elf_so-oabi.debug	comp-sys-debug		debug,compat
 ./usr/libdata/debug/sbin/ldconfig.debug		comp-sysutil-debug	debug,pic,endian=1234



CVS commit: src/compat/arm/eabi

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 20:19:29 UTC 2015

Modified Files:
src/compat/arm/eabi: bsd.eabi.mk

Log Message:
Make clang happy by adding -mfpu=none to -mfloat-abi=soft


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/compat/arm/eabi/bsd.eabi.mk

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

Modified files:

Index: src/compat/arm/eabi/bsd.eabi.mk
diff -u src/compat/arm/eabi/bsd.eabi.mk:1.4 src/compat/arm/eabi/bsd.eabi.mk:1.5
--- src/compat/arm/eabi/bsd.eabi.mk:1.4	Wed Jun 24 22:20:24 2015
+++ src/compat/arm/eabi/bsd.eabi.mk	Sun Jul  5 20:19:29 2015
@@ -1,10 +1,10 @@
-#	$NetBSD: bsd.eabi.mk,v 1.4 2015/06/24 22:20:24 matt Exp $
+#	$NetBSD: bsd.eabi.mk,v 1.5 2015/07/05 20:19:29 matt Exp $
 
 .if !defined(MLIBDIR)
 
 MLIBDIR=		eabi
 
-EARM_COMPAT_FLAGS=	-mfloat-abi=soft
+EARM_COMPAT_FLAGS=	-mfloat-abi=soft -mfpu=none
 EARM_COMPAT_FLAGS+=	-mabi=aapcs-linux
 MKSOFTFLOAT=yes
 



CVS commit: src/lib/libc/arch/aarch64/gen

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 22:07:09 UTC 2015

Added Files:
src/lib/libc/arch/aarch64/gen: fpgetmask.c fpgetround.c fpgetsticky.c

Log Message:
Some test programs require these.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/aarch64/gen/fpgetmask.c \
src/lib/libc/arch/aarch64/gen/fpgetround.c \
src/lib/libc/arch/aarch64/gen/fpgetsticky.c

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

Added files:

Index: src/lib/libc/arch/aarch64/gen/fpgetmask.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.1
--- /dev/null	Sun Jul  5 22:07:09 2015
+++ src/lib/libc/arch/aarch64/gen/fpgetmask.c	Sun Jul  5 22:07:09 2015
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 sys/cdefs.h
+
+__RCSID($NetBSD: fpgetmask.c,v 1.1 2015/07/05 22:07:09 matt Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/bitops.h
+
+#include namespace.h
+
+#include ieeefp.h
+
+#include aarch64/armreg.h
+
+__weak_alias(fpgetmask,_fpgetmask);
+
+fp_except_t
+fpgetmask(void)
+{
+	return __SHIFTOUT(reg_fpcr_read(), FPCR_ESUM);
+}
Index: src/lib/libc/arch/aarch64/gen/fpgetround.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpgetround.c:1.1
--- /dev/null	Sun Jul  5 22:07:09 2015
+++ src/lib/libc/arch/aarch64/gen/fpgetround.c	Sun Jul  5 22:07:09 2015
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 sys/cdefs.h
+
+__RCSID($NetBSD: fpgetround.c,v 1.1 2015/07/05 22:07:09 matt Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/bitops.h
+
+#include namespace.h
+
+#include ieeefp.h
+
+#include aarch64/armreg.h
+
+__weak_alias(fpgetround,_fpgetround);
+
+fp_rnd_t
+fpgetround(void)
+{
+	return __SHIFTOUT(reg_fpcr_read(), FPCR_RMODE);
+}
Index: src/lib/libc/arch/aarch64/gen/fpgetsticky.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpgetsticky.c:1.1
--- /dev/null	Sun Jul  5 22:07:09

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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:36:27 UTC 2015

Modified Files:
src/sys/arch/powerpc/include: psl.h

Log Message:
Remove PSL_SPV from BOOKE PSL_USERMOD


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/include/psl.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/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.19 src/sys/arch/powerpc/include/psl.h:1.20
--- src/sys/arch/powerpc/include/psl.h:1.19	Fri Feb 28 05:27:38 2014
+++ src/sys/arch/powerpc/include/psl.h	Mon Jul  6 05:36:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.19 2014/02/28 05:27:38 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.20 2015/07/06 05:36:26 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -112,7 +112,7 @@ extern register_t cpu_psluserset, cpu_ps
 #elif defined(PPC_BOOKE)
 #define	PSL_USERSET		(PSL_EE | PSL_PR | PSL_IS | PSL_DS | PSL_ME | PSL_CE | PSL_DE)
 #define	PSL_USERMASK		(PSL_SPV | PSL_CE | 0x)
-#define	PSL_USERMOD		(PSL_SPV)
+#define	PSL_USERMOD		(0)
 #else /* PPC_IBM4XX */
 #ifdef PPC_IBM403
 #define	PSL_USERSET		(PSL_EE | PSL_PR | PSL_IR | PSL_DR | PSL_ME)



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:55:38 UTC 2015

Modified Files:
src/sys/arch/powerpc/include: userret.h

Log Message:
Don't clear PSL_FP/PSL_VEC


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/include/userret.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/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.29 src/sys/arch/powerpc/include/userret.h:1.30
--- src/sys/arch/powerpc/include/userret.h:1.29	Mon Jul  6 02:30:22 2015
+++ src/sys/arch/powerpc/include/userret.h	Mon Jul  6 05:55:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.29 2015/07/06 02:30:22 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.30 2015/07/06 05:55:37 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -66,7 +66,8 @@ userret(struct lwp *l, struct trapframe 
 	tf=%p: srr1 (%#lx): PSL_FP set but FPU curlwp %p is not curlwp %p!,
 	tf, tf-tf_srr1, l-l_cpu-ci_data.cpu_pcu_curlwp[PCU_FPU], l);
 
-	tf-tf_srr1 = PSL_USERSRR1;	/* clear SRR1 status bits */
+	/* clear SRR1 status bits */
+	tf-tf_srr1 = (PSL_USERSRR1|PSL_FP|PSL_VEC);
 
 #ifdef ALTIVEC
 	/*



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:03:56 UTC 2015

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

Log Message:
Clear PSL_FP/PSL_VEC so the lwp won't think it owns them.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/powerpc/powerpc/vm_machdep.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/vm_machdep.c
diff -u src/sys/arch/powerpc/powerpc/vm_machdep.c:1.98 src/sys/arch/powerpc/powerpc/vm_machdep.c:1.99
--- src/sys/arch/powerpc/powerpc/vm_machdep.c:1.98	Sat Oct 20 14:42:15 2012
+++ src/sys/arch/powerpc/powerpc/vm_machdep.c	Mon Jul  6 05:03:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.98 2012/10/20 14:42:15 kiyohara Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.99 2015/07/06 05:03:56 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.98 2012/10/20 14:42:15 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.99 2015/07/06 05:03:56 matt Exp $);
 
 #include opt_altivec.h
 #include opt_multiprocessor.h
@@ -107,6 +107,8 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	 * Setup the trap frame for the new process
 	 */
 	*l2-l_md.md_utf = *l1-l_md.md_utf;
+	l2-l_md.md_utf-tf_srr1 = ~(PSL_FP|PSL_VEC);
+	l2-l_md.md_flags = ~PSL_VEC;
 
 	/*
 	 * If specified, give the child a different stack.  Make sure to



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:20:50 UTC 2015

Modified Files:
src/sys/arch/powerpc/oea: oea_machdep.c

Log Message:
Don't preserve PSL_FP/PSL_VEC in cpu_setmcontext.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/powerpc/oea/oea_machdep.c

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

Modified files:

Index: src/sys/arch/powerpc/oea/oea_machdep.c
diff -u src/sys/arch/powerpc/oea/oea_machdep.c:1.71 src/sys/arch/powerpc/oea/oea_machdep.c:1.72
--- src/sys/arch/powerpc/oea/oea_machdep.c:1.71	Mon Mar 24 19:29:59 2014
+++ src/sys/arch/powerpc/oea/oea_machdep.c	Mon Jul  6 05:20:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: oea_machdep.c,v 1.71 2014/03/24 19:29:59 christos Exp $	*/
+/*	$NetBSD: oea_machdep.c,v 1.72 2015/07/06 05:20:50 matt Exp $	*/
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: oea_machdep.c,v 1.71 2014/03/24 19:29:59 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: oea_machdep.c,v 1.72 2015/07/06 05:20:50 matt Exp $);
 
 #include opt_ppcarch.h
 #include opt_compat_netbsd.h
@@ -440,19 +440,16 @@ oea_init(void (*handler)(void))
 
 /*
 	 * Configure a PSL user mask matching this processor.
+	 * Don't allow to set PSL_FP/PSL_VEC, since that will affect PCU.
  	 */
 	cpu_psluserset = PSL_EE | PSL_PR | PSL_ME | PSL_IR | PSL_DR | PSL_RI;
-	cpu_pslusermod = PSL_FP | PSL_FE0 | PSL_FE1 | PSL_LE | PSL_SE | PSL_BE;
+	cpu_pslusermod = PSL_FE0 | PSL_FE1 | PSL_LE | PSL_SE | PSL_BE;
 #ifdef PPC_OEA601
 	if (cpuvers == MPC601) {
 		cpu_psluserset = PSL_601_MASK;
 		cpu_pslusermod = PSL_601_MASK;
 	}
 #endif
-#ifdef ALTIVEC
-	if (cpu_altivec)
-		cpu_pslusermod |= PSL_VEC;
-#endif
 #ifdef PPC_HIGH_VEC
 	cpu_psluserset |= PSL_IP;	/* XXX ok? */
 #endif



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:25:29 UTC 2015

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

Log Message:
Back out last change.  Clearing PSL_FP/PSL_VEC is handled by child_return.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/powerpc/powerpc/vm_machdep.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/vm_machdep.c
diff -u src/sys/arch/powerpc/powerpc/vm_machdep.c:1.99 src/sys/arch/powerpc/powerpc/vm_machdep.c:1.100
--- src/sys/arch/powerpc/powerpc/vm_machdep.c:1.99	Mon Jul  6 05:03:56 2015
+++ src/sys/arch/powerpc/powerpc/vm_machdep.c	Mon Jul  6 05:25:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.99 2015/07/06 05:03:56 matt Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.100 2015/07/06 05:25:29 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.99 2015/07/06 05:03:56 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.100 2015/07/06 05:25:29 matt Exp $);
 
 #include opt_altivec.h
 #include opt_multiprocessor.h
@@ -107,8 +107,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	 * Setup the trap frame for the new process
 	 */
 	*l2-l_md.md_utf = *l1-l_md.md_utf;
-	l2-l_md.md_utf-tf_srr1 = ~(PSL_FP|PSL_VEC);
-	l2-l_md.md_flags = ~PSL_VEC;
 
 	/*
 	 * If specified, give the child a different stack.  Make sure to



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 01:55:50 UTC 2015

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

Log Message:
Don't reload the FPU register if this is just a re-enable.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/powerpc/fpu.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/fpu.c
diff -u src/sys/arch/powerpc/powerpc/fpu.c:1.35 src/sys/arch/powerpc/powerpc/fpu.c:1.36
--- src/sys/arch/powerpc/powerpc/fpu.c:1.35	Fri May 16 00:48:41 2014
+++ src/sys/arch/powerpc/powerpc/fpu.c	Mon Jul  6 01:55:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.35 2014/05/16 00:48:41 rmind Exp $	*/
+/*	$NetBSD: fpu.c,v 1.36 2015/07/06 01:55:50 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.35 2014/05/16 00:48:41 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.36 2015/07/06 01:55:50 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -84,15 +84,17 @@ fpu_state_load(lwp_t *l, u_int flags)
 		memset(pcb-pcb_fpu, 0, sizeof(pcb-pcb_fpu));
 	}
 
-	const register_t msr = mfmsr();
-mtmsr((msr  ~PSL_EE) | PSL_FP);
-	__asm volatile (isync);
+	if ((flags  PCU_REENABLE) == 0) {
+		const register_t msr = mfmsr();
+		mtmsr((msr  ~PSL_EE) | PSL_FP);
+		__asm volatile (isync);
 
-	fpu_load_from_fpreg(pcb-pcb_fpu);
-	__asm volatile (sync);
+		fpu_load_from_fpreg(pcb-pcb_fpu);
+		__asm volatile (sync);
 
-	mtmsr(msr);
-	__asm volatile (isync);
+		mtmsr(msr);
+		__asm volatile (isync);
+	}
 
 	curcpu()-ci_ev_fpusw.ev_count++;
 	l-l_md.md_utf-tf_srr1 |= PSL_FP|(pcb-pcb_flags  (PCB_FE0|PCB_FE1));



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 02:30:22 UTC 2015

Modified Files:
src/sys/arch/powerpc/include: userret.h

Log Message:
Add a check to make sure that if PSL_FP is set, we own the FPU.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/include/userret.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/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.28 src/sys/arch/powerpc/include/userret.h:1.29
--- src/sys/arch/powerpc/include/userret.h:1.28	Mon Mar 10 00:04:04 2014
+++ src/sys/arch/powerpc/include/userret.h	Mon Jul  6 02:30:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.28 2014/03/10 00:04:04 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.29 2015/07/06 02:30:22 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -61,6 +61,10 @@ userret(struct lwp *l, struct trapframe 
 	KASSERTMSG((tf-tf_srr1  PSL_PR) != 0,
 	tf=%p: srr1 (%#lx): PSL_PR isn't set!,
 	tf, tf-tf_srr1);
+	KASSERTMSG((tf-tf_srr1  PSL_FP) == 0
+	|| l-l_cpu-ci_data.cpu_pcu_curlwp[PCU_FPU] == l,
+	tf=%p: srr1 (%#lx): PSL_FP set but FPU curlwp %p is not curlwp %p!,
+	tf, tf-tf_srr1, l-l_cpu-ci_data.cpu_pcu_curlwp[PCU_FPU], l);
 
 	tf-tf_srr1 = PSL_USERSRR1;	/* clear SRR1 status bits */
 



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 02:43:26 UTC 2015

Modified Files:
src/sys/arch/powerpc/oea: altivec.c

Log Message:
Don't reload if just re-enabling


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/oea/altivec.c

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

Modified files:

Index: src/sys/arch/powerpc/oea/altivec.c
diff -u src/sys/arch/powerpc/oea/altivec.c:1.29 src/sys/arch/powerpc/oea/altivec.c:1.30
--- src/sys/arch/powerpc/oea/altivec.c:1.29	Fri May 16 00:48:41 2014
+++ src/sys/arch/powerpc/oea/altivec.c	Mon Jul  6 02:43:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: altivec.c,v 1.29 2014/05/16 00:48:41 rmind Exp $	*/
+/*	$NetBSD: altivec.c,v 1.30 2015/07/06 02:43:26 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: altivec.c,v 1.29 2014/05/16 00:48:41 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: altivec.c,v 1.30 2015/07/06 02:43:26 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -82,18 +82,26 @@ vec_state_load(lwp_t *l, u_int flags)
 		vec_mark_used(l);
 	}
 
-	/*
-	 * Enable AltiVec temporarily (and disable interrupts).
-	 */
-	const register_t msr = mfmsr();
-	mtmsr((msr  ~PSL_EE) | PSL_VEC);
-	__asm volatile (isync);
-
-	/*
-	 * Load the vector unit from vreg which is best done in
-	 * assembly.
-	 */
-	vec_load_from_vreg(pcb-pcb_vr);
+	if ((flags  PCU_REENABLE) == 0) {
+		/*
+		 * Enable AltiVec temporarily (and disable interrupts).
+		 */
+		const register_t msr = mfmsr();
+		mtmsr((msr  ~PSL_EE) | PSL_VEC);
+		__asm volatile (isync);
+
+		/*
+		 * Load the vector unit from vreg which is best done in
+		 * assembly.
+		 */
+		vec_load_from_vreg(pcb-pcb_vr);
+
+		/*
+		 * Restore MSR (turn off AltiVec)
+		 */
+		mtmsr(msr);
+		__asm volatile (isync);
+	}
 
 	/*
 	 * VRSAVE will be restored when trap frame returns
@@ -101,12 +109,6 @@ vec_state_load(lwp_t *l, u_int flags)
 	l-l_md.md_utf-tf_vrsave = pcb-pcb_vr.vrsave;
 
 	/*
-	 * Restore MSR (turn off AltiVec)
-	 */
-	mtmsr(msr);
-	__asm volatile (isync);
-
-	/*
 	 * Mark vector registers as modified.
 	 */
 	l-l_md.md_flags |= PSL_VEC;



CVS commit: src/sys/arch/vax/uba

2015-07-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 03:07:21 UTC 2015

Modified Files:
src/sys/arch/vax/uba: qv.c
Added Files:
src/sys/arch/vax/uba: qv_ic.h qvareg.h qvaux.c qvavar.h qvkbd.c
qvkbdvar.h qvms.c

Log Message:
Revamped QVSS (VCB01) support.  (from Charles Dickman)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/vax/uba/qv.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/vax/uba/qv_ic.h \
src/sys/arch/vax/uba/qvareg.h src/sys/arch/vax/uba/qvaux.c \
src/sys/arch/vax/uba/qvavar.h src/sys/arch/vax/uba/qvkbd.c \
src/sys/arch/vax/uba/qvkbdvar.h src/sys/arch/vax/uba/qvms.c

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

Modified files:

Index: src/sys/arch/vax/uba/qv.c
diff -u src/sys/arch/vax/uba/qv.c:1.30 src/sys/arch/vax/uba/qv.c:1.31
--- src/sys/arch/vax/uba/qv.c:1.30	Fri Jul 25 08:10:35 2014
+++ src/sys/arch/vax/uba/qv.c	Sun Jul  5 03:07:21 2015
@@ -1,13 +1,9 @@
-/*	$NetBSD: qv.c,v 1.30 2014/07/25 08:10:35 dholland Exp $	*/
-
-/*-
- * Copyright (c) 1988
- *	The Regents of the University of California.  All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
+/*$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.31 2015/07/05 03:07:21 matt Exp $*/
+/*
+ * Copyright (c) 2015 Charles H. Dickman. All rights reserved.
+ * Derived from smg.c
+ * Copyright (c) 1998 Ludd, University of Lule}, Sweden.
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -17,1316 +13,1023 @@
  * 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.
- * 3. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *	This product includes software developed at Ludd, University of 
+ *	Lule}, Sweden and its contributors.
+ * 4. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission
  *
- *	@(#)qv.c	7.2 (Berkeley) 1/21/94
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
  */
+/*   1 2 3 4 5 6 7*/
+/*3456789012345678901234567890123456789012345678901234567890123456789012345678*/
 
-/*
- *	derived from: @(#)qv.c	1.8 (ULTRIX) 8/21/85
- */
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.31 2015/07/05 03:07:21 matt Exp $);
 
-/
- *	*
- *			Copyright (c) 1985 by*
- *		Digital Equipment Corporation, Maynard, MA		*
- *			All rights reserved.*
- *	*
- *   This software is furnished under a license and may be used and	*
- *   copied  only  in accordance 

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

2015-07-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 03:06:28 UTC 2015

Modified Files:
src/sys/arch/vax/conf: files.vax majors.vax

Log Message:
Configury support for QVSS (from Charles Dickman)


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/vax/conf/files.vax
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/vax/conf/majors.vax

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

Modified files:

Index: src/sys/arch/vax/conf/files.vax
diff -u src/sys/arch/vax/conf/files.vax:1.119 src/sys/arch/vax/conf/files.vax:1.120
--- src/sys/arch/vax/conf/files.vax:1.119	Fri Dec 19 04:44:13 2014
+++ src/sys/arch/vax/conf/files.vax	Sun Jul  5 03:06:27 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.vax,v 1.119 2014/12/19 04:44:13 jklos Exp $
+#	$NetBSD: files.vax,v 1.120 2015/07/05 03:06:27 matt Exp $
 #
 # new style config file for vax architecture
 #
@@ -185,6 +185,22 @@ device	smg: displaydev, wsemuldisplaydev
 attach	smg at vsbus
 file	arch/vax/vsa/smg.c		smg needs-flag
 
+# Monochrome QVSS framebuffer on qbus (VCB01)
+device	qv {}: displaydev, wsemuldisplaydev
+attach	qv at uba
+attach  genfb at qv with genfb_qv
+file	arch/vax/uba/qv.c		qv|genfb_qv needs-flag
+
+device	qvaux { line=-1 }: tty
+attach	qvaux at qv 
+file	arch/vax/uba/qvaux.c		qvaux needs-flag
+
+attach	lkkbd at qvaux with qvkbd
+file	arch/vax/uba/qvkbd.c		qvkbd needs-flag
+
+attach	lkms at qvaux with qvms
+file	arch/vax/uba/qvms.c		qvms needs-flag
+
 # Color framebuffer on VS4000/60.
 device	lcg: displaydev, wsemuldisplaydev
 attach	lcg at vsbus
@@ -290,11 +306,6 @@ device	vp
 attach	vp at uba
 file	arch/vax/uba/vp.c		vp needs-flag
 
-# QVSS at UBA
-device	qv
-attach	qv at uba
-file	arch/vax/uba/qv.c		qv needs-flag
-
 # ACC LH/DH IMP on UBA
 device	acc: ifnet
 attach	acc at uba

Index: src/sys/arch/vax/conf/majors.vax
diff -u src/sys/arch/vax/conf/majors.vax:1.25 src/sys/arch/vax/conf/majors.vax:1.26
--- src/sys/arch/vax/conf/majors.vax:1.25	Fri Dec 19 04:44:13 2014
+++ src/sys/arch/vax/conf/majors.vax	Sun Jul  5 03:06:27 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.vax,v 1.25 2014/12/19 04:44:13 jklos Exp $
+#	$NetBSD: majors.vax,v 1.26 2015/07/05 03:06:27 matt Exp $
 #
 # Device majors for vax
 #
@@ -51,6 +51,7 @@ device-major	mt		char 38  block 15	mt
 device-major	qd		char 41			qd
 device-major	ipl		char 42			ipfilter
 device-major	ii		char 43			ingres
+device-major	qvaux		char 44			qvaux
 
 device-major	crx		char 51			vax8200 | vaxany
 



CVS commit: src/sys/arch/vax

2015-07-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 02:03:36 UTC 2015

Modified Files:
src/sys/arch/vax/include: bus.h sgmap.h
src/sys/arch/vax/vax: sgmap.c

Log Message:
Hooks needed for QVSS support


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/vax/include/bus.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/vax/include/sgmap.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/vax/vax/sgmap.c

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

Modified files:

Index: src/sys/arch/vax/include/bus.h
diff -u src/sys/arch/vax/include/bus.h:1.31 src/sys/arch/vax/include/bus.h:1.32
--- src/sys/arch/vax/include/bus.h:1.31	Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/include/bus.h	Sun Jul  5 02:03:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.31 2008/04/28 20:23:39 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.32 2015/07/05 02:03:36 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -184,7 +184,11 @@ struct vax_bus_space {
 
 #define bus_space_free(t, h, s)		\
 	(*(t)-vbs_free)((t)-vbs_cookie, (h), (s))
-
+/*
+ * Get kernel virtual address for ranges mapped BUS_SPACE_MAP_LINEAR.
+ */
+#define bus_space_vaddr(t, h)		\
+	((void *) (h))
 /*
  * Mmap bus space for a user application.
  */

Index: src/sys/arch/vax/include/sgmap.h
diff -u src/sys/arch/vax/include/sgmap.h:1.6 src/sys/arch/vax/include/sgmap.h:1.7
--- src/sys/arch/vax/include/sgmap.h:1.6	Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/include/sgmap.h	Sun Jul  5 02:03:36 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap.h,v 1.6 2008/04/28 20:23:39 martin Exp $ */
+/* $NetBSD: sgmap.h,v 1.7 2015/07/05 02:03:36 matt Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -63,6 +63,8 @@ void	vax_sgmap_init(bus_dma_tag_t, struc
 int	vax_sgmap_alloc(bus_dmamap_t, bus_size_t, struct vax_sgmap *, int);
 void	vax_sgmap_free(bus_dmamap_t, struct vax_sgmap *);
 
+int	vax_sgmap_reserve(bus_addr_t, bus_size_t, struct vax_sgmap *);
+
 int vax_sgmap_load(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t,
 	struct proc *, int, struct vax_sgmap *);
 

Index: src/sys/arch/vax/vax/sgmap.c
diff -u src/sys/arch/vax/vax/sgmap.c:1.17 src/sys/arch/vax/vax/sgmap.c:1.18
--- src/sys/arch/vax/vax/sgmap.c:1.17	Fri Jan 27 18:53:06 2012
+++ src/sys/arch/vax/vax/sgmap.c	Sun Jul  5 02:03:36 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap.c,v 1.17 2012/01/27 18:53:06 para Exp $ */
+/* $NetBSD: sgmap.c,v 1.18 2015/07/05 02:03:36 matt Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sgmap.c,v 1.17 2012/01/27 18:53:06 para Exp $);
+__KERNEL_RCSID(0, $NetBSD: sgmap.c,v 1.18 2015/07/05 02:03:36 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -124,16 +124,18 @@ vax_sgmap_alloc(bus_dmamap_t map, bus_si
 	}
 
 	map-_dm_sgvalen = vax_round_page(len);
-#if 0
+#define DEBUG_SGMAP 0
+#if DEBUG_SGMAP
 	printf(len %x - %x, _dm_sgvalen %x _dm_boundary %x boundary %x - ,
-	origlen, len, map-_dm_sgvalen, map-_dm_boundary, boundary);
+	//origlen, len, map-_dm_sgvalen, map-_dm_boundary, boundary);
+	(unsigned int)origlen, (unsigned int)len, (unsigned int)map-_dm_sgvalen, (unsigned int)map-_dm_boundary, 1);
 #endif
 
 	error = extent_alloc(sgmap-aps_ex, map-_dm_sgvalen, VAX_NBPG,
 	0, (flags  BUS_DMA_NOWAIT) ? EX_NOWAIT : EX_WAITOK,
 	map-_dm_sgva);
-#if 0
-	printf(error %d _dm_sgva %x\n, error, map-_dm_sgva);
+#if DEBUG_SGMAP
+	printf(error %d _dm_sgva %lx\n, error, map-_dm_sgva);
 #endif
 
 	if (error == 0)
@@ -161,6 +163,12 @@ vax_sgmap_free(bus_dmamap_t map, struct 
 }
 
 int
+vax_sgmap_reserve(bus_addr_t ba, bus_size_t len, struct vax_sgmap *sgmap)
+{
+	return extent_alloc_region(sgmap-aps_ex, ba, len, EX_NOWAIT); 
+}
+
+int
 vax_sgmap_load(bus_dma_tag_t t, bus_dmamap_t map, void *buf, bus_size_t buflen,
 	struct proc *p, int flags, struct vax_sgmap *sgmap)
 {



CVS commit: src/sys/arch/vax/uba

2015-07-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 04:53:26 UTC 2015

Modified Files:
src/sys/arch/vax/uba: uba_mainbus.c

Log Message:
Typo fxi.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/vax/uba/uba_mainbus.c

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

Modified files:

Index: src/sys/arch/vax/uba/uba_mainbus.c
diff -u src/sys/arch/vax/uba/uba_mainbus.c:1.11 src/sys/arch/vax/uba/uba_mainbus.c:1.12
--- src/sys/arch/vax/uba/uba_mainbus.c:1.11	Sun Jul  5 03:03:00 2015
+++ src/sys/arch/vax/uba/uba_mainbus.c	Sun Jul  5 04:53:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uba_mainbus.c,v 1.11 2015/07/05 03:03:00 matt Exp $	   */
+/*	$NetBSD: uba_mainbus.c,v 1.12 2015/07/05 04:53:26 matt Exp $	   */
 /*
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uba_mainbus.c,v 1.11 2015/07/05 03:03:00 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uba_mainbus.c,v 1.12 2015/07/05 04:53:26 matt Exp $);
 
 #define _VAX_BUS_DMA_PRIVATE
 
@@ -163,7 +163,7 @@ qba_attach(device_t parent, device_t sel
 		} else if (start = 0) {
 			aprint_normal(sgmap exclusion at %#x - %#x\n, 
 			start*VAX_NBPG, pgnum*VAX_NBPG - 1);
-			vax_sgmap_resserve(start*VAX_NBPG,
+			vax_sgmap_reserve(start*VAX_NBPG,
 			(pgnum - start)*VAX_NBPG, sc-uv_sgmap);
 			start = -1;
 		}



CVS commit: src/sys/arch/vax/vax

2015-07-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 02:10:53 UTC 2015

Modified Files:
src/sys/arch/vax/vax: conf.c

Log Message:
Reorganize a bit.  Add QVSS (from Charles Dickman).


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/vax/vax/conf.c

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

Modified files:

Index: src/sys/arch/vax/vax/conf.c
diff -u src/sys/arch/vax/vax/conf.c:1.67 src/sys/arch/vax/vax/conf.c:1.68
--- src/sys/arch/vax/vax/conf.c:1.67	Tue Dec 14 23:44:49 2010
+++ src/sys/arch/vax/vax/conf.c	Sun Jul  5 02:10:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.67 2010/12/14 23:44:49 matt Exp $	*/
+/*	$NetBSD: conf.c,v 1.68 2015/07/05 02:10:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: conf.c,v 1.67 2010/12/14 23:44:49 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: conf.c,v 1.68 2015/07/05 02:10:53 matt Exp $);
 
 #include opt_cputype.h
 
@@ -45,10 +45,40 @@ __KERNEL_RCSID(0, $NetBSD: conf.c,v 1.6
  */
 #include dev/cons.h
 
+#include lcg.h
+#include qv.h
 #include smg.h
 #include spx.h
-#include lcg.h
 #include wskbd.h
+
+#if NLCG  0
+#if NWSKBD  0
+#define lcgcngetc wskbd_cngetc
+#else
+static int
+lcgcngetc(dev_t dev)
+{
+	return 0;
+}
+#endif
+
+#define lcgcnputc wsdisplay_cnputc
+#define lcgcnpollc nullcnpollc
+#endif /* NLCG  0 */
+#if NQV  0
+#if NWSKBD  0
+#define qvcngetc wskbd_cngetc
+#else
+static int
+qvcngetc(dev_t dev)
+{
+	return 0;
+}
+#endif
+
+#define qvcnputc wsdisplay_cnputc
+#define qvcnpollc nullcnpollc
+#endif /* NQV  0 */
 #if NSMG  0
 #if NWSKBD  0
 #define smgcngetc wskbd_cngetc
@@ -62,7 +92,7 @@ smgcngetc(dev_t dev)
 
 #define smgcnputc wsdisplay_cnputc
 #define	smgcnpollc nullcnpollc
-#endif
+#endif /* NSMG  0 */
 #if NSPX  0
 #if NWSKBD  0
 #define spxcngetc wskbd_cngetc
@@ -76,29 +106,15 @@ spxcngetc(dev_t dev)
 
 #define spxcnputc wsdisplay_cnputc
 #define spxcnpollc nullcnpollc
-#endif
-#if NLCG  0
-#if NWSKBD  0
-#define lcgcngetc wskbd_cngetc
-#else
-static int
-lcgcngetc(dev_t dev)
-{
-	return 0;
-}
-#endif
-
-#define lcgcnputc wsdisplay_cnputc
-#define lcgcnpollc nullcnpollc
-#endif
+#endif /* NSPX  0 */
 
 cons_decl(gen);
 cons_decl(dz);
 cons_decl(qd);
-cons_decl(smg);
-cons_decl(spx);
 cons_decl(lcg);
-#include qv.h
+cons_decl(qv);
+cons_decl(spx);
+cons_decl(smg);
 #include qd.h
 
 struct	consdev constab[]={
@@ -111,21 +127,21 @@ struct	consdev constab[]={
 #endif
 #if VAX650 || VAX630 || VAXANY
 #if NQV
-	cons_init(qv),	/* QVSS/QDSS bit-mapped console driver */
+	cons_init(qv),	/* QVSS bit-mapped console driver */
 #endif
 #if NQD
 	cons_init(qd),
 #endif
 #endif
+#if NLCG
+	cons_init(lcg),
+#endif
 #if NSMG
 	cons_init(smg),
 #endif
 #if NSPX
 	cons_init(spx),
 #endif
-#if NLCG
-	cons_init(lcg),
-#endif
 
 #ifdef notyet
 /* We may not always use builtin console, sometimes RD */



CVS commit: src/sys/arch/vax/uba

2015-07-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  5 03:03:00 UTC 2015

Modified Files:
src/sys/arch/vax/uba: uba_mainbus.c

Log Message:
Add code to probe the Q-bus/Unibus for memory.  (From Charles Dickman)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/uba/uba_mainbus.c

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

Modified files:

Index: src/sys/arch/vax/uba/uba_mainbus.c
diff -u src/sys/arch/vax/uba/uba_mainbus.c:1.10 src/sys/arch/vax/uba/uba_mainbus.c:1.11
--- src/sys/arch/vax/uba/uba_mainbus.c:1.10	Tue Dec 14 23:38:30 2010
+++ src/sys/arch/vax/uba/uba_mainbus.c	Sun Jul  5 03:03:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uba_mainbus.c,v 1.10 2010/12/14 23:38:30 matt Exp $	   */
+/*	$NetBSD: uba_mainbus.c,v 1.11 2015/07/05 03:03:00 matt Exp $	   */
 /*
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uba_mainbus.c,v 1.10 2010/12/14 23:38:30 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uba_mainbus.c,v 1.11 2015/07/05 03:03:00 matt Exp $);
 
 #define _VAX_BUS_DMA_PRIVATE
 
@@ -91,6 +91,7 @@ __KERNEL_RCSID(0, $NetBSD: uba_mainbus.
 /* Some Qbus-specific defines */
 #define	QBASIZE	(8192 * VAX_NBPG)
 #define	QBAMAP	0x20088000
+#define	QBAMEM	0x3000
 #define	QIOPAGE	0x2000
 
 /*
@@ -121,6 +122,12 @@ qba_attach(device_t parent, device_t sel
 {
 	struct mainbus_attach_args * const ma = aux;
 	struct uba_vsoftc * const sc = device_private(self);
+	paddr_t paddr;
+	vaddr_t vaddr;
+	int *mapp;
+	int pgnum;
+	//int val;
+	int start;
 
 	aprint_normal(: Q22\n);
 
@@ -140,6 +147,40 @@ qba_attach(device_t parent, device_t sel
 	sc-uv_addr = QBAMAP;	/* Physical address of map registers */
 
 	uba_dma_init(sc);
+
+	mapp = (int *)vax_map_physmem(QBAMAP, QBASIZE/VAX_NBPG);
+	//val = 0;
+	
+	for (paddr = QBAMEM, pgnum = 0, start = -1;
+	 paddr  QBAMEM + QBASIZE - 8192;
+	 paddr += VAX_NBPG, pgnum += 1) {
+		//val = mapp[pgnum];
+		mapp[pgnum] = 0;
+		vaddr = vax_map_physmem(paddr, 1);
+		if (badaddr((void *)vaddr, 2) == 0) {
+			if (start  0)
+start = pgnum;
+		} else if (start = 0) {
+			aprint_normal(sgmap exclusion at %#x - %#x\n, 
+			start*VAX_NBPG, pgnum*VAX_NBPG - 1);
+			vax_sgmap_resserve(start*VAX_NBPG,
+			(pgnum - start)*VAX_NBPG, sc-uv_sgmap);
+			start = -1;
+		}
+		vax_unmap_physmem(vaddr, 1);
+		//mapp[pgnum] = val;
+	}
+	vax_unmap_physmem((vaddr_t)mapp, QBASIZE/VAX_NBPG);
+	if (start = 0) {
+		aprint_normal(sgmap exclusion at %#x - %#x\n, 
+		start*VAX_NBPG, pgnum*VAX_NBPG - 1);
+		vax_sgmap_reserve(start*VAX_NBPG, (pgnum - start)*VAX_NBPG,
+		sc-uv_sgmap);
+	}
+
+	/* reserve I/O space within Qbus */
+	vax_sgmap_reserve(0x3fe000, 0x40 - 0x3fe000, sc-uv_sgmap);
+
 	uba_attach(sc-uv_sc, QIOPAGE);
 }
 



CVS commit: src/distrib/sets/lists

2015-07-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul  3 15:11:05 UTC 2015

Modified Files:
src/distrib/sets/lists/base: ad.arm
src/distrib/sets/lists/comp: ad.arm ad.arm.shl
src/distrib/sets/lists/debug: ad.arm

Log Message:
Remove entries made redundant by compatdir/compatfile


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/base/ad.arm
cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/comp/ad.arm
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/lists/comp/ad.arm.shl
cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/debug/ad.arm

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/base/ad.arm
diff -u src/distrib/sets/lists/base/ad.arm:1.76 src/distrib/sets/lists/base/ad.arm:1.77
--- src/distrib/sets/lists/base/ad.arm:1.76	Fri Jul  3 01:00:59 2015
+++ src/distrib/sets/lists/base/ad.arm	Fri Jul  3 15:11:04 2015
@@ -1,384 +1,15 @@
-# $NetBSD: ad.arm,v 1.76 2015/07/03 01:00:59 christos Exp $
-./lib/oabi	base-compat-shlib	compat
-./lib/oabi/npf	base-npf-shlib		compat
-./lib/oabi/npf/ext_log.so			base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_log.so.0			base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_log.so.0.0			base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_normalize.so			base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_normalize.so.0		base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_normalize.so.0.0		base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_rndblock.so			base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_rndblock.so.0		base-npf-shlib		compat,pic
-./lib/oabi/npf/ext_rndblock.so.0.0		base-npf-shlib		compat,pic
+# $NetBSD: ad.arm,v 1.77 2015/07/03 15:11:04 matt Exp $
 ./libexec/ld.elf_so-oabi			base-sysutil-bin	compat,pic
 ./sbin/ldconfig	base-sysutil-root	pic,endian=1234
 ./usr/bin/fdformatbase-util-bin
-./usr/lib/libarm.sobase-sys-shlib		pic
-./usr/lib/libarm.so.0base-sys-shlib		pic
-./usr/lib/libarm.so.0.0base-sys-shlib		pic
-./usr/lib/libpmc.sobase-sys-shlib		pic
-./usr/lib/libpmc.so.1base-sys-shlib		pic
-./usr/lib/libpmc.so.1.0base-sys-shlib		pic
-./usr/lib/oabi	base-compat-lib		compat,eabi
-./usr/lib/oabi/i18nbase-compat-lib		compat,eabi
-./usr/lib/oabi/i18n/libBIG5.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libBIG5.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libDECHanyu.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libDECHanyu.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libEUC.so.5			base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libEUC.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libEUCTW.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libEUCTW.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libGBK2K.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libGBK2K.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libHZ.so.5			base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libHZ.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libISO2022.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libISO2022.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libJOHAB.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libJOHAB.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libMSKanji.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libMSKanji.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUES.so.5			base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUES.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUTF1632.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUTF1632.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUTF7.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUTF7.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUTF8.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libUTF8.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libVIQR.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libVIQR.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libZW.so.5			base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libZW.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libiconv_none.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libiconv_none.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libiconv_std.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libiconv_std.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_646.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_646.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_none.so.5		base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_none.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_parallel.so.5	base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_parallel.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/oabi/i18n/libmapper_serial.so.5	

CVS commit: src/distrib/sets/lists

2015-07-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul  3 18:28:37 UTC 2015

Modified Files:
src/distrib/sets/lists/base: md.sparc64
src/distrib/sets/lists/comp: md.sparc64
src/distrib/sets/lists/debug: md.sparc64

Log Message:
Remove entries made redundnat by compatdir/compatfile


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.191 -r1.192 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.83 -r1.84 src/distrib/sets/lists/debug/md.sparc64

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/base/md.sparc64
diff -u src/distrib/sets/lists/base/md.sparc64:1.253 src/distrib/sets/lists/base/md.sparc64:1.254
--- src/distrib/sets/lists/base/md.sparc64:1.253	Fri Jul  3 01:01:00 2015
+++ src/distrib/sets/lists/base/md.sparc64	Fri Jul  3 18:28:37 2015
@@ -1,374 +1,7 @@
-# $NetBSD: md.sparc64,v 1.253 2015/07/03 01:01:00 christos Exp $
-./lib/sparc	base-npf-shlib		compat
-./lib/sparc/npf	base-npf-shlib		compat
-./lib/sparc/npf/ext_log.so			base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_log.so.0			base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_log.so.0.0			base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_normalize.so		base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_normalize.so.0		base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_normalize.so.0.0		base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_rndblock.so			base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_rndblock.so.0		base-npf-shlib		compat,pic
-./lib/sparc/npf/ext_rndblock.so.0.0		base-npf-shlib		compat,pic
+# $NetBSD: md.sparc64,v 1.254 2015/07/03 18:28:37 matt Exp $
 ./libexec/ld.elf_so-sparc			base-sysutil-bin	compat,pic
 ./sbin/edlabel	base-sysutil-root	obsolete
 ./usr/bin/fdformatbase-util-bin
-./usr/lib/sparc	base-compat-lib		compat
-./usr/lib/sparc/i18nbase-compat-lib		compat
-./usr/lib/sparc/i18n/libBIG5.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libBIG5.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libDECHanyu.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libDECHanyu.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libEUC.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libEUC.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libEUCTW.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libEUCTW.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libGBK2K.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libGBK2K.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libHZ.so.5			base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libHZ.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libISO2022.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libISO2022.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libJOHAB.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libJOHAB.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libMSKanji.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libMSKanji.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUES.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUES.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUTF1632.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUTF1632.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUTF7.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUTF7.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUTF8.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libUTF8.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libVIQR.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libVIQR.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libZW.so.5			base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libZW.so.5.0		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libiconv_none.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libiconv_none.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libiconv_std.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libiconv_std.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_646.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_646.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_none.so.5	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_none.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_parallel.so.5	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_parallel.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_serial.so.5	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_serial.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_std.so.5		base-i18n-shlib		compat,pic
-./usr/lib/sparc/i18n/libmapper_std.so.5.0	base-i18n-shlib		compat,pic

CVS commit: src/distrib/sets/lists

2015-07-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul  3 16:43:50 UTC 2015

Modified Files:
src/distrib/sets/lists/base: ad.riscv
src/distrib/sets/lists/comp: ad.riscv
src/distrib/sets/lists/debug: ad.riscv

Log Message:
Remove entries made redundant by compatdir/compatfile.  (Leaves only
libexec/ld.elf_so-rv32 as the only compat files).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/base/ad.riscv
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/comp/ad.riscv
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/debug/ad.riscv

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/base/ad.riscv
diff -u src/distrib/sets/lists/base/ad.riscv:1.20 src/distrib/sets/lists/base/ad.riscv:1.21
--- src/distrib/sets/lists/base/ad.riscv:1.20	Fri Jul  3 01:00:59 2015
+++ src/distrib/sets/lists/base/ad.riscv	Fri Jul  3 16:43:50 2015
@@ -1,329 +1,3 @@
-# $NetBSD: ad.riscv,v 1.20 2015/07/03 01:00:59 christos Exp $
-./lib/rv32	base-compat-shlib	compat,arch64
-./lib/rv32/npf	base-npf-shlib		compat,arch64
-./lib/rv32/npf/ext_log.so			base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_log.so.0			base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_log.so.0.0			base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_normalize.so			base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_normalize.so.0		base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_normalize.so.0.0		base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_rndblock.so			base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_rndblock.so.0		base-npf-shlib		compat,pic,arch64
-./lib/rv32/npf/ext_rndblock.so.0.0		base-npf-shlib		compat,pic,arch64
+# $NetBSD: ad.riscv,v 1.21 2015/07/03 16:43:50 matt Exp $
 ./libexec/ld.elf_so-rv32			base-compat-shlib	compat,pic,arch64
-./usr/lib/rv32	base-compat-lib		arch64
-./usr/lib/rv32/i18nbase-compat-lib		arch64
-./usr/lib/rv32/i18n/libBIG5.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libBIG5.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libDECHanyu.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libDECHanyu.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libEUC.so.5			base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libEUC.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libEUCTW.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libEUCTW.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libGBK2K.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libGBK2K.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libHZ.so.5			base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libHZ.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libISO2022.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libISO2022.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libJOHAB.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libJOHAB.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libMSKanji.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libMSKanji.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUES.so.5			base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUES.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUTF1632.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUTF1632.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUTF7.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUTF7.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUTF8.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libUTF8.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libVIQR.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libVIQR.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libZW.so.5			base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libZW.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libiconv_none.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libiconv_none.so.5.0	base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libiconv_std.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libiconv_std.so.5.0		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_646.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_646.so.5.0	base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_none.so.5		base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_none.so.5.0	base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_parallel.so.5	base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_parallel.so.5.0	base-i18n-shlib		compat,pic,arch64
-./usr/lib/rv32/i18n/libmapper_serial.so.5	

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

2015-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jun 29 17:52:53 UTC 2015

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

Log Message:
use cpu_startup_common


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 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.116 src/sys/arch/cobalt/cobalt/machdep.c:1.117
--- src/sys/arch/cobalt/cobalt/machdep.c:1.116	Thu Apr  3 19:15:43 2014
+++ src/sys/arch/cobalt/cobalt/machdep.c	Mon Jun 29 17:52:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.117 2015/06/29 17:52:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.117 2015/06/29 17:52:53 matt Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -310,32 +310,7 @@ mach_init(int32_t memsize32, u_int bim, 
 void
 cpu_startup(void)
 {
-	vaddr_t minaddr, maxaddr;
-	char pbuf[9];
-
-	/*
-	 * Good {morning,afternoon,evening,night}.
-	 */
-	printf(%s%s, copyright, version);
-	printf(%s\n, cpu_getmodel());
-	format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
-	printf(total memory = %s\n, pbuf);
-
-	minaddr = 0;
-	/*
-	 * Allocate a submap for physio.
-	 */
-	phys_map = uvm_km_suballoc(kernel_map, minaddr, maxaddr,
-	VM_PHYS_SIZE, 0, false, NULL);
-
-	/*
-	 * (No need to allocate an mbuf cluster submap.  Mbuf clusters
-	 * are allocated via the pool allocator, and we use KSEG to
-	 * map those pages.)
-	 */
-
-	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
-	printf(avail memory = %s\n, pbuf);
+	cpu_startup_common();
 }
 
 static int waittime = -1;



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

2015-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jun 30 03:41:04 UTC 2015

Modified Files:
src/sys/arch/mips/include: vmparam.h

Log Message:
We support multiple page sizes so let modules know it.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mips/include/vmparam.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/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.52 src/sys/arch/mips/include/vmparam.h:1.53
--- src/sys/arch/mips/include/vmparam.h:1.52	Sat Jan 25 15:16:50 2014
+++ src/sys/arch/mips/include/vmparam.h	Tue Jun 30 03:41:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.52 2014/01/25 15:16:50 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.53 2015/06/30 03:41:04 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,6 +49,8 @@
 /*
  * Machine dependent VM constants for MIPS.
  */
+#define MAX_PAGE_SIZE	16384
+#define MIN_PAGE_SIZE	4096
 
 /*
  * We normally use a 4K page but may use 16K on MIPS systems.



CVS commit: src/sys/arch

2015-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jun 30 02:39:04 UTC 2015

Modified Files:
src/sys/arch/algor/algor: machdep.c
src/sys/arch/arc/arc: machdep.c
src/sys/arch/evbmips/ingenic: machdep.c
src/sys/arch/evbmips/rmixl: machdep.c
src/sys/arch/hpcmips/hpcmips: machdep.c
src/sys/arch/newsmips/newsmips: machdep.c
src/sys/arch/playstation2/playstation2: machdep.c
src/sys/arch/pmax/pmax: machdep.c

Log Message:
Use cpu_startup_common()


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/algor/algor/machdep.c
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/arc/arc/machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbmips/ingenic/machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbmips/rmixl/machdep.c
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/hpcmips/hpcmips/machdep.c
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/newsmips/newsmips/machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/playstation2/playstation2/machdep.c
cvs rdiff -u -r1.248 -r1.249 src/sys/arch/pmax/pmax/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/algor/algor/machdep.c
diff -u src/sys/arch/algor/algor/machdep.c:1.53 src/sys/arch/algor/algor/machdep.c:1.54
--- src/sys/arch/algor/algor/machdep.c:1.53	Mon Mar 24 20:06:31 2014
+++ src/sys/arch/algor/algor/machdep.c	Tue Jun 30 02:39:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.53 2014/03/24 20:06:31 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.54 2015/06/30 02:39:03 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.53 2014/03/24 20:06:31 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.54 2015/06/30 02:39:03 matt Exp $);
 
 #include opt_algor_p4032.h
 #include opt_algor_p5064.h 
@@ -511,66 +511,24 @@ consinit(void)
 void
 cpu_startup(void)
 {
-	vaddr_t minaddr, maxaddr;
-	char pbuf[9];
-#ifdef DEBUG
-	extern int pmapdebug;
-	int opmapdebug = pmapdebug;
-
-	pmapdebug = 0;		/* Shut up pmap debug during bootstrap */
-#endif
-
-	/*
-	 * Good {morning,afternoon,evening,night}.
-	 */
-	printf(%s%s, copyright, version);
-	printf(%s\n, cpu_getmodel());
-	format_bytes(pbuf, sizeof(pbuf), ptoa(physmem));
-	printf(total memory = %s\n, pbuf);
-
 	/*
 	 * Virtual memory is bootstrapped -- notify the bus spaces
 	 * that memory allocation is now safe.
 	 */
 #if defined(ALGOR_P4032)
-	{
-		struct p4032_config *acp = p4032_configuration;
+	struct p4032_config * const acp = p4032_configuration;
 
-		acp-ac_mallocsafe = 1;
-	}
+	acp-ac_mallocsafe = 1;
 #elif defined(ALGOR_P5064)
-	{
-		struct p5064_config *acp = p5064_configuration;
+	struct p5064_config * const acp = p5064_configuration;
 
-		acp-ac_mallocsafe = 1;
-	}
+	acp-ac_mallocsafe = 1;
 #elif defined(ALGOR_P6032)
-	{
-		struct p6032_config *acp = p6032_configuration;
-
-		acp-ac_mallocsafe = 1;
-	}
-#endif
-
-	minaddr = 0;
-
-	/*
-	 * Allocate a submap for physio.
-	 */
-	phys_map = uvm_km_suballoc(kernel_map, minaddr, maxaddr,
-	VM_PHYS_SIZE, 0, false, NULL);
-
-	/*
-	 * No need to allocate an mbuf cluster submap.  Mbuf clusters
-	 * are allocate via the pool allocator, and we use KSEG0 to
-	 * map those pages.
-	 */
+	struct p6032_config * const acp = p6032_configuration;
 
-#ifdef DEBUG
-	pmapdebug = opmapdebug;
+	acp-ac_mallocsafe = 1;
 #endif
-	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
-	printf(avail memory = %s\n, pbuf);
+	cpu_startup_common();
 }
 
 int	waittime = -1;

Index: src/sys/arch/arc/arc/machdep.c
diff -u src/sys/arch/arc/arc/machdep.c:1.128 src/sys/arch/arc/arc/machdep.c:1.129
--- src/sys/arch/arc/arc/machdep.c:1.128	Mon Mar 24 20:06:31 2014
+++ src/sys/arch/arc/arc/machdep.c	Tue Jun 30 02:39:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.128 2014/03/24 20:06:31 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.129 2015/06/30 02:39:03 matt Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.128 2014/03/24 20:06:31 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.129 2015/06/30 02:39:03 matt Exp $);
 
 #include opt_ddb.h
 #include opt_ddbparam.h
@@ -489,48 +489,12 @@ consinit(void)
 void
 cpu_startup(void)
 {
-	vaddr_t minaddr, maxaddr;
-	char pbuf[9];
-#ifdef DEBUG
-	extern int pmapdebug;
-	int opmapdebug = pmapdebug;
-
-	pmapdebug = 0;		/* Shut up pmap debug during bootstrap */
-
-#endif
-
 #ifdef BOOTINFO_DEBUG
 	if (bootinfo_msg)
 		printf(bootinfo_msg);
 #endif
 
-	/*
-	 * Good {morning,afternoon,evening,night}.
-	 */
-	printf(%s%s, copyright, version);
-	printf(%s\n, cpu_getmodel());
-	format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
-	printf(total memory = %s\n, pbuf);
-
-	minaddr = 0;
-
-	/*
-	 * Allocate a submap for physio
-	 */
-	

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

2015-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jun 30 04:20:19 UTC 2015

Modified Files:
src/sys/arch/mips/include: proc.h vmparam.h

Log Message:
Make vmparam.h change work with RUMP


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mips/include/proc.h
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mips/include/vmparam.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/mips/include/proc.h
diff -u src/sys/arch/mips/include/proc.h:1.27 src/sys/arch/mips/include/proc.h:1.28
--- src/sys/arch/mips/include/proc.h:1.27	Sun Feb 20 07:45:47 2011
+++ src/sys/arch/mips/include/proc.h	Tue Jun 30 04:20:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.27 2011/02/20 07:45:47 matt Exp $	*/
+/*	$NetBSD: proc.h,v 1.28 2015/06/30 04:20:19 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -52,11 +52,7 @@ struct mdlwp {
 	vaddr_t	md_ss_addr;		/* single step address for ptrace */
 	int	md_ss_instr;		/* single step instruction for ptrace */
 	volatile int md_astpending;	/* AST pending on return to userland */
-#if USPACE  PAGE_SIZE
-	int	md_upte[USPACE/4096];	/* ptes for mapping u page */
-#else
-	int	md_dpte[USPACE/4096];	/* dummy ptes to keep the same */
-#endif
+	int	md_upte[2];		/* ptes for mapping u page */
 };
 
 struct mdproc {

Index: src/sys/arch/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.53 src/sys/arch/mips/include/vmparam.h:1.54
--- src/sys/arch/mips/include/vmparam.h:1.53	Tue Jun 30 03:41:04 2015
+++ src/sys/arch/mips/include/vmparam.h	Tue Jun 30 04:20:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.53 2015/06/30 03:41:04 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.54 2015/06/30 04:20:19 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -42,15 +42,18 @@
 #define	_MIPS_VMPARAM_H_
 
 #ifdef _KERNEL_OPT
-#include opt_multiprocessor.h
 #include opt_cputype.h
+#include opt_multiprocessor.h
+#include opt_modular.h
 #endif
 
 /*
  * Machine dependent VM constants for MIPS.
  */
+#if !defined(_RUMPKERNEL)  (defined(MODULAR) || defined(_MODULE))
 #define MAX_PAGE_SIZE	16384
 #define MIN_PAGE_SIZE	4096
+#endif
 
 /*
  * We normally use a 4K page but may use 16K on MIPS systems.



CVS commit: src/distrib/sets

2015-06-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 28 23:49:33 UTC 2015

Modified Files:
src/distrib/sets: sets.subr

Log Message:
Need debug sets if ${MKDEBUGLIB} != no


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/distrib/sets/sets.subr

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/sets.subr
diff -u src/distrib/sets/sets.subr:1.170 src/distrib/sets/sets.subr:1.171
--- src/distrib/sets/sets.subr:1.170	Sat Jun 27 16:21:07 2015
+++ src/distrib/sets/sets.subr	Sun Jun 28 23:49:33 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.170 2015/06/27 16:21:07 matt Exp $
+#	$NetBSD: sets.subr,v 1.171 2015/06/28 23:49:33 matt Exp $
 #
 
 #
@@ -144,7 +144,7 @@ if [ ${MKATF} = no ]; then
 else
 	testset=tests
 fi
-if [ ${MKDEBUG} = no ]; then
+if [ ${MKDEBUG} = no -a ${MKDEBUGLIB} = no ]; then
 	debugset=
 	xdebugset=
 else
@@ -179,7 +179,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.170 2015/06/27 16:21:07 matt Exp $
+# 	# $NetBSD: sets.subr,v 1.171 2015/06/28 23:49:33 matt Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root



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

2015-06-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 28 22:14:38 UTC 2015

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

Log Message:
Print both user and kernel segtabs


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/rmi/rmixl_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/mips/rmi/rmixl_cpu.c
diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.8 src/sys/arch/mips/rmi/rmixl_cpu.c:1.9
--- src/sys/arch/mips/rmi/rmixl_cpu.c:1.8	Wed Jun 10 22:31:00 2015
+++ src/sys/arch/mips/rmi/rmixl_cpu.c	Sun Jun 28 22:14:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpu.c,v 1.8 2015/06/10 22:31:00 matt Exp $	*/
+/*	$NetBSD: rmixl_cpu.c,v 1.9 2015/06/28 22:14:38 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.8 2015/06/10 22:31:00 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.9 2015/06/28 22:14:38 matt Exp $);
 
 #include opt_multiprocessor.h
 #include opt_ddb.h
@@ -474,9 +474,11 @@ rmixl_cpuinfo_print(u_int cpuindex)
 		printf(ci_tlb_slot %d\n, ci-ci_tlb_slot);
 		printf(ci_pmap_asid_cur %d\n, ci-ci_pmap_asid_cur);
 		printf(ci_tlb_info %p\n, ci-ci_tlb_info);
-		printf(ci_pmap_seg0tab %p\n, ci-ci_pmap_seg0tab);
+		printf(ci_pmap_kern_segtab %p\n, ci-ci_pmap_kern_segtab);
+		printf(ci_pmap_user_segtab %p\n, ci-ci_pmap_user_segtab);
 #ifdef _LP64
-		printf(ci_pmap_segtab %p\n, ci-ci_pmap_segtab);
+		printf(ci_pmap_kern_seg0tab %p\n, ci-ci_pmap_kern_seg0tab);
+		printf(ci_pmap_user_seg0tab %p\n, ci-ci_pmap_user_seg0tab);
 #else
 		printf(ci_pmap_srcbase %#PRIxVADDR\n, ci-ci_pmap_srcbase);
 		printf(ci_pmap_dstbase %#PRIxVADDR\n, ci-ci_pmap_dstbase);



CVS commit: src

2015-06-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jun 27 06:00:28 UTC 2015

Modified Files:
src: build.sh

Log Message:
Make evbarm64 (little endian) the default for aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.307 src/build.sh:1.308
--- src/build.sh:1.307	Wed May  6 17:31:49 2015
+++ src/build.sh	Sat Jun 27 06:00:28 2015
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.307 2015/05/06 17:31:49 wiz Exp $
+#	$NetBSD: build.sh,v 1.308 2015/06/27 06:00:28 matt Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -651,7 +651,7 @@ MACHINE=evbarm		MACHINE_ARCH=earmv7	ALIA
 MACHINE=evbarm		MACHINE_ARCH=earmv7eb	ALIAS=evbearmv7-eb
 MACHINE=evbarm		MACHINE_ARCH=earmv7hf	ALIAS=evbearmv7hf-el
 MACHINE=evbarm		MACHINE_ARCH=earmv7hfeb	ALIAS=evbearmv7hf-eb
-MACHINE=evbarm64	MACHINE_ARCH=aarch64	ALIAS=evbarm64-el
+MACHINE=evbarm64	MACHINE_ARCH=aarch64	ALIAS=evbarm64-el DEFAULT
 MACHINE=evbarm64	MACHINE_ARCH=aarch64eb	ALIAS=evbarm64-eb
 MACHINE=evbcf		MACHINE_ARCH=coldfire
 MACHINE=evbmips		MACHINE_ARCH=		NO_DEFAULT
@@ -1869,7 +1869,7 @@ createmakewrapper()
 	eval cat EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy make building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.307 2015/05/06 17:31:49 wiz Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.308 2015/06/27 06:00:28 matt Exp $
 # with these arguments: ${_args}
 #
 



  1   2   3   4   5   6   7   8   9   10   >