Sync with HEAD (as of 26th Dec) nick-nhusb
authorskrll <skrll@NetBSD.org>
Sun, 27 Dec 2015 12:09:27 +0000
branchnick-nhusb
changeset 278413 601ee67de3f1
parent 278412 a3c1e26bd56b
child 278414 20b2492e5b00
Sync with HEAD (as of 26th Dec)
sys/arch/aarch64/include/ptrace.h
sys/arch/acorn32/podulebus/esc.c
sys/arch/algor/include/Makefile
sys/arch/algor/include/fenv.h
sys/arch/algor/pci/vtpbc.c
sys/arch/alpha/alpha/cpu.c
sys/arch/alpha/alpha/dec_kn300.c
sys/arch/alpha/alpha/pmap.c
sys/arch/alpha/conf/GENERIC
sys/arch/alpha/include/ptrace.h
sys/arch/alpha/pci/apecs_pci.c
sys/arch/alpha/pci/cia.c
sys/arch/alpha/pci/cia_pci.c
sys/arch/alpha/pci/dwlpx_pci.c
sys/arch/alpha/pci/irongate_pci.c
sys/arch/alpha/pci/lca_pci.c
sys/arch/alpha/pci/mcpcia_pci.c
sys/arch/alpha/pci/tsp_pci.c
sys/arch/alpha/pci/ttwoga_pci.c
sys/arch/alpha/stand/standtest/test.c
sys/arch/amd64/amd64/amd64_trap.S
sys/arch/amd64/amd64/autoconf.c
sys/arch/amd64/amd64/bios32.c
sys/arch/amd64/amd64/copy.S
sys/arch/amd64/amd64/gdt.c
sys/arch/amd64/amd64/genassym.cf
sys/arch/amd64/amd64/kgdb_machdep.c
sys/arch/amd64/amd64/linux32_sigcode.S
sys/arch/amd64/amd64/locore.S
sys/arch/amd64/amd64/machdep.c
sys/arch/amd64/amd64/mptramp.S
sys/arch/amd64/amd64/netbsd32_machdep.c
sys/arch/amd64/amd64/spl.S
sys/arch/amd64/amd64/trap.c
sys/arch/amd64/amd64/vector.S
sys/arch/amd64/conf/ALL
sys/arch/amd64/conf/GENERIC
sys/arch/amd64/conf/XEN3_DOM0
sys/arch/amd64/conf/XEN3_DOMU
sys/arch/amd64/conf/kern.ldscript
sys/arch/amd64/include/param.h
sys/arch/amd64/include/ptrace.h
sys/arch/amiga/amiga/bus.c
sys/arch/amiga/conf/WSCONS
sys/arch/amiga/dev/amidisplaycc.c
sys/arch/amiga/dev/clock.c
sys/arch/amiga/dev/grf.c
sys/arch/amiga/dev/grf_cl.c
sys/arch/amiga/dev/grf_cv.c
sys/arch/amiga/dev/grf_cv3d.c
sys/arch/amiga/dev/grfvar.h
sys/arch/amiga/dev/grfws.h
sys/arch/amiga/dev/if_bah_zbus.c
sys/arch/amiga/dev/view.c
sys/arch/amiga/include/Makefile
sys/arch/amiga/include/fenv.h
sys/arch/amiga/include/param.h
sys/arch/amiga/include/vmparam.h
sys/arch/amiga/pci/cv3dpb.c
sys/arch/amiga/pci/em4k.c
sys/arch/amiga/pci/empb.c
sys/arch/amiga/pci/mppb.c
sys/arch/amiga/pci/p5pb.c
sys/arch/amiga/stand/loadbsd/Makefile
sys/arch/amiga/stand/loadbsd/README
sys/arch/amigappc/include/Makefile
sys/arch/amigappc/include/fenv.h
sys/arch/amigappc/include/param.h
sys/arch/arc/include/Makefile
sys/arch/arc/include/fenv.h
sys/arch/arc/pci/necpb.c
sys/arch/arm/allwinner/awin_board.c
sys/arch/arm/allwinner/awin_debe.c
sys/arch/arm/allwinner/awin_gpio.c
sys/arch/arm/allwinner/awin_hdmi.c
sys/arch/arm/allwinner/awin_hdmiaudio.c
sys/arch/arm/allwinner/awin_mmc.c
sys/arch/arm/allwinner/awin_reg.h
sys/arch/arm/allwinner/awin_tcon.c
sys/arch/arm/allwinner/awin_var.h
sys/arch/arm/allwinner/files.awin
sys/arch/arm/amlogic/amlogic_board.c
sys/arch/arm/amlogic/amlogic_cpufreq.c
sys/arch/arm/amlogic/amlogic_crureg.h
sys/arch/arm/amlogic/amlogic_io.c
sys/arch/arm/amlogic/amlogic_sdhc.c
sys/arch/arm/amlogic/amlogic_var.h
sys/arch/arm/amlogic/files.amlogic
sys/arch/arm/arm/cpufunc.c
sys/arch/arm/arm/disassem.c
sys/arch/arm/arm32/arm32_kvminit.c
sys/arch/arm/arm32/arm32_reboot.c
sys/arch/arm/arm32/armv7_generic_space.c
sys/arch/arm/arm32/bus_dma.c
sys/arch/arm/arm32/cpu.c
sys/arch/arm/arm32/netbsd32_machdep.c
sys/arch/arm/arm32/pmap.c
sys/arch/arm/broadcom/bcm2835_cm.c
sys/arch/arm/broadcom/bcm2835_cm.h
sys/arch/arm/broadcom/bcm2835_obio.c
sys/arch/arm/broadcom/bcm2835_pwm.c
sys/arch/arm/broadcom/bcm2835_pwm.h
sys/arch/arm/broadcom/bcm2835_space.c
sys/arch/arm/broadcom/bcm2835reg.h
sys/arch/arm/broadcom/bcm53xx_pax.c
sys/arch/arm/broadcom/files.bcm2835
sys/arch/arm/conf/files.arm
sys/arch/arm/cortex/a9_mpsubr.S
sys/arch/arm/cortex/cortex_init.S
sys/arch/arm/fdt/files.fdt
sys/arch/arm/fdt/gic_fdt.c
sys/arch/arm/footbridge/footbridge_pci.c
sys/arch/arm/gemini/gemini_pci.c
sys/arch/arm/imx/files.imx51
sys/arch/arm/imx/imx51_ipuv3.c
sys/arch/arm/imx/imx51_ipuv3var.h
sys/arch/arm/imx/imx51var.h
sys/arch/arm/imx/imx_genfb.c
sys/arch/arm/include/arm32/machdep.h
sys/arch/arm/include/arm32/pmap.h
sys/arch/arm/include/arm32/vmparam.h
sys/arch/arm/include/armreg.h
sys/arch/arm/include/cpufunc.h
sys/arch/arm/include/ptrace.h
sys/arch/arm/ixp12x0/ixp12x0_pci.c
sys/arch/arm/marvell/armadaxpreg.h
sys/arch/arm/marvell/mvsoc.c
sys/arch/arm/marvell/mvsocts.c
sys/arch/arm/marvell/pci_machdep.c
sys/arch/arm/nvidia/files.tegra
sys/arch/arm/nvidia/soc_tegra124.c
sys/arch/arm/nvidia/tegra124_car.c
sys/arch/arm/nvidia/tegra124_carreg.h
sys/arch/arm/nvidia/tegra_ahcisata.c
sys/arch/arm/nvidia/tegra_ahcisatareg.h
sys/arch/arm/nvidia/tegra_car.c
sys/arch/arm/nvidia/tegra_carreg.h
sys/arch/arm/nvidia/tegra_cec.c
sys/arch/arm/nvidia/tegra_clock.h
sys/arch/arm/nvidia/tegra_com.c
sys/arch/arm/nvidia/tegra_cpufreq.c
sys/arch/arm/nvidia/tegra_dc.c
sys/arch/arm/nvidia/tegra_dcreg.h
sys/arch/arm/nvidia/tegra_drm.c
sys/arch/arm/nvidia/tegra_drm.h
sys/arch/arm/nvidia/tegra_drm_fb.c
sys/arch/arm/nvidia/tegra_drm_gem.c
sys/arch/arm/nvidia/tegra_drm_mode.c
sys/arch/arm/nvidia/tegra_ehci.c
sys/arch/arm/nvidia/tegra_ehcireg.h
sys/arch/arm/nvidia/tegra_fb.c
sys/arch/arm/nvidia/tegra_fdt.c
sys/arch/arm/nvidia/tegra_fuse.c
sys/arch/arm/nvidia/tegra_genfb.c
sys/arch/arm/nvidia/tegra_gpio.c
sys/arch/arm/nvidia/tegra_hdaudio.c
sys/arch/arm/nvidia/tegra_hdmi.c
sys/arch/arm/nvidia/tegra_hdmireg.h
sys/arch/arm/nvidia/tegra_host1x.c
sys/arch/arm/nvidia/tegra_i2c.c
sys/arch/arm/nvidia/tegra_intr.h
sys/arch/arm/nvidia/tegra_io.c
sys/arch/arm/nvidia/tegra_lic.c
sys/arch/arm/nvidia/tegra_mc.c
sys/arch/arm/nvidia/tegra_mcreg.h
sys/arch/arm/nvidia/tegra_mpio.c
sys/arch/arm/nvidia/tegra_nouveau.c
sys/arch/arm/nvidia/tegra_pcie.c
sys/arch/arm/nvidia/tegra_pciereg.h
sys/arch/arm/nvidia/tegra_pmc.c
sys/arch/arm/nvidia/tegra_pmcreg.h
sys/arch/arm/nvidia/tegra_reg.h
sys/arch/arm/nvidia/tegra_rtc.c
sys/arch/arm/nvidia/tegra_sdhc.c
sys/arch/arm/nvidia/tegra_soc.c
sys/arch/arm/nvidia/tegra_soctherm.c
sys/arch/arm/nvidia/tegra_socthermreg.h
sys/arch/arm/nvidia/tegra_timer.c
sys/arch/arm/nvidia/tegra_timerreg.h
sys/arch/arm/nvidia/tegra_usbphy.c
sys/arch/arm/nvidia/tegra_usbreg.h
sys/arch/arm/nvidia/tegra_var.h
sys/arch/arm/nvidia/tegra_xusbpad.c
sys/arch/arm/omap/am335x_gpio.c
sys/arch/arm/omap/files.omap2
sys/arch/arm/omap/omap3_ehci.c
sys/arch/arm/omap/omap3_sdhc.c
sys/arch/arm/pic/pic.c
sys/arch/arm/s3c2xx0/s3c2800_pci.c
sys/arch/arm/samsung/exynos4_loc.c
sys/arch/arm/samsung/exynos4_reg.h
sys/arch/arm/samsung/exynos5422_clock.c
sys/arch/arm/samsung/exynos5422_dma.c
sys/arch/arm/samsung/exynos5_loc.c
sys/arch/arm/samsung/exynos5_reg.h
sys/arch/arm/samsung/exynos_chipid.c
sys/arch/arm/samsung/exynos_clock.h
sys/arch/arm/samsung/exynos_combiner.c
sys/arch/arm/samsung/exynos_dma.c
sys/arch/arm/samsung/exynos_fdt.c
sys/arch/arm/samsung/exynos_gpio.c
sys/arch/arm/samsung/exynos_i2c.c
sys/arch/arm/samsung/exynos_io.c
sys/arch/arm/samsung/exynos_io.h
sys/arch/arm/samsung/exynos_pinctrl.c
sys/arch/arm/samsung/exynos_pinctrl.h
sys/arch/arm/samsung/exynos_rtc.c
sys/arch/arm/samsung/exynos_soc.c
sys/arch/arm/samsung/exynos_space.c
sys/arch/arm/samsung/exynos_sscom.c
sys/arch/arm/samsung/exynos_usb.c
sys/arch/arm/samsung/exynos_var.h
sys/arch/arm/samsung/exynos_wdt.c
sys/arch/arm/samsung/files.exynos
sys/arch/arm/samsung/mct.c
sys/arch/arm/samsung/mct_var.h
sys/arch/arm/vfp/vfp_init.c
sys/arch/arm/xscale/becc_pci.c
sys/arch/arm/xscale/i80312_pci.c
sys/arch/arm/xscale/i80321_pci.c
sys/arch/arm/xscale/ixp425_pci.c
sys/arch/arm/xscale/pxa2x0_lcd.c
sys/arch/atari/dev/hdfd.c
sys/arch/atari/include/Makefile
sys/arch/atari/include/fenv.h
sys/arch/atari/pci/pci_hades.c
sys/arch/atari/pci/pci_milan.c
sys/arch/bebox/bebox/autoconf.c
sys/arch/bebox/include/Makefile
sys/arch/bebox/include/fenv.h
sys/arch/cesfic/cesfic/machdep.c
sys/arch/cesfic/include/Makefile
sys/arch/cesfic/include/fenv.h
sys/arch/cobalt/include/Makefile
sys/arch/cobalt/include/fenv.h
sys/arch/cobalt/pci/pci_machdep.c
sys/arch/dreamcast/dev/g2/gapspci_pci.c
sys/arch/dreamcast/dev/maple/maple.c
sys/arch/dreamcast/dev/maple/maplevar.h
sys/arch/dreamcast/include/pci_machdep.h
sys/arch/emips/ebus/flash_ebus.c
sys/arch/emips/include/Makefile
sys/arch/emips/include/fenv.h
sys/arch/emips/stand/common/boot.c
sys/arch/evbarm/awin/awin_machdep.c
sys/arch/evbarm/awin/awin_sysconfig.c
sys/arch/evbarm/beagle/beagle_machdep.c
sys/arch/evbarm/conf/BEAGLEBONE
sys/arch/evbarm/conf/BPI
sys/arch/evbarm/conf/CUBIEBOARD
sys/arch/evbarm/conf/EXYNOS
sys/arch/evbarm/conf/EXYNOS_INSTALL
sys/arch/evbarm/conf/GENERIC.common
sys/arch/evbarm/conf/JETSONTK1
sys/arch/evbarm/conf/JETSONTK1_INSTALL
sys/arch/evbarm/conf/MMNET_GENERIC
sys/arch/evbarm/conf/MPCSA_GENERIC
sys/arch/evbarm/conf/NETWALKER
sys/arch/evbarm/conf/NYAN-BIG
sys/arch/evbarm/conf/ODROID-C1
sys/arch/evbarm/conf/ODROID-U
sys/arch/evbarm/conf/ODROID-XU
sys/arch/evbarm/conf/OPENBLOCKS_AX3
sys/arch/evbarm/conf/OPENRD
sys/arch/evbarm/conf/OVERO
sys/arch/evbarm/conf/PANDABOARD
sys/arch/evbarm/conf/RPI
sys/arch/evbarm/conf/SHEEVAPLUG
sys/arch/evbarm/conf/TEGRA
sys/arch/evbarm/conf/TEGRA_INSTALL
sys/arch/evbarm/conf/TS7200
sys/arch/evbarm/conf/TWINTAIL
sys/arch/evbarm/conf/VEXPRESS_A15
sys/arch/evbarm/conf/files.exynos
sys/arch/evbarm/conf/files.netwalker
sys/arch/evbarm/conf/files.odroid
sys/arch/evbarm/conf/files.tegra
sys/arch/evbarm/conf/mk.exynos
sys/arch/evbarm/conf/mk.odroid
sys/arch/evbarm/conf/mk.tegra
sys/arch/evbarm/conf/std.awin
sys/arch/evbarm/conf/std.exynos
sys/arch/evbarm/conf/std.odroid
sys/arch/evbarm/conf/std.tegra
sys/arch/evbarm/exynos/exynos_machdep.c
sys/arch/evbarm/exynos/exynos_start.S
sys/arch/evbarm/exynos/genassym.cf
sys/arch/evbarm/exynos/platform.h
sys/arch/evbarm/ifpga/ifpga_pci.c
sys/arch/evbarm/netwalker/netwalker_backlight.c
sys/arch/evbarm/netwalker/netwalker_backlightvar.h
sys/arch/evbarm/netwalker/netwalker_lcd.c
sys/arch/evbarm/netwalker/netwalker_machdep.c
sys/arch/evbarm/odroid/genassym.cf
sys/arch/evbarm/odroid/odroid_machdep.c
sys/arch/evbarm/odroid/odroid_start.S
sys/arch/evbarm/odroid/platform.h
sys/arch/evbarm/rpi/rpi2_start.S
sys/arch/evbarm/stand/boot2440/s3csdi.c
sys/arch/evbarm/tegra/tegra_machdep.c
sys/arch/evbarm/tegra/tegra_start.S
sys/arch/evbarm64/conf/A64EMUL
sys/arch/evbcf/include/Makefile
sys/arch/evbcf/include/fenv.h
sys/arch/evbmips/conf/CI20
sys/arch/evbmips/conf/MALTA
sys/arch/evbmips/include/Makefile
sys/arch/evbmips/include/fenv.h
sys/arch/evbmips/ingenic/autoconf.c
sys/arch/evbmips/loongson/dev/glx.c
sys/arch/evbmips/malta/dev/gt.c
sys/arch/evbppc/include/Makefile
sys/arch/evbppc/include/fenv.h
sys/arch/ews4800mips/include/Makefile
sys/arch/ews4800mips/include/fenv.h
sys/arch/hp300/include/Makefile
sys/arch/hp300/include/fenv.h
sys/arch/hpcmips/dev/plum.c
sys/arch/hpcmips/include/Makefile
sys/arch/hpcmips/include/fenv.h
sys/arch/hpcmips/vr/vrc4172pci.c
sys/arch/hpcmips/vr/vrpciu.c
sys/arch/hppa/conf/GENERIC
sys/arch/hppa/dev/dino.c
sys/arch/hppa/dev/elroy.c
sys/arch/hppa/hppa/machdep.c
sys/arch/hppa/include/param.h
sys/arch/hppa/include/ptrace.h
sys/arch/hppa/stand/xxboot/iplsum.c
sys/arch/i386/conf/ALL
sys/arch/i386/conf/GENERIC
sys/arch/i386/conf/GENERIC_TINY
sys/arch/i386/conf/INSTALL_FLOPPY
sys/arch/i386/conf/INSTALL_TINY
sys/arch/i386/conf/XEN3_DOM0
sys/arch/i386/conf/kern.ldscript
sys/arch/i386/i386/trap.c
sys/arch/i386/include/param.h
sys/arch/i386/include/ptrace.h
sys/arch/i386/stand/lib/dosfile.c
sys/arch/ia64/pci/pci_machdep.c
sys/arch/ibmnws/include/Makefile
sys/arch/ibmnws/include/fenv.h
sys/arch/iyonix/conf/GENERIC
sys/arch/landisk/landisk/machdep.c
sys/arch/luna68k/include/Makefile
sys/arch/luna68k/include/fenv.h
sys/arch/m68k/include/Makefile
sys/arch/m68k/include/fenv.h
sys/arch/m68k/include/ieeefp.h
sys/arch/m68k/include/ptrace.h
sys/arch/m68k/m68k/db_trace.c
sys/arch/mac68k/include/Makefile
sys/arch/mac68k/include/fenv.h
sys/arch/macppc/include/Makefile
sys/arch/macppc/include/fenv.h
sys/arch/macppc/pci/bandit.c
sys/arch/macppc/pci/grackle.c
sys/arch/macppc/pci/u3.c
sys/arch/macppc/pci/uninorth.c
sys/arch/mips/adm5120/dev/admpci.c
sys/arch/mips/alchemy/dev/aupci.c
sys/arch/mips/atheros/dev/arpci.c
sys/arch/mips/bonito/bonito_pci.c
sys/arch/mips/conf/files.ingenic
sys/arch/mips/include/Makefile
sys/arch/mips/include/fenv.h
sys/arch/mips/include/ieeefp.h
sys/arch/mips/include/ptrace.h
sys/arch/mips/ingenic/apbus.c
sys/arch/mips/ingenic/ingenic_dme.c
sys/arch/mips/ingenic/ingenic_efuse.c
sys/arch/mips/ingenic/ingenic_regs.h
sys/arch/mips/ingenic/ingenic_rng.c
sys/arch/mips/ingenic/jziic.c
sys/arch/mips/mips/bus_space_alignstride_chipdep.c
sys/arch/mips/mips/netbsd32_machdep.c
sys/arch/mips/mips/pmap.c
sys/arch/mips/rmi/rmixl_pcie.c
sys/arch/mips/rmi/rmixl_pcix.c
sys/arch/mips/sibyte/pci/sbbrz_pci.c
sys/arch/mipsco/include/Makefile
sys/arch/mipsco/include/fenv.h
sys/arch/mvme68k/include/Makefile
sys/arch/mvme68k/include/fenv.h
sys/arch/mvmeppc/include/Makefile
sys/arch/mvmeppc/include/fenv.h
sys/arch/news68k/include/Makefile
sys/arch/news68k/include/fenv.h
sys/arch/newsmips/include/Makefile
sys/arch/newsmips/include/fenv.h
sys/arch/next68k/include/Makefile
sys/arch/next68k/include/fenv.h
sys/arch/ofppc/conf/GENERIC
sys/arch/ofppc/include/Makefile
sys/arch/ofppc/include/fenv.h
sys/arch/playstation2/include/Makefile
sys/arch/playstation2/include/fenv.h
sys/arch/pmax/include/Makefile
sys/arch/pmax/include/fenv.h
sys/arch/powerpc/booke/booke_pmap.c
sys/arch/powerpc/booke/pci/pq3pci.c
sys/arch/powerpc/ibm4xx/pci/pci_machdep.c
sys/arch/powerpc/include/Makefile
sys/arch/powerpc/include/fenv.h
sys/arch/powerpc/include/ieeefp.h
sys/arch/powerpc/pci/pciconf_indirect.c
sys/arch/powerpc/pci/pciconf_ofmethod.c
sys/arch/prep/conf/GENERIC
sys/arch/prep/include/Makefile
sys/arch/prep/include/fenv.h
sys/arch/prep/pci/prep_pciconf_direct.c
sys/arch/riscv/riscv/netbsd32_machdep.c
sys/arch/rs6000/include/Makefile
sys/arch/rs6000/include/fenv.h
sys/arch/sandpoint/conf/GENERIC
sys/arch/sandpoint/conf/KUROBOX
sys/arch/sandpoint/include/Makefile
sys/arch/sandpoint/include/bootinfo.h
sys/arch/sandpoint/include/fenv.h
sys/arch/sandpoint/pci/pci_machdep.c
sys/arch/sandpoint/sandpoint/autoconf.c
sys/arch/sandpoint/sandpoint/machdep.c
sys/arch/sandpoint/stand/altboot/brdsetup.c
sys/arch/sandpoint/stand/altboot/dsk.c
sys/arch/sandpoint/stand/altboot/globals.h
sys/arch/sandpoint/stand/altboot/main.c
sys/arch/sandpoint/stand/altboot/siisata.c
sys/arch/sandpoint/stand/altboot/version
sys/arch/sbmips/include/Makefile
sys/arch/sbmips/include/fenv.h
sys/arch/sgimips/conf/GENERIC32_IP2x
sys/arch/sgimips/conf/GENERIC32_IP3x
sys/arch/sgimips/dev/crmfb.c
sys/arch/sgimips/gio/pci_gio.c
sys/arch/sgimips/include/Makefile
sys/arch/sgimips/include/fenv.h
sys/arch/sgimips/mace/com_mace.c
sys/arch/sgimips/mace/pci_mace.c
sys/arch/sgimips/sgimips/console.c
sys/arch/sh3/dev/scif.c
sys/arch/sh3/dev/shpcic.c
sys/arch/sh3/include/ptrace.h
sys/arch/sh3/sh3/sh3_machdep.c
sys/arch/shark/conf/GENERIC
sys/arch/shark/ofw/ofw.c
sys/arch/sparc/conf/GENERIC
sys/arch/sparc/conf/INSTALL
sys/arch/sparc/conf/KRUPS
sys/arch/sparc/conf/MRCOFFEE
sys/arch/sparc/conf/TADPOLE3GX
sys/arch/sparc/include/frame.h
sys/arch/sparc/include/openfirm.h
sys/arch/sparc/include/ptrace.h
sys/arch/sparc/include/types.h
sys/arch/sparc/sparc/autoconf.c
sys/arch/sparc/sparc/db_disasm.c
sys/arch/sparc/sparc/db_interface.c
sys/arch/sparc/sparc/emul.c
sys/arch/sparc/sparc/msiiep.c
sys/arch/sparc/sparc/pci_machdep.c
sys/arch/sparc/sparc/pmap.c
sys/arch/sparc/sparc/syscall.c
sys/arch/sparc/sparc/trap.c
sys/arch/sparc/stand/boot/boot.c
sys/arch/sparc/stand/bootxx/bootxx.c
sys/arch/sparc/stand/ofwboot/Locore.c
sys/arch/sparc/stand/ofwboot/Makefile
sys/arch/sparc64/conf/GENERIC
sys/arch/sparc64/conf/NONPLUS64
sys/arch/sparc64/conf/files.sparc64
sys/arch/sparc64/dev/auxio.c
sys/arch/sparc64/dev/auxio_ebus.c
sys/arch/sparc64/dev/auxio_sbus.c
sys/arch/sparc64/dev/auxiovar.h
sys/arch/sparc64/dev/psycho.c
sys/arch/sparc64/dev/pyro.c
sys/arch/sparc64/dev/schizo.c
sys/arch/sparc64/dev/schizoreg.h
sys/arch/sparc64/dev/schizovar.h
sys/arch/sparc64/dev/vpci.c
sys/arch/sparc64/dev/zs.c
sys/arch/sparc64/include/asm.h
sys/arch/sparc64/include/db_machdep.h
sys/arch/sparc64/include/locore.h
sys/arch/sparc64/include/param.h
sys/arch/sparc64/include/vmparam.h
sys/arch/sparc64/sparc64/autoconf.c
sys/arch/sparc64/sparc64/clock.c
sys/arch/sparc64/sparc64/copy.S
sys/arch/sparc64/sparc64/cpu_in_cksum.S
sys/arch/sparc64/sparc64/db_disasm.c
sys/arch/sparc64/sparc64/locore.s
sys/arch/sparc64/sparc64/machdep.c
sys/arch/sparc64/sparc64/netbsd32_machdep.c
sys/arch/sparc64/sparc64/pmap.c
sys/arch/sparc64/sparc64/sunos_machdep.c
sys/arch/sparc64/sparc64/svr4_32_machdep.c
sys/arch/sparc64/sparc64/syscall.c
sys/arch/sparc64/sparc64/vm_machdep.c
sys/arch/sun2/conf/GENERIC
sys/arch/sun2/include/Makefile
sys/arch/sun2/include/fenv.h
sys/arch/sun3/include/Makefile
sys/arch/sun3/include/fenv.h
sys/arch/usermode/usermode/thunk.c
sys/arch/vax/include/ptrace.h
sys/arch/x68k/include/Makefile
sys/arch/x68k/include/fenv.h
sys/arch/x86/acpi/acpi_machdep.c
sys/arch/x86/conf/files.x86
sys/arch/x86/include/cacheinfo.h
sys/arch/x86/include/cpu.h
sys/arch/x86/include/cpuvar.h
sys/arch/x86/include/pci_machdep_common.h
sys/arch/x86/include/pmap.h
sys/arch/x86/pci/msipic.c
sys/arch/x86/pci/pci_machdep.c
sys/arch/x86/x86/bus_dma.c
sys/arch/x86/x86/cpu.c
sys/arch/x86/x86/cpu_ucode_intel.c
sys/arch/x86/x86/identcpu.c
sys/arch/x86/x86/intr.c
sys/arch/x86/x86/pmap.c
sys/arch/x86/x86/sys_machdep.c
sys/arch/xen/conf/files.xen
sys/arch/xen/x86/cpu.c
sys/arch/xen/xen/if_xennet_xenbus.c
sys/arch/xen/xen/xbd_xenbus.c
sys/arch/xen/xen/xbdback_xenbus.c
sys/arch/xen/xen/xennetback_xenbus.c
sys/arch/zaurus/conf/GENERIC
sys/compat/aoutm68k/aoutm68k_syscalls.c
sys/compat/aoutm68k/aoutm68k_sysent.c
sys/compat/common/compat_mod.c
sys/compat/common/compat_sysv_mod.c
sys/compat/common/kern_time_50.c
sys/compat/common/sysv_ipc_50.c
sys/compat/common/tty_60.c
sys/compat/common/vfs_syscalls_40.c
sys/compat/freebsd/freebsd_file.c
sys/compat/freebsd/freebsd_syscalls.c
sys/compat/freebsd/freebsd_sysent.c
sys/compat/ibcs2/ibcs2_syscalls.c
sys/compat/ibcs2/ibcs2_sysent.c
sys/compat/linux/arch/alpha/linux_signal.h
sys/compat/linux/arch/alpha/linux_syscall.h
sys/compat/linux/arch/alpha/linux_syscallargs.h
sys/compat/linux/arch/alpha/linux_syscalls.c
sys/compat/linux/arch/alpha/linux_sysent.c
sys/compat/linux/arch/alpha/syscalls.master
sys/compat/linux/arch/amd64/linux_signal.h
sys/compat/linux/arch/amd64/linux_syscall.h
sys/compat/linux/arch/amd64/linux_syscallargs.h
sys/compat/linux/arch/amd64/linux_syscalls.c
sys/compat/linux/arch/amd64/linux_sysent.c
sys/compat/linux/arch/amd64/linux_systrace_args.c
sys/compat/linux/arch/amd64/syscalls.master
sys/compat/linux/arch/arm/linux_ptrace.c
sys/compat/linux/arch/i386/linux_machdep.c
sys/compat/linux/arch/i386/linux_ptrace.c
sys/compat/linux/arch/i386/linux_syscalls.c
sys/compat/linux/arch/m68k/linux_syscalls.c
sys/compat/linux/arch/m68k/linux_sysent.c
sys/compat/linux/arch/mips/linux_signal.h
sys/compat/linux/arch/mips/linux_syscall.h
sys/compat/linux/arch/mips/linux_syscallargs.h
sys/compat/linux/arch/mips/linux_syscalls.c
sys/compat/linux/arch/mips/linux_sysent.c
sys/compat/linux/arch/mips/syscalls.master
sys/compat/linux/arch/powerpc/linux_ptrace.c
sys/compat/linux/arch/powerpc/linux_syscall.h
sys/compat/linux/arch/powerpc/linux_syscallargs.h
sys/compat/linux/arch/powerpc/linux_syscalls.c
sys/compat/linux/arch/powerpc/linux_sysent.c
sys/compat/linux/arch/powerpc/syscalls.master
sys/compat/linux/common/linux_blkio.c
sys/compat/linux/common/linux_exec_aout.c
sys/compat/linux/common/linux_hdio.c
sys/compat/linux/common/linux_mod.c
sys/compat/linux/common/linux_signal.c
sys/compat/linux32/common/linux32_mod.c
sys/compat/netbsd32/files.netbsd32
sys/compat/netbsd32/netbsd32.h
sys/compat/netbsd32/netbsd32_compat_10.c
sys/compat/netbsd32/netbsd32_compat_14.c
sys/compat/netbsd32/netbsd32_compat_50.c
sys/compat/netbsd32/netbsd32_compat_50_sysv.c
sys/compat/netbsd32/netbsd32_fs.c
sys/compat/netbsd32/netbsd32_ioctl.c
sys/compat/netbsd32/netbsd32_ioctl.h
sys/compat/netbsd32/netbsd32_ipc.c
sys/compat/netbsd32/netbsd32_mod.c
sys/compat/netbsd32/netbsd32_module.c
sys/compat/netbsd32/netbsd32_mqueue.c
sys/compat/netbsd32/netbsd32_netbsd.c
sys/compat/netbsd32/netbsd32_nfssvc.c
sys/compat/netbsd32/netbsd32_syscall.h
sys/compat/netbsd32/netbsd32_syscallargs.h
sys/compat/netbsd32/netbsd32_syscalls.c
sys/compat/netbsd32/netbsd32_syscalls_autoload.c
sys/compat/netbsd32/netbsd32_sysent.c
sys/compat/netbsd32/netbsd32_systrace_args.c
sys/compat/netbsd32/netbsd32_time.c
sys/compat/netbsd32/syscalls.conf
sys/compat/netbsd32/syscalls.master
sys/compat/osf1/osf1_mount.c
sys/compat/osf1/osf1_syscalls.c
sys/compat/osf1/osf1_sysent.c
sys/compat/sunos/sunos_exec_aout.c
sys/compat/sunos/sunos_ioctl.c
sys/compat/sunos/sunos_misc.c
sys/compat/sunos/sunos_syscalls.c
sys/compat/sunos/sunos_sysent.c
sys/compat/sunos32/sunos32_exec_aout.c
sys/compat/sunos32/sunos32_ioctl.c
sys/compat/sunos32/sunos32_misc.c
sys/compat/sunos32/sunos32_syscalls.c
sys/compat/sunos32/sunos32_sysent.c
sys/compat/svr4/svr4_syscalls.c
sys/compat/svr4/svr4_sysent.c
sys/compat/svr4/svr4_termios.c
sys/compat/svr4_32/svr4_32_exec.h
sys/compat/svr4_32/svr4_32_syscalls.c
sys/compat/svr4_32/svr4_32_sysent.c
sys/compat/svr4_32/svr4_32_termios.c
sys/compat/ultrix/ultrix_fs.c
sys/compat/ultrix/ultrix_syscalls.c
sys/compat/ultrix/ultrix_sysent.c
sys/conf/Makefile.kern.inc
sys/conf/debugsyms.c
sys/conf/files
sys/conf/param.c
sys/conf/std
sys/dev/DEVNAMES
sys/dev/acpi/acpi.c
sys/dev/acpi/acpi_mcfg.c
sys/dev/acpi/acpi_mcfg.h
sys/dev/acpi/files.acpi
sys/dev/acpi/valz_acpi.c
sys/dev/bluetooth/btmagic.c
sys/dev/ccd.c
sys/dev/cgd.c
sys/dev/clk/clk.c
sys/dev/clk/clk.h
sys/dev/clk/clk_backend.h
sys/dev/clk/files.clk
sys/dev/clockctl.c
sys/dev/dev_verbose.h
sys/dev/dksubr.c
sys/dev/dkvar.h
sys/dev/dkwedge/dk.c
sys/dev/dkwedge/dkwedge_mbr.c
sys/dev/fdt/fdt_clock.c
sys/dev/fdt/fdt_gpio.c
sys/dev/fdt/fdt_i2c.c
sys/dev/fdt/fdt_intr.c
sys/dev/fdt/fdt_openfirm.c
sys/dev/fdt/fdt_regulator.c
sys/dev/fdt/fdt_reset.c
sys/dev/fdt/fdt_subr.c
sys/dev/fdt/fdtbus.c
sys/dev/fdt/fdtvar.h
sys/dev/fdt/files.fdt
sys/dev/fdt/fixedregulator.c
sys/dev/fdt/gpiokeys.c
sys/dev/fdt/simplebus.c
sys/dev/filemon/filemon.c
sys/dev/filemon/filemon.h
sys/dev/filemon/filemon_wrapper.c
sys/dev/gpio/files.gpio
sys/dev/gpio/gpiobutton.c
sys/dev/hdaudio/hdafg.c
sys/dev/hdaudio/hdaudio.c
sys/dev/hdaudio/hdaudiovar.h
sys/dev/i2c/adm1021.c
sys/dev/i2c/adm1026.c
sys/dev/i2c/adm1026reg.h
sys/dev/i2c/as3722.c
sys/dev/i2c/as3722.h
sys/dev/i2c/at24cxx.c
sys/dev/i2c/axp20x.c
sys/dev/i2c/axp20xvar.h
sys/dev/i2c/dbcool.c
sys/dev/i2c/files.i2c
sys/dev/i2c/i2c.c
sys/dev/i2c/i2cvar.h
sys/dev/i2c/lm75.c
sys/dev/i2c/lm87.c
sys/dev/i2c/spdmem_i2c.c
sys/dev/i2c/titemp.c
sys/dev/ic/ahcisata_core.c
sys/dev/ic/athn.c
sys/dev/ic/athnvar.h
sys/dev/ic/com.c
sys/dev/ic/dwc_gmac_reg.h
sys/dev/ic/mpt_debug.c
sys/dev/ic/pcf8584.c
sys/dev/ic/smc90cx6.c
sys/dev/ic/spdmem.c
sys/dev/ic/spdmemreg.h
sys/dev/ic/spdmemvar.h
sys/dev/isa/fd.c
sys/dev/isapnp/isapnpdevs
sys/dev/isapnp/isapnpdevs.c
sys/dev/isapnp/isapnpdevs.h
sys/dev/iscsi/iscsi_send.c
sys/dev/marvell/gtpci.c
sys/dev/marvell/mvpex.c
sys/dev/marvell/mvspi.c
sys/dev/mii/igphy.c
sys/dev/mii/igphyreg.h
sys/dev/mii/ukphy.c
sys/dev/ofw/files.ofw
sys/dev/ofw/ofw_subr.c
sys/dev/ofw/openfirm.h
sys/dev/pci/agp_i810.c
sys/dev/pci/files.pci
sys/dev/pci/ichsmb.c
sys/dev/pci/if_alc.c
sys/dev/pci/if_alcreg.h
sys/dev/pci/if_athn_pci.c
sys/dev/pci/if_bge.c
sys/dev/pci/if_bgevar.h
sys/dev/pci/if_ipw.c
sys/dev/pci/if_iwm.c
sys/dev/pci/if_iwmvar.h
sys/dev/pci/if_iwn.c
sys/dev/pci/if_iwnvar.h
sys/dev/pci/if_re_pci.c
sys/dev/pci/if_rtwn.c
sys/dev/pci/if_rtwnreg.h
sys/dev/pci/if_vioif.c
sys/dev/pci/if_wm.c
sys/dev/pci/if_wmreg.h
sys/dev/pci/if_wmvar.h
sys/dev/pci/ld_virtio.c
sys/dev/pci/n8/common/api/n8_key_works.c
sys/dev/pci/pci.c
sys/dev/pci/pci_stub.c
sys/dev/pci/pci_subr.c
sys/dev/pci/pcidevs
sys/dev/pci/pcidevs.h
sys/dev/pci/pcidevs_data.h
sys/dev/pci/pcireg.h
sys/dev/pci/pcivar.h
sys/dev/pci/piixpm.c
sys/dev/pci/ppb.c
sys/dev/pci/pucdata.c
sys/dev/pci/rtsx_pci.c
sys/dev/pci/unichromefb.c
sys/dev/pci/viomb.c
sys/dev/pci/viornd.c
sys/dev/pci/vioscsi.c
sys/dev/pci/vioscsireg.h
sys/dev/pci/virtio.c
sys/dev/pci/virtioreg.h
sys/dev/pci/virtiovar.h
sys/dev/pud/pud_dev.c
sys/dev/qbus/rf.c
sys/dev/raidframe/rf_driver.c
sys/dev/raidframe/rf_driver.h
sys/dev/raidframe/rf_netbsdkintf.c
sys/dev/sbus/stp4020.c
sys/dev/sbus/zx.c
sys/dev/sdmmc/sdhc.c
sys/dev/sdmmc/sdhcvar.h
sys/dev/sdmmc/sdmmc.c
sys/dev/sdmmc/sdmmc_io.c
sys/dev/sdmmc/sdmmc_mem.c
sys/dev/sdmmc/sdmmcreg.h
sys/dev/sdmmc/sdmmcvar.h
sys/dev/spi/oj6sh.c
sys/dev/sun/disklabel.h
sys/dev/sysmon/sysmon_envsys.c
sys/dev/sysmon/sysmon_envsys_events.c
sys/dev/sysmon/sysmon_power.c
sys/dev/sysmon/sysmon_wdog.c
sys/dev/usb/ehci.c
sys/dev/usb/files.usb
sys/dev/usb/if_urtwn.c
sys/dev/usb/ucom.c
sys/dev/usb/ukbdmap.c
sys/dev/usb/umct.c
sys/dev/usb/uplcom.c
sys/dev/usb/usb.c
sys/dev/usb/usb_subr.c
sys/dev/usb/usbdevs
sys/dev/usb/usbdevs.h
sys/dev/usb/usbdevs_data.h
sys/dev/usb/usbdi.c
sys/dev/usb/usbhist.h
sys/dev/usb/xhcireg.h
sys/dev/veriexec.c
sys/dev/verified_exec.c
sys/dev/vnd.c
sys/dev/wscons/wsdisplay_vcons.c
sys/dev/wscons/wsemul_sun.c
sys/external/bsd/drm/dist/libdrm/xf86drm.c
sys/external/bsd/drm2/dist/drm/drm_edid.c
sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
sys/external/bsd/drm2/dist/drm/drm_modes.c
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
sys/external/bsd/drm2/dist/drm/nouveau/Makefile
sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_object.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_nve0.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_gk20a.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/ctxnvc0.h
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxgk20a.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_ctxnve4.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_gk20a.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nvc0.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nouveau_engine_graph_nve4.c
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/graph/nvc0.h
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/fifo.h
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/graph.h
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/fb.h
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/ibus.h
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/vm.h
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_nvc0.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_gk20a.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_ramgk20a.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/priv.h
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/ibus/nouveau_subdev_ibus_gk20a.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_base.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_fan.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c
sys/external/bsd/drm2/dist/drm/radeon/radeon_gem.c
sys/external/bsd/drm2/dist/drm/radeon/radeon_i2c.c
sys/external/bsd/drm2/dist/drm/radeon/radeon_kms.c
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h
sys/external/bsd/drm2/drm/drm_cache.c
sys/external/bsd/drm2/drm/drm_drv.c
sys/external/bsd/drm2/drm/drm_memory.c
sys/external/bsd/drm2/drm/drmfb.c
sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h
sys/external/bsd/drm2/include/linux/acpi.h
sys/external/bsd/drm2/include/linux/bitops.h
sys/external/bsd/drm2/include/linux/hdmi.h
sys/external/bsd/drm2/include/linux/mm.h
sys/external/bsd/drm2/include/linux/pci.h
sys/external/bsd/drm2/include/linux/platform_device.h
sys/external/bsd/drm2/linux/linux_work.c
sys/external/bsd/drm2/linux/linux_writecomb.c
sys/external/bsd/drm2/nouveau/files.nouveau
sys/external/bsd/drm2/nouveau/nouveau_module.c
sys/external/bsd/drm2/nouveau/nouveau_pci.c
sys/external/bsd/drm2/nouveau/nouveau_pci.h
sys/external/bsd/drm2/nouveau/nouveaufb.c
sys/external/bsd/drm2/radeon/radeondrmkmsfb.c
sys/external/bsd/drm2/ttm/ttm_agp_backend.c
sys/external/bsd/dwc2/dist/dwc2_hcd.c
sys/external/bsd/dwc2/dwc2.c
sys/external/bsd/gnu-efi/dist/lib/hand.c
sys/external/bsd/ipf/netinet/ip_nat.c
sys/external/bsd/ipf/netinet/ip_nat6.c
sys/external/bsd/ipf/netinet/radix_ipf.c
sys/external/bsd/libfdt/conf/files.libfdt
sys/external/bsd/libfdt/dist/Makefile.libfdt
sys/external/bsd/libfdt/dist/TODO
sys/external/bsd/libfdt/dist/fdt.c
sys/external/bsd/libfdt/dist/fdt.h
sys/external/bsd/libfdt/dist/fdt_addresses.c
sys/external/bsd/libfdt/dist/fdt_empty_tree.c
sys/external/bsd/libfdt/dist/fdt_ro.c
sys/external/bsd/libfdt/dist/fdt_rw.c
sys/external/bsd/libfdt/dist/fdt_strerror.c
sys/external/bsd/libfdt/dist/fdt_sw.c
sys/external/bsd/libfdt/dist/fdt_wip.c
sys/external/bsd/libfdt/dist/libfdt.h
sys/external/bsd/libfdt/dist/libfdt_env.h
sys/external/bsd/libfdt/dist/libfdt_internal.h
sys/external/bsd/libfdt/dist/version.lds
sys/external/isc/atheros_hal/dist/ar5210/ar5210_reset.c
sys/fs/adosfs/advfsops.c
sys/fs/efs/efs_subr.c
sys/fs/nfs/nlm/nlm_prot_impl.c
sys/fs/puffs/puffs_vfsops.c
sys/fs/sysvbfs/sysvbfs_vnops.c
sys/fs/tmpfs/tmpfs_subr.c
sys/fs/udf/udf_strat_direct.c
sys/fs/udf/udf_strat_rmw.c
sys/fs/udf/udf_strat_sequential.c
sys/fs/udf/udf_subr.c
sys/kern/exec_elf.c
sys/kern/exec_subr.c
sys/kern/files.kern
sys/kern/init_main.c
sys/kern/init_sysctl.c
sys/kern/init_sysent.c
sys/kern/kern_auth.c
sys/kern/kern_drvctl.c
sys/kern/kern_event.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_history.c
sys/kern/kern_ksyms.c
sys/kern/kern_lwp.c
sys/kern/kern_module.c
sys/kern/kern_ntptime.c
sys/kern/kern_pax.c
sys/kern/kern_proc.c
sys/kern/kern_runq.c
sys/kern/kern_sdt.c
sys/kern/kern_sig.c
sys/kern/kern_softint.c
sys/kern/kern_synch.c
sys/kern/kern_syscall.c
sys/kern/kern_sysctl.c
sys/kern/kern_time.c
sys/kern/kern_timeout.c
sys/kern/kern_xxx.c
sys/kern/makesyscalls.sh
sys/kern/subr_autoconf.c
sys/kern/subr_disk.c
sys/kern/subr_disk_open.c
sys/kern/subr_lockdebug.c
sys/kern/sys_module.c
sys/kern/sys_sig.c
sys/kern/syscalls.c
sys/kern/syscalls.conf
sys/kern/syscalls.master
sys/kern/syscalls_autoload.c
sys/kern/systrace_args.c
sys/kern/sysv_ipc.c
sys/kern/sysv_msg.c
sys/kern/sysv_sem.c
sys/kern/sysv_shm.c
sys/kern/tty.c
sys/kern/uipc_sem.c
sys/kern/uipc_socket.c
sys/kern/uipc_syscalls.c
sys/kern/vfs_cache.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnode.c
sys/kern/vfs_wapbl.c
sys/lib/libkern/Makefile.inc
sys/miscfs/specfs/spec_vnops.c
sys/modules/Makefile
sys/modules/clockctl/Makefile
sys/modules/clockctl/clockctl.ioconf
sys/modules/compat_netbsd32/Makefile
sys/modules/compat_netbsd32_mqueue/Makefile
sys/modules/compat_netbsd32_nfssrv/Makefile
sys/modules/compat_netbsd32_sysvipc/Makefile
sys/modules/compat_sysv/Makefile
sys/modules/drvctl/Makefile
sys/modules/drvctl/drvctl.ioconf
sys/modules/raid/Makefile
sys/modules/raid/raid.ioconf
sys/modules/raidframe/Makefile
sys/modules/sysv_ipc/Makefile
sys/modules/wapbl/Makefile
sys/net/bpf.c
sys/net/files.net
sys/net/if.c
sys/net/if.h
sys/net/if_arcsubr.c
sys/net/if_bridge.c
sys/net/if_ether.h
sys/net/if_ethersubr.c
sys/net/if_fddisubr.c
sys/net/if_gif.c
sys/net/if_gif.h
sys/net/if_ieee1394subr.c
sys/net/if_llatbl.c
sys/net/if_llatbl.h
sys/net/if_token.h
sys/net/if_tokensubr.c
sys/net/if_vlan.c
sys/net/npf/npf.c
sys/net/npf/npf_ctl.c
sys/net/npf/npf_inet.c
sys/net/npf/npf_mbuf.c
sys/net/route.c
sys/net/rtsock.c
sys/netbt/hci.h
sys/netbt/hci_event.c
sys/netbt/hci_ioctl.c
sys/netbt/hci_socket.c
sys/netbt/l2cap.h
sys/netbt/l2cap_signal.c
sys/netinet/Makefile
sys/netinet/files.netinet
sys/netinet/if_arp.c
sys/netinet/in.c
sys/netinet/in.h
sys/netinet/in_gif.c
sys/netinet/in_proto.c
sys/netinet/ip_encap.c
sys/netinet/ip_input.c
sys/netinet/sctp.h
sys/netinet/sctp_asconf.c
sys/netinet/sctp_asconf.h
sys/netinet/sctp_constants.h
sys/netinet/sctp_crc32.c
sys/netinet/sctp_crc32.h
sys/netinet/sctp_hashdriver.c
sys/netinet/sctp_hashdriver.h
sys/netinet/sctp_header.h
sys/netinet/sctp_indata.c
sys/netinet/sctp_indata.h
sys/netinet/sctp_input.c
sys/netinet/sctp_input.h
sys/netinet/sctp_output.c
sys/netinet/sctp_output.h
sys/netinet/sctp_pcb.c
sys/netinet/sctp_pcb.h
sys/netinet/sctp_peeloff.c
sys/netinet/sctp_peeloff.h
sys/netinet/sctp_structs.h
sys/netinet/sctp_timer.c
sys/netinet/sctp_timer.h
sys/netinet/sctp_uio.h
sys/netinet/sctp_usrreq.c
sys/netinet/sctp_var.h
sys/netinet/sctputil.c
sys/netinet/sctputil.h
sys/netinet6/files.netinet6
sys/netinet6/in6.c
sys/netinet6/in6.h
sys/netinet6/in6_gif.c
sys/netinet6/in6_proto.c
sys/netinet6/in6_src.c
sys/netinet6/in6_var.h
sys/netinet6/ip6_input.c
sys/netinet6/mld6.c
sys/netinet6/nd6.c
sys/netinet6/nd6.h
sys/netinet6/nd6_nbr.c
sys/netinet6/nd6_rtr.c
sys/netinet6/sctp6_usrreq.c
sys/netinet6/sctp6_var.h
sys/netnatm/natm.c
sys/nfs/nfs_vfsops.c
sys/opencrypto/crypto.c
sys/opencrypto/cryptodev.h
sys/rump/Makefile.rump
sys/rump/dev/Makefile.rumpdevcomp
sys/rump/dev/files.rump
sys/rump/dev/lib/Makefile.inc
sys/rump/dev/lib/component_simple.c
sys/rump/dev/lib/libaudio/Makefile
sys/rump/dev/lib/libaudio_ac97/Makefile
sys/rump/dev/lib/libbpf/Makefile
sys/rump/dev/lib/libcgd/Makefile
sys/rump/dev/lib/libdisk/Makefile
sys/rump/dev/lib/libdm/Makefile
sys/rump/dev/lib/libdrvctl/Makefile
sys/rump/dev/lib/libfss/Makefile
sys/rump/dev/lib/libhdaudio_hdafg/Makefile
sys/rump/dev/lib/libmd/Makefile
sys/rump/dev/lib/libmiiphy/Makefile
sys/rump/dev/lib/libmiiphy/phy_at_mii.c
sys/rump/dev/lib/libnetsmb/Makefile
sys/rump/dev/lib/libopencrypto/Makefile
sys/rump/dev/lib/libpad/Makefile
sys/rump/dev/lib/libpci/Makefile
sys/rump/dev/lib/libpci_auich/Makefile
sys/rump/dev/lib/libpci_auich/auich_at_pci.c
sys/rump/dev/lib/libpci_eap/Makefile
sys/rump/dev/lib/libpci_eap/eap_at_pci.c
sys/rump/dev/lib/libpci_hdaudio/Makefile
sys/rump/dev/lib/libpci_if_iwn/Makefile
sys/rump/dev/lib/libpci_if_iwn/iwn_at_pci.c
sys/rump/dev/lib/libpci_if_pcn/Makefile
sys/rump/dev/lib/libpci_if_pcn/pcn_at_pci.c
sys/rump/dev/lib/libpci_if_wm/Makefile
sys/rump/dev/lib/libpci_if_wm/wm_at_pci.c
sys/rump/dev/lib/libpci_usbhc/Makefile
sys/rump/dev/lib/libpci_usbhc/usbhc_at_pci.c
sys/rump/dev/lib/libpci_virtio/Makefile
sys/rump/dev/lib/libpci_virtio/virtio_at_pci.c
sys/rump/dev/lib/libpud/Makefile
sys/rump/dev/lib/libputter/Makefile
sys/rump/dev/lib/libraidframe/Makefile
sys/rump/dev/lib/libraidframe/raidframe_component.c
sys/rump/dev/lib/librnd/Makefile
sys/rump/dev/lib/libscsipi/Makefile
sys/rump/dev/lib/libsysmon/Makefile
sys/rump/dev/lib/libubt/Makefile
sys/rump/dev/lib/libubt/ubt_at_usb.c
sys/rump/dev/lib/libucom/Makefile
sys/rump/dev/lib/libugenhc/Makefile
sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c
sys/rump/dev/lib/libulpt/Makefile
sys/rump/dev/lib/libumass/Makefile
sys/rump/dev/lib/libusb/Makefile
sys/rump/dev/lib/libusb/usb_at_hc.c
sys/rump/dev/lib/libvirtio_if_vioif/Makefile
sys/rump/dev/lib/libvirtio_if_vioif/vioif_at_virtio.c
sys/rump/dev/lib/libvirtio_ld/Makefile
sys/rump/dev/lib/libvirtio_viornd/Makefile
sys/rump/dev/lib/libvirtio_viornd/viornd_at_virtio.c
sys/rump/dev/lib/libvirtio_vioscsi/Makefile
sys/rump/dev/lib/libvirtio_vioscsi/VIRTIO_VIOSCSI.ioconf
sys/rump/dev/lib/libvnd/Makefile
sys/rump/dev/lib/libwscons/Makefile
sys/rump/fs/Makefile.rumpfscomp
sys/rump/fs/lib/libaio/Makefile
sys/rump/fs/lib/libcd9660/Makefile
sys/rump/fs/lib/libefs/Makefile
sys/rump/fs/lib/libext2fs/Makefile
sys/rump/fs/lib/libfdesc/Makefile
sys/rump/fs/lib/libffs/Makefile
sys/rump/fs/lib/libfifovfs/Makefile
sys/rump/fs/lib/libhfs/Makefile
sys/rump/fs/lib/libkernfs/Makefile
sys/rump/fs/lib/liblayervfs/Makefile
sys/rump/fs/lib/liblfs/Makefile
sys/rump/fs/lib/libmfs/Makefile
sys/rump/fs/lib/libmsdos/Makefile
sys/rump/fs/lib/libnfs/Makefile
sys/rump/fs/lib/libnfsserver/Makefile
sys/rump/fs/lib/libnilfs/Makefile
sys/rump/fs/lib/libntfs/Makefile
sys/rump/fs/lib/libnull/Makefile
sys/rump/fs/lib/libptyfs/Makefile
sys/rump/fs/lib/libsmbfs/Makefile
sys/rump/fs/lib/libsyspuffs/Makefile
sys/rump/fs/lib/libsysvbfs/Makefile
sys/rump/fs/lib/libtmpfs/Makefile
sys/rump/fs/lib/libudf/Makefile
sys/rump/fs/lib/libumap/Makefile
sys/rump/fs/lib/libunion/Makefile
sys/rump/fs/lib/libv7fs/Makefile
sys/rump/fs/lib/libzfs/Makefile
sys/rump/include/rump/rump.h
sys/rump/include/rump/rump_syscalls.h
sys/rump/kern/Makefile.rumpkerncomp
sys/rump/kern/lib/libcrypto/Makefile
sys/rump/kern/lib/libsljit/Makefile
sys/rump/kern/lib/libsolaris/Makefile
sys/rump/kern/lib/libsys_cygwin/Makefile
sys/rump/kern/lib/libsys_linux/Makefile
sys/rump/kern/lib/libsys_sunos/Makefile
sys/rump/kern/lib/libsysproxy/Makefile
sys/rump/kern/lib/libtty/Makefile
sys/rump/kern/lib/libz/Makefile
sys/rump/librump/rumpdev/Makefile.rumpdev
sys/rump/librump/rumpkern/Makefile.rumpkern
sys/rump/librump/rumpkern/locks.c
sys/rump/librump/rumpkern/rump_syscalls.c
sys/rump/librump/rumpkern/vm.c
sys/rump/librump/rumpnet/Makefile.rumpnet
sys/rump/librump/rumpvfs/Makefile.rumpvfs
sys/rump/librump/rumpvfs/rumpblk.c
sys/rump/net/Makefile.rumpnetcomp
sys/rump/net/lib/libagr/Makefile
sys/rump/net/lib/libbpfjit/Makefile
sys/rump/net/lib/libbridge/Makefile
sys/rump/net/lib/libgif/GIF.ioconf
sys/rump/net/lib/libgif/Makefile
sys/rump/net/lib/libgif/gif_component.c
sys/rump/net/lib/liblocal/Makefile
sys/rump/net/lib/libnet/Makefile
sys/rump/net/lib/libnet80211/Makefile
sys/rump/net/lib/libnetbt/Makefile
sys/rump/net/lib/libnetinet/Makefile
sys/rump/net/lib/libnetinet6/Makefile
sys/rump/net/lib/libnetmpls/Makefile
sys/rump/net/lib/libnpf/Makefile
sys/rump/net/lib/libshmif/Makefile
sys/rump/net/lib/libsockin/Makefile
sys/rump/net/lib/libtap/Makefile
sys/rump/net/lib/libvirtif/Makefile
sys/secmodel/extensions/secmodel_extensions.c
sys/sys/cdefs.h
sys/sys/clockctl.h
sys/sys/device.h
sys/sys/devmon.h
sys/sys/disk.h
sys/sys/disklabel.h
sys/sys/dkio.h
sys/sys/event.h
sys/sys/exec.h
sys/sys/exec_elf.h
sys/sys/fd_set.h
sys/sys/gpio.h
sys/sys/kauth.h
sys/sys/kernhist.h
sys/sys/mbuf.h
sys/sys/module.h
sys/sys/mount.h
sys/sys/msg.h
sys/sys/param.h
sys/sys/pax.h
sys/sys/proc.h
sys/sys/protosw.h
sys/sys/queue.h
sys/sys/resourcevar.h
sys/sys/sdt.h
sys/sys/sem.h
sys/sys/shm.h
sys/sys/socket.h
sys/sys/syscall.h
sys/sys/syscallargs.h
sys/sys/syscallvar.h
sys/sys/sysctl.h
sys/sys/syslog.h
sys/sys/systm.h
sys/sys/time.h
sys/ufs/ffs/ffs_vfsops.c
sys/ufs/lfs/lfs.h
sys/ufs/lfs/lfs_accessors.h
sys/ufs/lfs/lfs_alloc.c
sys/ufs/lfs/lfs_balloc.c
sys/ufs/lfs/lfs_bio.c
sys/ufs/lfs/lfs_rfw.c
sys/ufs/lfs/lfs_segment.c
sys/ufs/lfs/lfs_subr.c
sys/ufs/lfs/lfs_syscalls.c
sys/ufs/lfs/lfs_vfsops.c
sys/ufs/lfs/ulfs_inode.c
sys/ufs/lfs/ulfs_lookup.c
sys/ufs/lfs/ulfs_quota2.c
sys/ufs/lfs/ulfs_readwrite.c
sys/ufs/lfs/ulfs_snapshot.c
sys/ufs/lfs/ulfs_vnops.c
sys/ufs/lfs/ulfsmount.h
sys/uvm/pmap/pmap.c
sys/uvm/pmap/pmap_pvt.c
sys/uvm/pmap/pmap_pvt.h
sys/uvm/pmap/tlb.h
sys/uvm/uvm_extern.h
sys/uvm/uvm_map.c
sys/uvm/uvm_mmap.c
sys/uvm/uvm_mremap.c
sys/uvm/uvm_object.c
sys/uvm/uvm_param.h
sys/uvm/uvm_vnode.c
--- a/sys/arch/aarch64/include/ptrace.h	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/aarch64/include/ptrace.h	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.2.4.1 2015/09/22 12:05:34 skrll Exp $ */
+/* $NetBSD: ptrace.h,v 1.2.4.2 2015/12/27 12:09:27 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -56,6 +56,9 @@
 #define PTRACE_REG_SP(r)	(r)->r_sp
 #define PTRACE_REG_INTRV(r)	(r)->r_reg[0]
 
+#define PTRACE_BREAKPOINT	((const uint8_t[]) { 0xd4, 0x20, 0x01, 0xa0 })
+#define PTRACE_BREAKPOINT_SIZE	4
+
 #elif defined(__arm__)
 
 #include <arm/ptrace.h>
--- a/sys/arch/acorn32/podulebus/esc.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/acorn32/podulebus/esc.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: esc.c,v 1.29 2014/10/25 10:58:12 skrll Exp $	*/
+/*	$NetBSD: esc.c,v 1.29.2.1 2015/12/27 12:09:27 skrll Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esc.c,v 1.29 2014/10/25 10:58:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esc.c,v 1.29.2.1 2015/12/27 12:09:27 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1445,6 +1445,7 @@
 			switch(dev->sc_msg_in[0]) {
 			case 0x00:	/* COMMAND COMPLETE */
 				nexus->state = ESC_NS_DONE;
+				break;
 			case 0x04:	/* DISCONNECT */
 				nexus->state = ESC_NS_DISCONNECTING;
 				break;
--- a/sys/arch/algor/include/Makefile	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/algor/include/Makefile	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2011/07/17 20:54:35 joerg Exp $
+#	$NetBSD: Makefile,v 1.14.30.1 2015/12/27 12:09:27 skrll Exp $
 
 INCSDIR=/usr/include/algor
 
@@ -7,7 +7,7 @@
 	cdefs.h cpu.h \
 	disklabel.h \
 	ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \
-	float.h \
+	fenv.h float.h \
 	ieee.h ieeefp.h \
 	int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
 	intr.h \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/algor/include/fenv.h	Sun Dec 27 12:09:27 2015 +0000
@@ -0,0 +1,3 @@
+/*	$NetBSD: fenv.h,v 1.1.2.2 2015/12/27 12:09:27 skrll Exp $	*/
+
+#include <mips/fenv.h>
--- a/sys/arch/algor/pci/vtpbc.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/algor/pci/vtpbc.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vtpbc.c,v 1.9 2012/10/27 17:17:25 chs Exp $	*/
+/*	$NetBSD: vtpbc.c,v 1.9.14.1 2015/12/27 12:09:27 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vtpbc.c,v 1.9 2012/10/27 17:17:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vtpbc.c,v 1.9.14.1 2015/12/27 12:09:27 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -165,6 +165,9 @@
 {
 	int b, d, f;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (1);
+
 	vtpbc_decompose_tag(vt, tag, &b, &d, &f);
 
 	if (b == 0) {
--- a/sys/arch/alpha/alpha/cpu.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/alpha/cpu.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.95 2012/02/06 02:14:10 matt Exp $ */
+/* $NetBSD: cpu.c,v 1.95.24.1 2015/12/27 12:09:27 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.95 2012/02/06 02:14:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.95.24.1 2015/12/27 12:09:27 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -217,7 +217,7 @@
 			s = cpunametable[i].cpu_minor_names;
 			for(i = 0; s && s[i]; ++i) {
 				if (i == minor && strlen(s[i]) != 0) {
-					aprint_normal(" (%s)\n", s[i]);
+					aprint_normal(" (%s)", s[i]);
 					goto recognized;
 				}
 			}
--- a/sys/arch/alpha/alpha/dec_kn300.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/alpha/dec_kn300.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_kn300.c,v 1.40 2012/10/13 17:58:54 jdc Exp $ */
+/* $NetBSD: dec_kn300.c,v 1.40.14.1 2015/12/27 12:09:27 skrll Exp $ */
 
 /*
  * Copyright (c) 1998 by Matthew Jacob
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.40 2012/10/13 17:58:54 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.40.14.1 2015/12/27 12:09:27 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -431,8 +431,8 @@
 
 	printf("kn300: CPU ID %d %s correctable error corrected by %s\n", whami,
 	    (type == ALPHA_SYS_ERROR)?  sys : proc,
-	    ((hdr->mcheck_code & 0xff00) == (EV5_CORRECTED << 16))? proc :
-	    (((hdr->mcheck_code & 0xff00) == (CAP_ERR_CRDX << 16)) ?
+	    ((hdr->mcheck_code & 0xff00) == (EV5_CORRECTED << 8))? proc :
+	    (((hdr->mcheck_code & 0xff00) == (CAP_ERR_CRDX << 8)) ?
 		"I/O Bridge Module" : sys));
 
 	printf("    Machine Check Code 0x%lx\n", hdr->mcheck_code);
--- a/sys/arch/alpha/alpha/pmap.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/alpha/pmap.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.259 2014/01/01 22:35:54 matt Exp $ */
+/* $NetBSD: pmap.c,v 1.259.6.1 2015/12/27 12:09:27 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.259 2014/01/01 22:35:54 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.259.6.1 2015/12/27 12:09:27 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -149,7 +149,6 @@
 #include <sys/malloc.h>
 #include <sys/pool.h>
 #include <sys/buf.h>
-#include <sys/shm.h>
 #include <sys/atomic.h>
 #include <sys/cpu.h>
 
@@ -778,9 +777,6 @@
 		 bufsz + 16 * NCARGS + pager_map_size) / PAGE_SIZE +
 		(maxproc * UPAGES) + nkmempages;
 
-#ifdef SYSVSHM
-	lev3mapsize += shminfo.shmall;
-#endif
 	lev3mapsize = roundup(lev3mapsize, NPTEPG);
 
 	/*
--- a/sys/arch/alpha/conf/GENERIC	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/conf/GENERIC	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.362.2.2 2015/09/22 12:05:35 skrll Exp $
+# $NetBSD: GENERIC,v 1.362.2.3 2015/12/27 12:09:27 skrll Exp $
 #
 # This machine description file is used to generate the default NetBSD
 # kernel.
@@ -19,7 +19,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident		"GENERIC-$Revision: 1.362.2.2 $"
+ident		"GENERIC-$Revision: 1.362.2.3 $"
 
 maxusers 32
 
@@ -789,5 +789,4 @@
 #options 	VERIFIED_EXEC_FP_MD5
 
 options PAX_MPROTECT=0			# PaX mprotect(2) restrictions
-#options PAX_SEGVGUARD=0			# PaX Segmentation fault guard
 options PAX_ASLR=0			# PaX Address Space Layout Randomization
--- a/sys/arch/alpha/include/ptrace.h	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/include/ptrace.h	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.6.74.1 2015/09/22 12:05:35 skrll Exp $ */
+/* $NetBSD: ptrace.h,v 1.6.74.2 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -46,7 +46,11 @@
 	"PT_SETFPREGS",
 
 #include <machine/reg.h>
+
 #define PTRACE_REG_PC(r)	(r)->r_regs[R_ZERO]
 #define PTRACE_REG_SET_PC(r, v)	(r)->r_regs[R_ZERO] = (v)
 #define PTRACE_REG_SP(r)	(r)->r_regs[R_SP]
 #define PTRACE_REG_INTRV(r)	(r)->r_regs[R_V0]
+
+#define PTRACE_BREAKPOINT	((const uint8_t[]) { 0x80, 0x00, 0x00, 0x00 })
+#define PTRACE_BREAKPOINT_SIZE	4
--- a/sys/arch/alpha/pci/apecs_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/apecs_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apecs_pci.c,v 1.25 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: apecs_pci.c,v 1.25.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.25 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.25.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,6 +101,9 @@
 	int s, secondary, ba;
 	int32_t old_haxr2;					/* XXX */
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 	s = 0;					/* XXX gcc -Wuninitialized */
 	old_haxr2 = 0;				/* XXX gcc -Wuninitialized */
 
@@ -146,6 +149,9 @@
 	int s, secondary;
 	int32_t old_haxr2;					/* XXX */
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	s = 0;					/* XXX gcc -Wuninitialized */
 	old_haxr2 = 0;				/* XXX gcc -Wuninitialized */
 
--- a/sys/arch/alpha/pci/cia.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/cia.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cia.c,v 1.73 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: cia.c,v 1.73.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.73 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.73.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -268,7 +268,6 @@
 	struct pcibus_attach_args pba;
 	char bits[64];
 	const char *name;
-	int pass;
 
 	/* note that we've attached the chipset; can't have 2 CIAs. */
 	ciafound = 1;
@@ -284,14 +283,12 @@
 
 	if (ccp->cc_flags & CCF_ISPYXIS) {
 		name = "Pyxis";
-		pass = ccp->cc_rev;
 	} else {
 		name = "ALCOR/ALCOR2";
-		pass = ccp->cc_rev + 1;
 	}
 
 	aprint_normal(": DECchip 2117x Core Logic Chipset (%s), pass %d\n",
-	    name, pass);
+	    name, ccp->cc_rev + 1);
 	if (ccp->cc_cnfg) {
 		snprintb(bits, sizeof(bits), CIA_CSR_CNFG_BITS, ccp->cc_cnfg);
 		aprint_normal_dev(self, "extended capabilities: %s\n", bits);
--- a/sys/arch/alpha/pci/cia_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/cia_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cia_pci.c,v 1.32 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: cia_pci.c,v 1.32.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.32 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.32.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,6 +101,9 @@
 	int s, secondary, ba;
 	uint32_t old_cfg, errbits;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 #ifdef __GNUC__
 	s = 0;					/* XXX gcc -Wuninitialized */
 	old_cfg = 0;				/* XXX gcc -Wuninitialized */
@@ -196,6 +199,9 @@
 	int s, secondary;
 	uint32_t old_cfg;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 #ifdef __GNUC__
 	s = 0;					/* XXX gcc -Wuninitialized */
 	old_cfg = 0;				/* XXX gcc -Wuninitialized */
--- a/sys/arch/alpha/pci/dwlpx_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/dwlpx_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwlpx_pci.c,v 1.18 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: dwlpx_pci.c,v 1.18.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1997 by Matthew Jacob
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dwlpx_pci.c,v 1.18 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwlpx_pci.c,v 1.18.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -125,6 +125,9 @@
 	int secondary, i, s = 0;
 	uint32_t rvp;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (data);
+
 	if (ccp == NULL) {
 		panic("NULL ccp in dwlpx_conf_read");
 	}
@@ -191,6 +194,9 @@
 	int secondary, i, s = 0;
 	uint32_t rvp;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	if (ccp == NULL) {
 		panic("NULL ccp in dwlpx_conf_write");
 	}
--- a/sys/arch/alpha/pci/irongate_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/irongate_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: irongate_pci.c,v 1.9 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: irongate_pci.c,v 1.9.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.9 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.9.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -116,6 +116,9 @@
 {
 	int d;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 	/*
 	 * The AMD 751 appears in PCI configuration space, but
 	 * that is ... counter-intuitive to the way we normally
@@ -136,6 +139,9 @@
 	pcireg_t data;
 	int s;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 	PCI_CONF_LOCK(s);
 	REGVAL(PCI_CONF_ADDR) = (CONFADDR_ENABLE | tag | (offset & 0xff));
 	alpha_mb();
@@ -152,6 +158,9 @@
 {
 	int s;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	PCI_CONF_LOCK(s);
 	REGVAL(PCI_CONF_ADDR) = (CONFADDR_ENABLE | tag | (offset & 0xff));
 	alpha_mb();
--- a/sys/arch/alpha/pci/lca_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/lca_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lca_pci.c,v 1.21 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: lca_pci.c,v 1.21.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.21 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.21.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,6 +103,9 @@
 	pcireg_t *datap, data;
 	int s, secondary, device, ba;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 	s = 0;					/* XXX gcc -Wuninitialized */
 
 	/* secondary if bus # != 0 */
@@ -153,6 +156,9 @@
 	pcireg_t *datap;
 	int s, secondary, device;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	s = 0;					/* XXX gcc -Wuninitialized */
 
 	/* secondary if bus # != 0 */
--- a/sys/arch/alpha/pci/mcpcia_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/mcpcia_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcpcia_pci.c,v 1.11 2012/02/06 02:14:14 matt Exp $ */
+/* $NetBSD: mcpcia_pci.c,v 1.11.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1998 by Matthew Jacob
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.11 2012/02/06 02:14:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.11.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,6 +108,9 @@
 	pcireg_t *dp, data = (pcireg_t) -1;
 	unsigned long paddr;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (data);
+
 	/*
 	 * There's nothing in slot 0 on a primary bus- don't even try.
 	 */
@@ -136,6 +139,9 @@
 	pcireg_t *dp;
 	unsigned long paddr;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	/*
 	 * There's nothing in slot 0 on a primary bus- don't even try.
 	 */
--- a/sys/arch/alpha/pci/tsp_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/tsp_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tsp_pci.c,v 1.9 2011/06/14 15:34:22 matt Exp $ */
+/* $NetBSD: tsp_pci.c,v 1.9.30.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 1999 by Ross Harvey.  All rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: tsp_pci.c,v 1.9 2011/06/14 15:34:22 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsp_pci.c,v 1.9.30.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -110,6 +110,9 @@
 	pcireg_t *datap, data;
 	struct tsp_config *pcp = cpv;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 	datap = S_PAGE(pcp->pc_iobase | P_PCI_CONFIG | tag | (offset & ~3));
 	alpha_mb();
 	data = *datap;
@@ -123,6 +126,9 @@
 	pcireg_t *datap;
 	struct tsp_config *pcp = cpv;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	datap = S_PAGE(pcp->pc_iobase | P_PCI_CONFIG | tag | (offset & ~3));
 	alpha_mb();
 	*datap = data;
--- a/sys/arch/alpha/pci/ttwoga_pci.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/pci/ttwoga_pci.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttwoga_pci.c,v 1.7 2012/02/06 02:14:15 matt Exp $ */
+/* $NetBSD: ttwoga_pci.c,v 1.7.24.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: ttwoga_pci.c,v 1.7 2012/02/06 02:14:15 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttwoga_pci.c,v 1.7.24.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,6 +146,9 @@
 	paddr_t addr;
 	uint64_t old_hae3;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return (pcireg_t) -1;
+
 	pci_decompose_tag(&tcp->tc_pc, tag, &b, &d, &f);
 
 	addr = b ? tag : ttwoga_make_type0addr(d, f);
@@ -198,6 +201,9 @@
 	paddr_t addr;
 	uint64_t old_hae3;
 
+	if ((unsigned int)offset >= PCI_CONF_SIZE)
+		return;
+
 	pci_decompose_tag(&tcp->tc_pc, tag, &b, &d, &f);
 
 	addr = b ? tag : ttwoga_make_type0addr(d, f);
--- a/sys/arch/alpha/stand/standtest/test.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/alpha/stand/standtest/test.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: test.c,v 1.5 2011/01/22 19:19:15 joerg Exp $ */
+/* $NetBSD: test.c,v 1.5.32.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -275,7 +275,7 @@
 	}
 	buf = cvt_number(buf, &startaddr);
 	if (*buf != '\0' && !isspace(*buf)) {
-		printf("bad character '%c' in starting address\n");
+		printf("bad character '%c' in starting address\n", *buf);
 		return;
 	}
 
@@ -283,7 +283,7 @@
 	if (buf != NULL) {
 		buf = cvt_number(buf, &count);
 		if (*buf != '\0' && !isspace(*buf)) {
-			printf("bad character '%c' in count\n");
+			printf("bad character '%c' in count\n", *buf);
 			return;
 		}
 		buf = advance_past_space(buf);
--- a/sys/arch/amd64/amd64/amd64_trap.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/amd64_trap.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.2 2014/02/12 19:53:49 dsl Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.2.10.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.2 2014/02/12 19:53:49 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.2.10.1 2015/12/27 12:09:28 skrll Exp $");
 #endif
 
 /*
@@ -144,7 +144,7 @@
 #else
 	ZTRAP_NJ(T_BPTFLT)
 	INTRENTRY
-  	STI(si)
+	STI(si)
 	/*
 	 * DTrace Function Boundary Trace (fbt) probes are triggered
 	 * by int3 (0xcc).
@@ -378,7 +378,7 @@
  */
 NENTRY(alltraps)
 	INTRENTRY
-  	STI(si)
+	STI(si)
 
 calltrap:
 #ifdef DIAGNOSTIC
@@ -393,11 +393,11 @@
 .Lalltraps_checkast:
 	movq	CPUVAR(CURLWP),%r14
 	/* Check for ASTs on exit to user mode. */
-  	CLI(si)
+	CLI(si)
 	CHECK_ASTPENDING(%r14)
 	je	3f
 	CLEAR_ASTPENDING(%r14)
-  	STI(si)
+	STI(si)
 	movl	$T_ASTFLT,TF_TRAPNO(%rsp)
 	movq	%rsp,%rdi
 	incq	CPUVAR(NTRAP)
@@ -411,7 +411,7 @@
 6:	cmpl	CPUVAR(ILEVEL),%ebx
 	jne	3f
 	INTRFASTEXIT
-3:  	STI(si)
+3:	STI(si)
 	movabsq	$4f,%rdi
 	movl	CPUVAR(ILEVEL),%esi
 	movl	%ebx,%edx
--- a/sys/arch/amd64/amd64/autoconf.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/autoconf.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.24 2012/11/08 02:00:44 chs Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.24.14.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2012/11/08 02:00:44 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24.14.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_intrdebug.h"
@@ -86,7 +86,6 @@
 void
 cpu_configure(void)
 {
-
 	startrtclock();
 
 #if NBIOS32 > 0
--- a/sys/arch/amd64/amd64/bios32.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/bios32.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bios32.c,v 1.20 2012/02/25 00:13:28 joerg Exp $	*/
+/*	$NetBSD: bios32.c,v 1.20.16.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.20 2012/02/25 00:13:28 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.20.16.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -171,7 +171,7 @@
 		smbios_entry.min = sh->minrev;
 		smbios_entry.count = sh->count;
 
-    		for (; pa < end; pa+= NBPG, eva+= NBPG)
+		for (; pa < end; pa+= NBPG, eva+= NBPG)
 #ifdef XEN
 			pmap_kenter_ma(eva, pa, VM_PROT_READ, 0);
 #else
--- a/sys/arch/amd64/amd64/copy.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/copy.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.18 2010/07/07 01:13:29 chs Exp $	*/
+/*	$NetBSD: copy.S,v 1.18.36.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -119,7 +119,7 @@
  * Also note that the setup time for 'rep movs' is horrid - especially on P4
  * netburst - but on my AMD X2 it manages one copy (read+write) per clock
  * which can be achieved with a code loop, but is probably impossible to beat.
- * Howver the use of 'rep movsb' for the final bytes should be killed.
+ * However the use of 'rep movsb' for the final bytes should be killed.
  *
  * Newer Intel cpus have a much lower setup time, and may (someday)
  * be ably to do cache-line size copies....
@@ -131,35 +131,37 @@
 .Lkcopy_start:
 	movq	%rdi,%rax
 	subq	%rsi,%rax
-	cmpq	%rcx,%rax		# overlapping?
+	cmpq	%rcx,%rax		/* overlapping? */
 	jb	1f
-	# nope, copy forward
-	shrq	$3,%rcx			# copy by 64-bit words
+	/* nope, copy forward */
+	shrq	$3,%rcx			/* copy by 64-bit words */
 	rep
 	movsq
 
 	movq	%rdx,%rcx
-	andl	$7,%ecx			# any bytes left?
+	andl	$7,%ecx			/* any bytes left? */
 	rep
 	movsb
 
 	xorq	%rax,%rax
 	ret
 
-# Using 'rep movs' to copy backwards is not as fast as for forwards copies
-# and ought not be done when the copy doesn't acually overlap.
-# However kcopy() isn't used any that looks even vaguely used often.
-# I'm also not sure it is ever asked to do overlapping copies!
+/*
+ * Using 'rep movs' to copy backwards is not as fast as for forwards copies
+ * and ought not be done when the copy doesn't acually overlap.
+ * However kcopy() isn't used any that looks even vaguely used often.
+ * I'm also not sure it is ever asked to do overlapping copies!
+ */
 
-1:	addq	%rcx,%rdi		# copy backward
+1:	addq	%rcx,%rdi		/* copy backward */
 	addq	%rcx,%rsi
 	std
-	andq	$7,%rcx			# any fractional bytes?
+	andq	$7,%rcx			/* any fractional bytes? */
 	decq	%rdi
 	decq	%rsi
 	rep
 	movsb
-	movq	%rdx,%rcx		# copy remainder by 64-bit words
+	movq	%rdx,%rcx		/* copy remainder by 64-bit words */
 	shrq	$3,%rcx
 	subq	$7,%rsi
 	subq	$7,%rdi
@@ -173,24 +175,24 @@
 ENTRY(copyout)
 	DEFERRED_SWITCH_CHECK
 
-	xchgq	%rdi,%rsi		# kernel address to %rsi, user to %rdi
-	movq	%rdx,%rax		# save transfer length (bytes)
+	xchgq	%rdi,%rsi		/* kernel address to %rsi, user to %rdi */
+	movq	%rdx,%rax		/* save transfer length (bytes) */
 
-	addq	%rdi,%rdx		# end address to %rdx
-	jc	_C_LABEL(copy_efault)	# jump if wraps
+	addq	%rdi,%rdx		/* end address to %rdx */
+	jc	_C_LABEL(copy_efault)	/* jump if wraps */
 	movq	$VM_MAXUSER_ADDRESS,%r8
 	cmpq	%r8,%rdx
-	ja	_C_LABEL(copy_efault)	# jump if end in kernel space
+	ja	_C_LABEL(copy_efault)	/* jump if end in kernel space */
 
 .Lcopyout_start:
-	movq	%rax,%rcx		# length
-	shrq	$3,%rcx			# count of 8-byte words
+	movq	%rax,%rcx		/* length */
+	shrq	$3,%rcx			/* count of 8-byte words */
 	rep
-	movsq				# copy from %rsi to %rdi
+	movsq				/* copy from %rsi to %rdi */
 	movb	%al,%cl
-	andb	$7,%cl			# remaining number of bytes
+	andb	$7,%cl			/* remaining number of bytes */
 	rep
-	movsb				# copy remaining bytes
+	movsb				/* copy remaining bytes */
 .Lcopyout_end:
 	xorl	%eax,%eax
 	ret
@@ -202,11 +204,11 @@
 	xchgq	%rdi,%rsi
 	movq	%rdx,%rax
 
-	addq	%rsi,%rdx		# Check source address not wrapped
+	addq	%rsi,%rdx		/* check source address not wrapped */
 	jc	_C_LABEL(copy_efault)
-	movq	$VM_MAXUSER_ADDRESS,%r8	
+	movq	$VM_MAXUSER_ADDRESS,%r8
 	cmpq	%r8,%rdx
-	ja	_C_LABEL(copy_efault)	# j if end in kernel space
+	ja	_C_LABEL(copy_efault)	/* j if end in kernel space */
 
 .Lcopyin_start:
 3:	/* bcopy(%rsi, %rdi, %rax); */
@@ -359,32 +361,7 @@
 
 7:	ret
 
-ENTRY(fuword)
-	DEFERRED_SWITCH_CHECK
-	movq	$VM_MAXUSER_ADDRESS-4,%r11
-	cmpq	%r11,%rdi
-	ja	_C_LABEL(fusuaddrfault)
-	GET_CURPCB(%rcx)
-	leaq	_C_LABEL(fusufailure)(%rip),%r11
-	movq	%r11,PCB_ONFAULT(%rcx)
-	movl	(%rdi),%eax
-	movq	$0,PCB_ONFAULT(%rcx)
-	ret
-	DEFERRED_SWITCH_CALL
-	
-ENTRY(fusword)
-	DEFERRED_SWITCH_CHECK
-	movq	$VM_MAXUSER_ADDRESS-2,%r11
-	cmpq	%r11,%rdi
-	ja	_C_LABEL(fusuaddrfault)
-	GET_CURPCB(%rcx)
-	leaq	_C_LABEL(fusufailure)(%rip),%r11
-	movq	%r11,PCB_ONFAULT(%rcx)
-	movzwl	(%rdi),%eax
-	movq	$0,PCB_ONFAULT(%rcx)
-	ret
-	DEFERRED_SWITCH_CALL
-	
+
 ENTRY(fuswintr)
 	cmpl	$TLBSTATE_VALID, CPUVAR(TLBSTATE)
 	jnz	_C_LABEL(fusuaddrfault)
@@ -397,7 +374,7 @@
 	movzwl	(%rdi),%eax
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
-	
+
 ENTRY(fubyte)
 	DEFERRED_SWITCH_CHECK
 	movq	$VM_MAXUSER_ADDRESS-1,%r11
@@ -411,38 +388,6 @@
 	ret
 	DEFERRED_SWITCH_CALL
 
-ENTRY(suword)
-	DEFERRED_SWITCH_CHECK
-	movq	$VM_MAXUSER_ADDRESS-4,%r11
-	cmpq	%r11,%rdi
-	ja	_C_LABEL(fusuaddrfault)
-
-	GET_CURPCB(%rcx)
-	leaq	_C_LABEL(fusufailure)(%rip),%r11
-	movq	%r11,PCB_ONFAULT(%rcx)
-
-	movq	%rsi,(%rdi)
-	xorq	%rax,%rax
-	movq	%rax,PCB_ONFAULT(%rcx)
-	ret
-	DEFERRED_SWITCH_CALL
-	
-ENTRY(susword)
-	DEFERRED_SWITCH_CHECK
-	movq	$VM_MAXUSER_ADDRESS-2,%r11
-	cmpq	%r11,%rdi
-	ja	_C_LABEL(fusuaddrfault)
-
-	GET_CURPCB(%rcx)
-	leaq	_C_LABEL(fusufailure)(%rip),%r11
-	movq	%r11,PCB_ONFAULT(%rcx)
-
-	movw	%si,(%rdi)
-	xorq	%rax,%rax
-	movq	%rax,PCB_ONFAULT(%rcx)
-	ret
-	DEFERRED_SWITCH_CALL
-
 ENTRY(suswintr)
 	cmpl	$TLBSTATE_VALID, CPUVAR(TLBSTATE)
 	jnz	_C_LABEL(fusuaddrfault)
--- a/sys/arch/amd64/amd64/gdt.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/gdt.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdt.c,v 1.25 2013/10/16 18:07:56 christos Exp $	*/
+/*	$NetBSD: gdt.c,v 1.25.6.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.25 2013/10/16 18:07:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.25.6.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -55,7 +55,7 @@
 
 #ifdef XEN
 #include <xen/hypervisor.h>
-#endif 
+#endif
 
 int gdt_size;		/* size of GDT in bytes */
 int gdt_dyncount;	/* number of dyn. allocated GDT entries in use */
@@ -99,13 +99,13 @@
 	struct cpu_info *ci;
 	int idx;
 
-        set_sys_segment(&d.sd, base, limit, type, dpl, gran);
+	set_sys_segment(&d.sd, base, limit, type, dpl, gran);
 	idx = IDXSEL(GDYNSEL(slot, SEL_KPL));
-        for (CPU_INFO_FOREACH(cii, ci)) {
-                KASSERT(ci->ci_gdt != NULL);
+	for (CPU_INFO_FOREACH(cii, ci)) {
+		KASSERT(ci->ci_gdt != NULL);
 		update_descriptor(&ci->ci_gdt[idx + 0], &d.bits[0]);
 		update_descriptor(&ci->ci_gdt[idx + 1], &d.bits[1]);
-        }
+	}
 }
 
 /*
--- a/sys/arch/amd64/amd64/genassym.cf	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/genassym.cf	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.56.6.1 2015/09/22 12:05:35 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.56.6.2 2015/12/27 12:09:28 skrll Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -145,6 +145,8 @@
 
 define	PDIR_SLOT_PTE		PDIR_SLOT_PTE
 
+define	PDE_SIZE		sizeof(pd_entry_t)
+
 define	VM_MAXUSER_ADDRESS	(unsigned long long)VM_MAXUSER_ADDRESS
 
 define	L_PCB			offsetof(struct lwp, l_addr)
--- a/sys/arch/amd64/amd64/kgdb_machdep.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/kgdb_machdep.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.8.32.1 2015/09/22 12:05:35 skrll Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.8.32.2 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.8.32.1 2015/09/22 12:05:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.8.32.2 2015/12/27 12:09:28 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -110,7 +110,7 @@
  * Translate a trap number into a unix compatible signal value.
  * (gdb only understands unix signal numbers).
  */
-int 
+int
 kgdb_signal(int type)
 {
 	switch (type) {
@@ -208,7 +208,7 @@
 	regs->tf_rflags = gdb_regs[17];
 	regs->tf_cs  = gdb_regs[18];
 	regs->tf_ss  = gdb_regs[19];
-}	
+}
 
 /*
  * Trap into kgdb to wait for debugger to connect,
--- a/sys/arch/amd64/amd64/linux32_sigcode.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/linux32_sigcode.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,28 +1,28 @@
-/*	$NetBSD: linux32_sigcode.S,v 1.2 2011/08/01 22:21:01 joerg Exp $ */
+/*	$NetBSD: linux32_sigcode.S,v 1.2.30.1 2015/12/27 12:09:28 skrll Exp $ */
 
 #include "assym.h"
 #include <machine/asm.h>
 
 	.code32
 NENTRY(linux32_sigcode)
-	 call    *LINUX32_SF_HANDLER(%esp)
-	 leal    LINUX32_SF_SC(%esp),%ebx # scp
-	 pushl   %eax
-	 movl    $LINUX32_SYS_sigreturn,%eax
-	 int     $0x80
-	 movl    $LINUX32_SYS_exit,%eax
-	 int     $0x80
-  
-	.balign 16
+	call	*LINUX32_SF_HANDLER(%esp)
+	leal	LINUX32_SF_SC(%esp),%ebx	# scp
+	pushl	%eax
+	movl	$LINUX32_SYS_sigreturn,%eax
+	int	$0x80
+	movl	$LINUX32_SYS_exit,%eax
+	int	$0x80
+
+	.balign	16
 NENTRY(linux32_rt_sigcode)
-	 call    *LINUX32_RT_SF_HANDLER(%esp)
-	 leal    LINUX32_RT_SF_UC(%esp),%ebx # scp
-	 pushl   %eax
-	 movl    $LINUX32_SYS_rt_sigreturn,%eax
-	 int     $0x80
-	 movl    $LINUX32_SYS_exit,%eax
-	 int     $0x80
-	.balign 16
-	 .globl  _C_LABEL(linux32_esigcode)
-_C_LABEL(linux32_esigcode): 
+	call	*LINUX32_RT_SF_HANDLER(%esp)
+	leal	LINUX32_RT_SF_UC(%esp),%ebx	# scp
+	pushl	%eax
+	movl	$LINUX32_SYS_rt_sigreturn,%eax
+	int	$0x80
+	movl	$LINUX32_SYS_exit,%eax
+	int	$0x80
+	.balign	16
+	.globl	_C_LABEL(linux32_esigcode)
+_C_LABEL(linux32_esigcode):
 
--- a/sys/arch/amd64/amd64/locore.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/locore.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.77.2.1 2015/09/22 12:05:35 skrll Exp $	*/
+/*	$NetBSD: locore.S,v 1.77.2.2 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -191,6 +191,43 @@
 #define	_RELOC(x)	((x) - KERNBASE)
 #define	RELOC(x)	_RELOC(_C_LABEL(x))
 
+#if L2_SLOT_KERNBASE > 0
+#define TABLE_L2_ENTRIES (2 * (NKL2_KIMG_ENTRIES + 1))
+#else
+#define TABLE_L2_ENTRIES (NKL2_KIMG_ENTRIES + 1)
+#endif
+
+#if L3_SLOT_KERNBASE > 0
+#define TABLE_L3_ENTRIES (2 * NKL3_KIMG_ENTRIES)
+#else
+#define TABLE_L3_ENTRIES NKL3_KIMG_ENTRIES
+#endif
+
+#define PROC0_PML4_OFF	0
+#define PROC0_STK_OFF	(PROC0_PML4_OFF + PAGE_SIZE)
+#define PROC0_PTP3_OFF	(PROC0_STK_OFF + UPAGES * PAGE_SIZE)
+#define PROC0_PTP2_OFF	(PROC0_PTP3_OFF + NKL4_KIMG_ENTRIES * PAGE_SIZE)
+#define PROC0_PTP1_OFF	(PROC0_PTP2_OFF + TABLE_L3_ENTRIES * PAGE_SIZE)
+#define TABLESIZE \
+  ((NKL4_KIMG_ENTRIES + TABLE_L3_ENTRIES + TABLE_L2_ENTRIES + 1 + UPAGES) \
+    * PAGE_SIZE)
+
+/*
+ * fillkpt - Fill in a kernel page table
+ *	eax = pte (page frame | control | status)
+ *	ebx = page table address
+ *	ecx = number of pages to map
+ *
+ * Each entry is 8 (PDE_SIZE) bytes long: we must set the 4 upper bytes to 0.
+ */
+#define fillkpt	\
+1:	movl	%eax,(%ebx)		; 	/* store phys addr */	\
+	movl	$0,(PDE_SIZE-4)(%ebx)	; 	/* upper 32 bits 0 */	\
+	addl	$PDE_SIZE,%ebx		; 	/* next PTE/PDE */	\
+	addl	$PAGE_SIZE,%eax		; 	/* next phys page */	\
+	loop	1b			;
+
+
 #ifdef XEN
 
 /*
@@ -247,9 +284,6 @@
 END(lapic_isr)
 #endif
 
-	.globl	_C_LABEL(cpu_id)
-	.globl	_C_LABEL(cpu_vendorname)
-	.globl	_C_LABEL(cpu_brand_id)
 	.globl	_C_LABEL(cpuid_level)
 	.globl	_C_LABEL(esym)
 	.globl	_C_LABEL(eblob)
@@ -265,20 +299,10 @@
 	.type	_C_LABEL(cputype), @object
 LABEL(cputype)		.long	0	# are we 80486, Pentium, or..
 END(cputype)
-	.type	_C_LABEL(cpu_id), @object
-LABEL(cpu_id)		.long	0	# saved from `cpuid' instruction
-END(cpu_id)
 	.type	_C_LABEL(cpuid_level), @object
 LABEL(cpuid_level)	.long	-1	# max. level accepted by 'cpuid'
 					#   instruction
 END(cpuid_level)
-	.type	_C_LABEL(cpu_vendorname), @object
-LABEL(cpu_vendorname)	.space	16	# vendor string returned by `cpuid'
-					#   instruction
-END(cpu_vendorname)
-	.type	_C_LABEL(cpu_brand_id), @object
-LABEL(cpu_brand_id)	.long	0	# brand ID from 'cpuid' instruction
-END(cpu_brand_id)
 	.type	_C_LABEL(esym), @object
 LABEL(esym)		.quad	0	# ptr to end of syms
 END(esym)
@@ -355,10 +379,9 @@
 
 /*
  * Some hackage to deal with 64bit symbols in 32 bit mode.
- * This may not be needed it things are cleaned up a little.
+ * This may not be needed if things are cleaned up a little.
  */
 
-
 	.text
 	.globl	_C_LABEL(kernel_text)
 	.set	_C_LABEL(kernel_text),KERNTEXTOFF
@@ -366,108 +389,126 @@
 ENTRY(start)
 #ifndef XEN
 	.code32
-	movw	$0x1234,0x472			# warm boot
+
+	/* Warm boot */
+	movw	$0x1234,0x472
+
 	/*
-	 * Load parameters from stack
-	 * (howto, [bootdev], bootinfo, esym, basemem, extmem).
+	 * Load parameters from the stack (32 bits):   
+	 *     boothowto, [bootdev], bootinfo, esym, biosbasemem, biosextmem
+	 * We are not interested in 'bootdev'.
 	 */
+
+	/* Load 'boothowto' */
 	movl	4(%esp),%eax
 	movl	%eax,RELOC(boothowto)
+
+	/* Load 'bootinfo' */
 	movl	12(%esp),%eax
-	testl	%eax, %eax
-	jz	1f
-	movl	(%eax), %ebx		/* number of entries */
+	testl	%eax,%eax		/* bootinfo = NULL? */
+	jz	bootinfo_finished
+
+	movl	(%eax),%ebx		/* number of entries */
 	movl	$RELOC(bootinfo),%ebp
-	movl	%ebp, %edx
+	movl	%ebp,%edx
 	addl	$BOOTINFO_MAXSIZE,%ebp
-	movl	%ebx, (%edx)
-	addl	$4, %edx
-2:
-	testl	%ebx, %ebx
-	jz	1f
-	addl	$4, %eax
-	movl	(%eax), %ecx		/* address of entry */
+	movl	%ebx,(%edx)
+	addl	$4,%edx
+
+bootinfo_entryloop:
+	testl	%ebx,%ebx		/* no remaining entries? */
+	jz	bootinfo_finished
+
+	addl	$4,%eax
+	movl	(%eax),%ecx		/* address of entry */
 	pushl	%edi
 	pushl	%esi
 	pushl	%eax
 
-	movl	(%ecx),%eax	/* len */
+	movl	(%ecx),%eax		/* size of entry */
 	movl	%edx,%edi
-	addl	(%ecx), %edx		/* update dest pointer */
-	cmpl	%ebp, %edx
-	jg	2f
+	addl	(%ecx),%edx		/* update dest pointer */
+	cmpl	%ebp,%edx		/* beyond bootinfo+BOOTINFO_MAXSIZE? */
+	jg	bootinfo_overflow
+
 	movl	%ecx,%esi
 	movl	%eax,%ecx
+
 	/*
-	 * If any modules were loaded, record where they
-	 * end.  We'll need to skip over them.
+	 * If any modules were loaded, record where they end.  We'll need to
+	 * skip over them.
 	 */
-	cmpl	$BTINFO_MODULELIST, 4(%esi)
+	cmpl	$BTINFO_MODULELIST,4(%esi)
 	jne	0f
+
 	pushl	12(%esi)		/* endpa */
 	popl	RELOC(eblob)
-	addl	$KERNBASE_LO, RELOC(eblob)
-	adcl	$KERNBASE_HI, RELOC(eblob)+4
+	addl	$KERNBASE_LO,RELOC(eblob)
+	adcl	$KERNBASE_HI,RELOC(eblob)+4
+
 0:
 	rep
-	movsb
+	movsb				/* copy esi -> edi */
 	popl	%eax
 	popl	%esi
 	popl	%edi
-	subl	$1, %ebx
-	jmp	2b
-2:	/* cleanup for overflow case */
+	subl	$1,%ebx			/* decrement the # of entries */
+	jmp	bootinfo_entryloop
+
+bootinfo_overflow:
+	/*
+	 * Cleanup for overflow case. Pop the registers, and correct the number
+	 * of entries.
+	 */
 	popl	%eax
 	popl	%esi
 	popl	%edi
 	movl	$RELOC(bootinfo),%ebp
-	movl	%ebp, %edx
-	subl	%ebx, (%edx)		/* correct number of entries */
-1:
+	movl	%ebp,%edx
+	subl	%ebx,(%edx)		/* correct the number of entries */
 
+bootinfo_finished:
+	/* Load 'esym' */
 	movl	16(%esp),%eax
-	testl	%eax,%eax
+	testl	%eax,%eax		/* esym = NULL? */
 	jz	1f
+
 	addl	$KERNBASE_LO,%eax
-1: 	movl	$RELOC(esym),%ebp
+
+1:
+	movl	$RELOC(esym),%ebp
 	movl	%eax,(%ebp)
 	movl	$KERNBASE_HI,4(%ebp)
 
+	/* Load 'biosextmem' */
 	movl	$RELOC(biosextmem),%ebp
 	movl	(%ebp),%eax
-	testl	%eax,%eax
-	jnz	1f
+	testl	%eax,%eax		/* already set? */
+	jnz	biosextmem_finished
+
 	movl	20(%esp),%eax
 	movl	%eax,(%ebp)
-1:
+
+biosextmem_finished:
+	/* Load 'biosbasemem' */
 	movl	$RELOC(biosbasemem),%ebp
 	movl	(%ebp),%eax
-	testl	%eax,%eax
-	jnz	1f
+	testl	%eax,%eax		/* already set? */
+	jnz	biosbasemem_finished
+
 	movl	24(%esp),%eax
 	movl	%eax,(%ebp)
-1:
 
-	/* First, reset the PSL. */
+biosbasemem_finished:
+	/*
+	 * Done with the parameters. First, reset the PSL.
+	 */
 	pushl	$PSL_MBO
 	popfl
 
 	xorl	%eax,%eax
 	cpuid
 	movl	%eax,RELOC(cpuid_level)
-	movl	$RELOC(cpu_vendorname),%ebp
-	movl	%ebx,(%ebp)
-	movl	%edx,4(%ebp)
-	movl	%ecx,8(%ebp)
-	movl	$0, 12(%ebp)
-
-	movl	$1,%eax
-	cpuid
-	movl	%eax,RELOC(cpu_id)
-
-	/* Brand ID is bits 0-7 of %ebx */
-	andl	$255,%ebx
-	movl	%ebx,RELOC(cpu_brand_id)
 
 	/*
 	 * Finished with old stack; load new %esp now instead of later so we
@@ -487,40 +528,12 @@
  * Virtual address space of kernel:
  *
  * text | data | bss | [syms] | page dir | proc0 kstack | L1 ptp | L2 ptp | L3
- *			      0          1       2      3
+ *                            0          1       2      3
  */
 
-#if L2_SLOT_KERNBASE > 0
-#define TABLE_L2_ENTRIES (2 * (NKL2_KIMG_ENTRIES + 1))
-#else
-#define TABLE_L2_ENTRIES (NKL2_KIMG_ENTRIES + 1)
-#endif
-
-#if L3_SLOT_KERNBASE > 0
-#define TABLE_L3_ENTRIES (2 * NKL3_KIMG_ENTRIES)
-#else
-#define TABLE_L3_ENTRIES NKL3_KIMG_ENTRIES
-#endif
-
-
-#define PROC0_PML4_OFF	0
-#define PROC0_STK_OFF	(PROC0_PML4_OFF + PAGE_SIZE)
-#define PROC0_PTP3_OFF	(PROC0_STK_OFF + UPAGES * PAGE_SIZE)
-#define PROC0_PTP2_OFF	(PROC0_PTP3_OFF + NKL4_KIMG_ENTRIES * PAGE_SIZE)
-#define PROC0_PTP1_OFF	(PROC0_PTP2_OFF + TABLE_L3_ENTRIES * PAGE_SIZE)
-#define TABLESIZE \
-  ((NKL4_KIMG_ENTRIES + TABLE_L3_ENTRIES + TABLE_L2_ENTRIES + 1 + UPAGES) \
-    * PAGE_SIZE)
-
-#define fillkpt	\
-1:	movl	%eax,(%ebx)		; 	/* store phys addr */	\
-	movl	$0,4(%ebx)		; 	/* upper 32 bits 0 */	\
-	addl	$8,%ebx			; 	/* next pte/pde */	\
-	addl	$PAGE_SIZE,%eax		; 	/* next phys page */	\
-	loop	1b			;
-
 	/* Find end of kernel image. */
 	movl	$RELOC(end),%edi
+
 #if (NKSYMS || defined(DDB) || defined(MODULAR)) && !defined(makeoptions_COPY_SYMTAB)
 	/* Save the symbols (if loaded). */
 	movl	RELOC(esym),%eax
@@ -537,40 +550,40 @@
 	subl	$KERNBASE_LO,%eax	/* XXX */
 	movl	%eax,%edi
 1:
+
 	/* Compute sizes */
 	movl	%edi,%esi
-	addl	$PGOFSET,%esi			# page align up
+	addl	$PGOFSET,%esi		/* page align up */
 	andl	$~PGOFSET,%esi
+	movl	%esi,%edi
 
-	movl	%esi,%edi
+	/* Clear the tables */
 	xorl	%eax,%eax
 	cld
 	movl	$TABLESIZE,%ecx
 	shrl	$2,%ecx
 	rep
-	stosl
-
-	leal	(PROC0_PTP1_OFF)(%esi), %ebx
+	stosl				/* copy eax -> edi */
 
 /*
  * Build initial page tables.
  */
+	leal	(PROC0_PTP1_OFF)(%esi),%ebx
+
+	/* Skip the first MB */
+	movl	$(KERNTEXTOFF_LO - KERNBASE_LO),%eax
+	movl	%eax,%ecx
+	shrl	$(PGSHIFT-3),%ecx	/* ((n >> PGSHIFT) << 3) for # PDEs */
+	addl	%ecx,%ebx
+
 	/*
-	 * Compute &__data_start - KERNBASE. This can't be > 4G,
-	 * or we can't deal with it anyway, since we can't load it in
-	 * 32 bit mode. So use the bottom 32 bits.
+	 * Compute &__data_start - KERNBASE. This can't be > 4G, or we can't
+	 * deal with it anyway, since we can't load it in 32 bit mode. So use
+	 * the bottom 32 bits.
 	 */
 	movl	$RELOC(__data_start),%edx
 	andl	$~PGOFSET,%edx
 
-	/*
-	 * Skip the first MB.
-	 */
-	movl	$(KERNTEXTOFF_LO - KERNBASE_LO),%eax
-	movl	%eax,%ecx
-	shrl	$(PGSHIFT-3),%ecx	/* ((n >> PGSHIFT) << 3) for # pdes */
-	addl	%ecx,%ebx
-
 	/* Map the kernel text read-only. */
 	movl	%edx,%ecx
 	subl	%eax,%ecx
@@ -581,14 +594,14 @@
 	/* Map the data, BSS, and bootstrap tables read-write. */
 	leal	(PG_V|PG_KW)(%edx),%eax
 	movl	$TABLESIZE,%ecx
-	addl	%esi,%ecx				# end of tables
-	subl	%edx,%ecx				# subtract end of text
+	addl	%esi,%ecx		/* end of tables */
+	subl	%edx,%ecx		/* subtract end of text */
 	shrl	$PGSHIFT,%ecx
 	fillkpt
 
 	/* Map ISA I/O mem (later atdevbase) */
-	movl	$(IOM_BEGIN|PG_V|PG_KW/*|PG_N*/),%eax	# having these bits set
-	movl	$(IOM_SIZE>>PGSHIFT),%ecx		# for this many pte s,
+	movl	$(IOM_BEGIN|PG_V|PG_KW/*|PG_N*/),%eax
+	movl	$(IOM_SIZE>>PGSHIFT),%ecx
 	fillkpt
 
 /*
@@ -597,15 +610,15 @@
 	/* Set up level 2 pages */
 	leal	(PROC0_PTP2_OFF)(%esi),%ebx
 	leal	(PROC0_PTP1_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW), %eax
+	orl	$(PG_V|PG_KW),%eax
 	movl	$(NKL2_KIMG_ENTRIES+1),%ecx
 	fillkpt
 
 #if L2_SLOT_KERNBASE > 0
 	/* If needed, set up level 2 entries for actual kernel mapping */
-	leal	(PROC0_PTP2_OFF+ L2_SLOT_KERNBASE*8)(%esi),%ebx
+	leal	(PROC0_PTP2_OFF + L2_SLOT_KERNBASE*8)(%esi),%ebx
 	leal	(PROC0_PTP1_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW), %eax
+	orl	$(PG_V|PG_KW),%eax
 	movl	$(NKL2_KIMG_ENTRIES+1),%ecx
 	fillkpt
 #endif
@@ -613,15 +626,15 @@
 	/* Set up level 3 pages */
 	leal	(PROC0_PTP3_OFF)(%esi),%ebx
 	leal	(PROC0_PTP2_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW), %eax
+	orl	$(PG_V|PG_KW),%eax
 	movl	$NKL3_KIMG_ENTRIES,%ecx
 	fillkpt
 
 #if L3_SLOT_KERNBASE > 0
 	/* If needed, set up level 3 entries for actual kernel mapping */
-	leal	(PROC0_PTP3_OFF+ L3_SLOT_KERNBASE*8)(%esi),%ebx
+	leal	(PROC0_PTP3_OFF + L3_SLOT_KERNBASE*8)(%esi),%ebx
 	leal	(PROC0_PTP2_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW), %eax
+	orl	$(PG_V|PG_KW),%eax
 	movl	$NKL3_KIMG_ENTRIES,%ecx
 	fillkpt
 #endif
@@ -629,14 +642,14 @@
 	/* Set up top level entries for identity mapping */
 	leal	(PROC0_PML4_OFF)(%esi),%ebx
 	leal	(PROC0_PTP3_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW), %eax
+	orl	$(PG_V|PG_KW),%eax
 	movl	$NKL4_KIMG_ENTRIES,%ecx
 	fillkpt
 
 	/* Set up top level entries for actual kernel mapping */
 	leal	(PROC0_PML4_OFF + L4_SLOT_KERNBASE*8)(%esi),%ebx
 	leal	(PROC0_PTP3_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW), %eax
+	orl	$(PG_V|PG_KW),%eax
 	movl	$NKL4_KIMG_ENTRIES,%ecx
 	fillkpt
 
@@ -645,8 +658,7 @@
 	leal	(PROC0_PML4_OFF)(%esi),%eax
 	orl	$(PG_V|PG_KW),%eax
 	movl	%eax,(%ebx)
-	movl	$0, 4(%ebx)
-
+	movl	$0,4(%ebx)
 
 	/* Save phys. addr of PTD, for libkvm. */
 	movl	$RELOC(PDPpaddr),%ebp
@@ -687,26 +699,21 @@
 compat:
 
 	/*
-	 * 5.
-	 * Not quite done yet, we're now in a compatibility segment,
-	 * in legacy mode. We must jump to a long mode segment.
-	 * Need to set up a temporary GDT with a long mode segment
-	 * in it to do that.
+	 * 5. Not quite done yet, we're now in a compatibility segment, in
+	 *    legacy mode. We must jump to a long mode segment. Need to set up
+	 *    a temporary GDT with a long mode segment in it to do that.
 	 */
-
 	movl	$RELOC(gdt64_lo),%eax
 	lgdt	(%eax)
 	movl	$RELOC(farjmp64),%eax
 	ljmp	*(%eax)
 
-.code64
+	.code64
 longmode:
 	/*
-	 * 6.
-	 * Finally, we're in long mode. However, we're still
-	 * in the identity mapped area (could not jump out
-	 * of that earlier because it would have been a > 32bit
-	 * jump). We can do that now, so here we go.
+	 * 6. Finally, we're in long mode. However, we're still in the identity
+	 *    mapped area (could not jump out of that earlier because it would
+	 *    have been a > 32bit jump). We can do that now, so here we go.
 	 */
 	movabsq	$longmode_hi,%rax
 	jmp	*%rax
@@ -721,16 +728,15 @@
 	lgdt	(%rax)
 
 	/*
-	 * We have arrived.
-	 * There's no need anymore for the identity mapping in low
-	 * memory, remove it.
+	 * We have arrived. There's no need anymore for the identity mapping in
+	 * low memory, remove it.
 	 */
 	movq	$KERNBASE,%r8
 
 #if L2_SLOT_KERNBASE > 0
 	movq	$(NKL2_KIMG_ENTRIES+1),%rcx
 	leaq	(PROC0_PTP2_OFF)(%rsi),%rbx
-	addq	%r8, %rbx
+	addq	%r8,%rbx
 1:	movq	$0,(%rbx)
 	addq	$8,%rbx
 	loop	1b
@@ -739,15 +745,15 @@
 #if L3_SLOT_KERNBASE > 0
 	movq	$NKL3_KIMG_ENTRIES,%rcx
 	leaq	(PROC0_PTP3_OFF)(%rsi),%rbx
-	addq	%r8, %rbx
+	addq	%r8,%rbx
 1:	movq	$0,(%rbx)
 	addq	$8,%rbx
 	loop	1b
 #endif
 
 	movq	$NKL4_KIMG_ENTRIES,%rcx
-	leaq	(PROC0_PML4_OFF)(%rsi),%rbx	# old, phys  address of PML4
-	addq	%r8, %rbx			# new, virtual address of PML4
+	leaq	(PROC0_PML4_OFF)(%rsi),%rbx	# old, phys address of PML4
+	addq	%r8,%rbx			# new, virtual address of PML4
 1:	movq	$0,(%rbx)
 	addq	$8,%rbx
 	loop	1b
@@ -782,7 +788,7 @@
 	/*
 	 * Xen info:
 	 * - %rsi -> start_info struct
-	 * - %rsp -> stack, *theorically* the last used page
+	 * - %rsp -> stack, *theoretically* the last used page
 	 *	by Xen bootstrap
 	 */
 	movq	%rsi, %rbx
@@ -811,7 +817,7 @@
 	 * - console
 	 * - Xen bootstrap page tables
 	 * - kernel stack. provided by Xen
-	 * - guaranted 512kB padding
+	 * - guaranteed 512kB padding
 	 *
 	 * As we want to rebuild our page tables and place our stack
 	 * in proc0 struct, all data starting from after console can be
--- a/sys/arch/amd64/amd64/machdep.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/machdep.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.211.4.2 2015/09/22 12:05:35 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.211.4.3 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.211.4.2 2015/09/22 12:05:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.211.4.3 2015/12/27 12:09:28 skrll Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1552,7 +1552,6 @@
 
 	cpu_init_msrs(&cpu_info_primary, true);
 
-
 	use_pae = 1; /* PAE always enabled in long mode */
 
 #ifdef XEN
@@ -1590,7 +1589,6 @@
 	avail_start = 8 * PAGE_SIZE;
 
 #if !defined(REALBASEMEM) && !defined(REALEXTMEM)
-
 	/*
 	 * Check to see if we have a memory map from the BIOS (passed
 	 * to us by the boot program.
@@ -1598,7 +1596,6 @@
 	bim = lookup_bootinfo(BTINFO_MEMMAP);
 	if (bim != NULL && bim->num > 0)
 		initx86_parse_memmap(bim, iomem_ex);
-
 #endif	/* ! REALBASEMEM && ! REALEXTMEM */
 
 	/*
@@ -1632,7 +1629,6 @@
 
 #ifndef XEN
 	initx86_load_memmap(first_avail);
-
 #else	/* XEN */
 	kern_end = KERNBASE + first_avail;
 	physmem = xen_start_info.nr_pages;
@@ -1707,7 +1703,6 @@
 	/*
 	 * 32 bit GDT entries.
 	 */
-
 	set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE32_SEL), 0,
 	    x86_btop(VM_MAXUSER_ADDRESS32) - 1, SDT_MEMERA, SEL_UPL, 1, 1, 0);
 
--- a/sys/arch/amd64/amd64/mptramp.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/mptramp.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mptramp.S,v 1.17 2014/01/15 22:24:41 joerg Exp $	*/
+/*	$NetBSD: mptramp.S,v 1.17.6.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -69,10 +69,10 @@
  *
  * We startup the processors now when the kthreads become ready.
  * The steps are:
- *        1)   Get the processors running kernel-code from a special
- *                  page-table and stack page, do chip identification.
- *        2)   halt the processors waiting for them to be enabled
- *              by a idle-thread 
+ *     1) Get the processors running kernel-code from a special
+ *        page-table and stack page, do chip identification.
+ *     2) halt the processors waiting for them to be enabled
+ *        by a idle-thread 
  */
 	
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -120,40 +120,40 @@
 /* XXX ENTRY() */
 LABEL(cpu_spinup_trampoline)
 	cli
-	xorw    %ax,%ax
-	movw    %ax, %ds
-	movw    %ax, %es
-	movw    %ax, %ss
+	xorw	%ax,%ax
+	movw	%ax,%ds
+	movw	%ax,%es
+	movw	%ax,%ss
 #ifdef __clang__
-	lgdt (mptramp_gdt32_desc)   # load flat descriptor table
+	lgdt (mptramp_gdt32_desc)	/* load flat descriptor table */
 #else
-	data32 addr32 lgdt (mptramp_gdt32_desc)   # load flat descriptor table
+	data32 addr32 lgdt (mptramp_gdt32_desc)   /* load flat descriptor table */
 #endif
-	movl    %cr0, %eax       # get cr0
-	orl     $0x1, %eax      # enable protected mode
-	movl    %eax, %cr0      # doit
-	ljmpl    $0x8, $mp_startup
+	movl	%cr0, %eax	/* get cr0 */
+	orl	$0x1, %eax	/* enable protected mode */
+	movl	%eax, %cr0	/* doit */
+	ljmpl	$0x8, $mp_startup
 
 _TRMP_LABEL(mp_startup)
 	.code32
 
-	movl    $0x10, %eax     # data segment
-	movw    %ax, %ds
-	movw    %ax, %ss
-	movw    %ax, %es
-	movw    %ax, %fs
-	movw    %ax, %gs
-	
-	movl    $ (MP_TRAMPOLINE+NBPG-16),%esp       # bootstrap stack end,
-						     # with scratch space..
-	
+	movl	$0x10, %eax	/* data segment */
+	movw	%ax, %ds
+	movw	%ax, %ss
+	movw	%ax, %es
+	movw	%ax, %fs
+	movw	%ax, %gs
+
+	/* bootstrap stack end, with scratch space.. */
+	movl	$(MP_TRAMPOLINE+NBPG-16),%esp
+
 #ifdef MPDEBUG
-	leal    RELOC(cpu_trace),%edi       
+	leal	RELOC(cpu_trace),%edi
 #endif
 
 	HALT(0x1)
 	/* First, reset the PSL. */
-	pushl   $PSL_MBO
+	pushl	$PSL_MBO
 	popfl
 
 	movl	%cr4,%eax
@@ -171,19 +171,19 @@
 	orl	$(EFER_LME|EFER_SCE),%eax
 	wrmsr
 
-	movl	RELOC(mp_pdirpa),%ecx	# guaranteed < 4G
-        movl    %ecx,%cr3               # load ptd addr into mmu
+	movl	RELOC(mp_pdirpa),%ecx	/* guaranteed < 4G */
+	movl	%ecx,%cr3		/* load ptd addr into mmu */
 
-        movl    %cr0,%eax               # get control word
-        orl     $(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_MP|CR0_WP|CR0_AM),%eax
-        movl    %eax,%cr0
+	movl	%cr0,%eax		/* get control word */
+	orl	$(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_MP|CR0_WP|CR0_AM),%eax
+	movl	%eax,%cr0
 	jmp	mptramp_compat
 mptramp_compat:
 
-	movl    $GSEL(GDATA_SEL, SEL_KPL),%eax 	#switch to new segment
-	movl    %eax,%ds
-	movl    %eax,%es
-	movl    %eax,%ss
+	movl	$GSEL(GDATA_SEL, SEL_KPL),%eax	/* switch to new segment */
+	movl	%eax,%ds
+	movl	%eax,%es
+	movl	%eax,%ss
 
 	movl	$mptramp_gdt64_desc,%eax
 	lgdt	(%eax)
@@ -216,8 +216,8 @@
 	movabsq	$_C_LABEL(cpu_spinup_trampoline_end),%rax
 	jmp	*%rax
 
-	
-_C_LABEL(cpu_spinup_trampoline_end):	#end of code copied to MP_TRAMPOLINE
+
+_C_LABEL(cpu_spinup_trampoline_end):	/* end of code copied to MP_TRAMPOLINE */
 	/*
 	 * If EFER_NXE is not enabled, fetching a page with a NX bit set
 	 * will raise a #GP. Avoid that by setting the NXE feature now.
@@ -239,7 +239,7 @@
 
 	movq	CPU_INFO_IDLELWP(%rdi),%rsi
 	movq	L_PCB(%rsi),%rsi
-	
+
 	movq	PCB_RSP(%rsi),%rsp
 	movq	PCB_RBP(%rsi),%rbp
 
@@ -247,23 +247,23 @@
 	movw	$(MAXGDTSIZ-1),-10(%rsp)
 	movq	%rax,-8(%rsp)
 	lgdt	-10(%rsp)
-	
+
 	/* Switch address space. */
 	movq	PCB_CR3(%rsi),%rax
 	movq	%rax,%cr3
-	movl    PCB_CR0(%rsi),%eax
-	movq    %rax,%cr0
+	movl	PCB_CR0(%rsi),%eax
+	movq	%rax,%cr0
 	call	_C_LABEL(cpu_hatch)
 END(cpu_spinup_trampoline)
-	
+
 	.data
 LABEL(mp_pdirpa)
 	.quad	0
 END(mp_pdirpa)
 #ifdef MPDEBUG
 LABEL(cpu_trace)
-	.quad  0x40
-	.quad  0xff
-	.quad  0xff		
+	.quad	0x40
+	.quad	0xff
+	.quad	0xff
 END(cpu_trace)
 #endif
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.92.6.1 2015/04/06 15:17:51 skrll Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.92.6.2 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.92.6.1 2015/04/06 15:17:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.92.6.2 2015/12/27 12:09:28 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -931,12 +931,13 @@
 }
 
 vaddr_t
-netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz)
+netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz,
+    int topdown)
 {
-        if (p->p_vmspace->vm_map.flags & VM_MAP_TOPDOWN)
-                return VM_DEFAULT_ADDRESS32_TOPDOWN(base, sz);
-        else
-                return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, sz);
+	if (topdown)
+		return VM_DEFAULT_ADDRESS32_TOPDOWN(base, sz);
+	else
+		return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, sz);
 }
 
 #ifdef COMPAT_13
--- a/sys/arch/amd64/amd64/spl.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/spl.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.29 2014/11/27 04:48:39 uebayasi Exp $	*/
+/*	$NetBSD: spl.S,v 1.29.2.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -166,7 +166,7 @@
 IDTVEC(preemptresume)
 	movl	$IPL_PREEMPT, CPUVAR(ILEVEL)
 	sti
-	testq   $SEL_RPL, TF_CS(%rsp)
+	testq	$SEL_RPL, TF_CS(%rsp)
 	jnz	1f
 	movq	TF_RIP(%rsp), %rdi
 	call	_C_LABEL(kpreempt)		# from kernel
@@ -320,14 +320,14 @@
 	CLI(si)
 	andl	CPUVAR(IPENDING),%eax
 	jz	2f
-	bsrl    %eax,%eax               # slow, but not worth optimizing
-	btrl    %eax,CPUVAR(IPENDING)
+	bsrl	%eax,%eax		# slow, but not worth optimizing
+	btrl	%eax,CPUVAR(IPENDING)
 	movq	CPUVAR(ISOURCES)(,%rax, 8),%rax
 	jmp	*IS_RESUME(%rax)
 2:	/* Check for ASTs on exit to user mode. */
 	movl	%ebx,CPUVAR(ILEVEL)
 5:
-	testb   $SEL_RPL,TF_CS(%rsp)
+	testb	$SEL_RPL,TF_CS(%rsp)
 	jz	6f
 
 	.type	_C_LABEL(doreti_checkast), @function
--- a/sys/arch/amd64/amd64/trap.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/trap.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.79.2.1 2015/04/06 15:17:51 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.79.2.2 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.79.2.1 2015/04/06 15:17:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.79.2.2 2015/12/27 12:09:28 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -342,6 +342,16 @@
 		/* Get %rsp value before fault - there may be a pad word
 		 * below the trap frame. */
 		vframe = (void *)frame->tf_rsp;
+		if (frame->tf_rip == 0) {
+			/*
+			 * Assume that if we jumped to null we
+			 * probably did it via a null function
+			 * pointer, so print the return address.
+			 */
+			printf("kernel jumped to null; return addr was %p\n",
+			       *(void **)frame->tf_rsp);
+			goto we_re_toast;
+		}
 		switch (*(uint16_t *)frame->tf_rip) {
 		case 0xcf48:	/* iretq */
 			/*
@@ -505,6 +515,14 @@
 		}
 
 		cr2 = rcr2();
+
+		if (frame->tf_err & PGEX_X) {
+			/* SMEP might have brought us here */
+			if (cr2 > VM_MIN_ADDRESS && cr2 <= VM_MAXUSER_ADDRESS)
+				panic("prevented execution of %p (SMEP)",
+				    (void *)cr2);
+		}
+
 		goto faultcommon;
 
 	case T_PAGEFLT|T_USER: {	/* page fault */
@@ -745,7 +763,7 @@
 	printf("cs %lx  ds %lx  es %lx  fs %lx  gs %lx  ss %lx\n",
 		tf->tf_cs & 0xffff, tf->tf_ds & 0xffff, tf->tf_es & 0xffff,
 		tf->tf_fs & 0xffff, tf->tf_gs & 0xffff, tf->tf_ss & 0xffff);
-	
+
 	printf("\n");
 	printf("Stack dump:\n");
 	for (i = 0, p = (unsigned long *) tf; i < 20; i ++, p += 4)
--- a/sys/arch/amd64/amd64/vector.S	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/amd64/vector.S	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.44 2013/06/25 00:27:22 uebayasi Exp $	*/
+/*	$NetBSD: vector.S,v 1.44.10.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -139,7 +139,7 @@
 1:
 	incl	CPUVAR(IDEPTH)
 	movl	$IPL_HIGH,CPUVAR(ILEVEL)
-        sti
+	sti
 	pushq	%rbx
 	call	_C_LABEL(x86_ipi_handler)
 	jmp	_C_LABEL(Xdoreti)
@@ -646,49 +646,49 @@
 XENINTRSTUB(xenev,29,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
 XENINTRSTUB(xenev,30,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
 XENINTRSTUB(xenev,31,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
-  
+
 LABEL(xenev_stubs)
-  	.quad _C_LABEL(Xrecurse_xenev0), _C_LABEL(Xresume_xenev0)
-  	.quad _C_LABEL(Xrecurse_xenev1) ,_C_LABEL(Xresume_xenev1)
-  	.quad _C_LABEL(Xrecurse_xenev2) ,_C_LABEL(Xresume_xenev2)
-  	.quad _C_LABEL(Xrecurse_xenev3) ,_C_LABEL(Xresume_xenev3)
-  	.quad _C_LABEL(Xrecurse_xenev4) ,_C_LABEL(Xresume_xenev4)
-  	.quad _C_LABEL(Xrecurse_xenev5) ,_C_LABEL(Xresume_xenev5)
-  	.quad _C_LABEL(Xrecurse_xenev6) ,_C_LABEL(Xresume_xenev6)
-  	.quad _C_LABEL(Xrecurse_xenev7) ,_C_LABEL(Xresume_xenev7)
-  	.quad _C_LABEL(Xrecurse_xenev8) ,_C_LABEL(Xresume_xenev8)
-  	.quad _C_LABEL(Xrecurse_xenev9) ,_C_LABEL(Xresume_xenev9)
-  	.quad _C_LABEL(Xrecurse_xenev10), _C_LABEL(Xresume_xenev10)
-  	.quad _C_LABEL(Xrecurse_xenev11), _C_LABEL(Xresume_xenev11)
-  	.quad _C_LABEL(Xrecurse_xenev12), _C_LABEL(Xresume_xenev12)
-  	.quad _C_LABEL(Xrecurse_xenev13), _C_LABEL(Xresume_xenev13)
-  	.quad _C_LABEL(Xrecurse_xenev14), _C_LABEL(Xresume_xenev14)
-  	.quad _C_LABEL(Xrecurse_xenev15), _C_LABEL(Xresume_xenev15)
-  	.quad _C_LABEL(Xrecurse_xenev16), _C_LABEL(Xresume_xenev16)
-  	.quad _C_LABEL(Xrecurse_xenev17), _C_LABEL(Xresume_xenev17)
-  	.quad _C_LABEL(Xrecurse_xenev18), _C_LABEL(Xresume_xenev18)
-  	.quad _C_LABEL(Xrecurse_xenev19), _C_LABEL(Xresume_xenev19)
-  	.quad _C_LABEL(Xrecurse_xenev20), _C_LABEL(Xresume_xenev20)
-  	.quad _C_LABEL(Xrecurse_xenev21), _C_LABEL(Xresume_xenev21)
-  	.quad _C_LABEL(Xrecurse_xenev22), _C_LABEL(Xresume_xenev22)
-  	.quad _C_LABEL(Xrecurse_xenev23), _C_LABEL(Xresume_xenev23)
-  	.quad _C_LABEL(Xrecurse_xenev24), _C_LABEL(Xresume_xenev24)
-  	.quad _C_LABEL(Xrecurse_xenev25), _C_LABEL(Xresume_xenev25)
-  	.quad _C_LABEL(Xrecurse_xenev26), _C_LABEL(Xresume_xenev26)
-  	.quad _C_LABEL(Xrecurse_xenev27), _C_LABEL(Xresume_xenev27)
-  	.quad _C_LABEL(Xrecurse_xenev28), _C_LABEL(Xresume_xenev28)
-  	.quad _C_LABEL(Xrecurse_xenev29), _C_LABEL(Xresume_xenev29)
-  	.quad _C_LABEL(Xrecurse_xenev30), _C_LABEL(Xresume_xenev30)
-  	.quad _C_LABEL(Xrecurse_xenev31), _C_LABEL(Xresume_xenev31)
+	.quad _C_LABEL(Xrecurse_xenev0), _C_LABEL(Xresume_xenev0)
+	.quad _C_LABEL(Xrecurse_xenev1) ,_C_LABEL(Xresume_xenev1)
+	.quad _C_LABEL(Xrecurse_xenev2) ,_C_LABEL(Xresume_xenev2)
+	.quad _C_LABEL(Xrecurse_xenev3) ,_C_LABEL(Xresume_xenev3)
+	.quad _C_LABEL(Xrecurse_xenev4) ,_C_LABEL(Xresume_xenev4)
+	.quad _C_LABEL(Xrecurse_xenev5) ,_C_LABEL(Xresume_xenev5)
+	.quad _C_LABEL(Xrecurse_xenev6) ,_C_LABEL(Xresume_xenev6)
+	.quad _C_LABEL(Xrecurse_xenev7) ,_C_LABEL(Xresume_xenev7)
+	.quad _C_LABEL(Xrecurse_xenev8) ,_C_LABEL(Xresume_xenev8)
+	.quad _C_LABEL(Xrecurse_xenev9) ,_C_LABEL(Xresume_xenev9)
+	.quad _C_LABEL(Xrecurse_xenev10), _C_LABEL(Xresume_xenev10)
+	.quad _C_LABEL(Xrecurse_xenev11), _C_LABEL(Xresume_xenev11)
+	.quad _C_LABEL(Xrecurse_xenev12), _C_LABEL(Xresume_xenev12)
+	.quad _C_LABEL(Xrecurse_xenev13), _C_LABEL(Xresume_xenev13)
+	.quad _C_LABEL(Xrecurse_xenev14), _C_LABEL(Xresume_xenev14)
+	.quad _C_LABEL(Xrecurse_xenev15), _C_LABEL(Xresume_xenev15)
+	.quad _C_LABEL(Xrecurse_xenev16), _C_LABEL(Xresume_xenev16)
+	.quad _C_LABEL(Xrecurse_xenev17), _C_LABEL(Xresume_xenev17)
+	.quad _C_LABEL(Xrecurse_xenev18), _C_LABEL(Xresume_xenev18)
+	.quad _C_LABEL(Xrecurse_xenev19), _C_LABEL(Xresume_xenev19)
+	.quad _C_LABEL(Xrecurse_xenev20), _C_LABEL(Xresume_xenev20)
+	.quad _C_LABEL(Xrecurse_xenev21), _C_LABEL(Xresume_xenev21)
+	.quad _C_LABEL(Xrecurse_xenev22), _C_LABEL(Xresume_xenev22)
+	.quad _C_LABEL(Xrecurse_xenev23), _C_LABEL(Xresume_xenev23)
+	.quad _C_LABEL(Xrecurse_xenev24), _C_LABEL(Xresume_xenev24)
+	.quad _C_LABEL(Xrecurse_xenev25), _C_LABEL(Xresume_xenev25)
+	.quad _C_LABEL(Xrecurse_xenev26), _C_LABEL(Xresume_xenev26)
+	.quad _C_LABEL(Xrecurse_xenev27), _C_LABEL(Xresume_xenev27)
+	.quad _C_LABEL(Xrecurse_xenev28), _C_LABEL(Xresume_xenev28)
+	.quad _C_LABEL(Xrecurse_xenev29), _C_LABEL(Xresume_xenev29)
+	.quad _C_LABEL(Xrecurse_xenev30), _C_LABEL(Xresume_xenev30)
+	.quad _C_LABEL(Xrecurse_xenev31), _C_LABEL(Xresume_xenev31)
 END(xenev_stubs)
 
 # Xen callbacks
 
 # Hypervisor callback
 NENTRY(hypervisor_callback)
-	movq (%rsp),%rcx
-	movq 8(%rsp),%r11
-	addq $16,%rsp
+	movq	(%rsp),%rcx
+	movq	8(%rsp),%r11
+	addq	$16,%rsp
 	pushq	$0	# Dummy error code
 	pushq	$T_ASTFLT
 	INTRENTRY
@@ -696,7 +696,7 @@
 	movq	%rsp, %rdi
 	subq	$8, %rdi; /* don't forget if_ppl */
 	call	do_hypervisor_callback
-	testb   $SEL_RPL,TF_CS(%rsp)
+	testb	$SEL_RPL,TF_CS(%rsp)
 	jnz	doreti_checkast
 1:
 	INTRFASTEXIT
@@ -704,15 +704,15 @@
 
 # Panic?
 NENTRY(failsafe_callback)
-	movq (%rsp),%rcx
-	movq 8(%rsp),%r11
-	addq $16,%rsp
+	movq	(%rsp),%rcx
+	movq	8(%rsp),%r11
+	addq	$16,%rsp
 	pushq	$0
 	pushq	$T_ASTFLT
 	INTRENTRY
 	movq	%rsp, %rdi
 	subq	$8, %rdi; /* don't forget if_ppl */
-	call xen_failsafe_handler
+	call	xen_failsafe_handler
 	INTRFASTEXIT
 #	jmp	HYPERVISOR_iret
 END(failsafe_callback)
--- a/sys/arch/amd64/conf/ALL	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/conf/ALL	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.23.2.3 2015/09/22 12:05:36 skrll Exp $
+# $NetBSD: ALL,v 1.23.2.4 2015/12/27 12:09:28 skrll Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.23.2.3 $"
+#ident 		"ALL-$Revision: 1.23.2.4 $"
 
 maxusers	64		# estimated number of users
 
@@ -312,7 +312,6 @@
 #options 	VGA_RASTERCONSOLE
 # enable splash screen support; requires hw driver support
 #options 	SPLASHSCREEN
-#options 	SPLASHSCREEN_PROGRESS
 
 # Keylock support
 options 	KEYLOCK
@@ -1588,6 +1587,9 @@
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
 
+# iSCSI initiator
+pseudo-device	iscsi
+
 # wscons pseudo-devices
 pseudo-device	wsmux			# mouse & keyboard multiplexor
 pseudo-device	wsfont
@@ -1633,7 +1635,7 @@
 
 options 	PAX_MPROTECT=0		# PaX mprotect(2) restrictions
 options 	PAX_ASLR=0		# PaX Address Space Layout Randomization
-options 	PAX_SEGVGUARD=0		# PaX Segmentation fault guard
+#options 	PAX_SEGVGUARD=0		# PaX Segmentation fault guard
 
 #
 # NetBSD: GENERIC_ISDN,v 1.16 2010/01/03 03:53:34 dholland Exp
--- a/sys/arch/amd64/conf/GENERIC	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/conf/GENERIC	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.404.2.4 2015/09/22 12:05:36 skrll Exp $
+# $NetBSD: GENERIC,v 1.404.2.5 2015/12/27 12:09:28 skrll Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.404.2.4 $"
+#ident 		"GENERIC-$Revision: 1.404.2.5 $"
 
 maxusers	64		# estimated number of users
 
@@ -1195,7 +1195,7 @@
 ld*	at virtio?			# Virtio disk device
 vioif*	at virtio?			# Virtio network device
 viornd*	at virtio?			# Virtio entropy device
-
+vioscsi* at virtio?			# Virtio SCSI device
 
 # Pull in optional local configuration
 cinclude "arch/amd64/conf/GENERIC.local"
--- a/sys/arch/amd64/conf/XEN3_DOM0	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/conf/XEN3_DOM0	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,7 @@
-# $NetBSD: XEN3_DOM0,v 1.112.2.2 2015/09/22 12:05:36 skrll Exp $
+# $NetBSD: XEN3_DOM0,v 1.112.2.3 2015/12/27 12:09:28 skrll Exp $
+=======
+# $NetBSD: XEN3_DOM0,v 1.112.2.3 2015/12/27 12:09:28 skrll Exp $
+>>>>>>> 1.116
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -835,6 +838,9 @@
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
 
+# iSCSI initiator
+#pseudo-device	iscsi
+
 # wscons pseudo-devices
 pseudo-device	wsmux			# mouse & keyboard multiplexor
 pseudo-device	wsfont
--- a/sys/arch/amd64/conf/XEN3_DOMU	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/conf/XEN3_DOMU	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.60.2.2 2015/09/22 12:05:36 skrll Exp $
+# $NetBSD: XEN3_DOMU,v 1.60.2.3 2015/12/27 12:09:28 skrll Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -245,6 +245,11 @@
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
 
+# iSCSI initiator and dependencies
+#scsibus* at scsi?
+#sd*	at scsibus? target ? lun ?
+#pseudo-device	iscsi
+
 # userland interface to drivers, including autoconf and properties retrieval
 pseudo-device	drvctl
 
--- a/sys/arch/amd64/conf/kern.ldscript	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/conf/kern.ldscript	Sun Dec 27 12:09:27 2015 +0000
@@ -1,70 +1,73 @@
-/*	$NetBSD: kern.ldscript,v 1.8.2.1 2015/09/22 12:05:36 skrll Exp $	*/
+/*	$NetBSD: kern.ldscript,v 1.8.2.2 2015/12/27 12:09:28 skrll Exp $	*/
 
 #include "assym.h"
 
 ENTRY(_start)
 SECTIONS
 {
-  /* Read-only sections, merged into text segment: */
-  .text :
-  {
-    *(.text)
-    *(.text.*)
-    *(.stub)
-  }
-  _etext = . ;
-  PROVIDE (etext = .) ;
+	/* Read-only sections, merged into text segment: */
+	.text :
+	{
+		*(.text)
+		*(.text.*)
+		*(.stub)
+	}
+	_etext = . ;
+	PROVIDE (etext = .) ;
 
-  .rodata :
-  {
-    *(.rodata)
-    *(.rodata.*)
-  }
+	.rodata :
+	{
+		*(.rodata)
+		*(.rodata.*)
+	}
 
-  /* Adjust the address for the data segment.  We want to adjust up to
-     the same address within the page on the next page up.  */
-  . = ALIGN(0x100000) + (. & (0x100000 - 1));
-  __data_start = . ;
-  .data :
-  {
-    *(.data)
-  }
+	/*
+	 * Adjust the address for the data segment.  We want to adjust up to
+	 * the same address within the page on the next page up.
+	 */
+	. = ALIGN(0x100000) + (. & (0x100000 - 1));
+	__data_start = . ;
+	.data :
+	{
+		*(.data)
+	}
 
-  . = ALIGN(COHERENCY_UNIT);
-  .data.cacheline_aligned :
-  {
-    *(.data.cacheline_aligned)
-  }
-  . = ALIGN(COHERENCY_UNIT);
-  .data.read_mostly :
-  {
-    *(.data.read_mostly)
-  }
-  . = ALIGN(COHERENCY_UNIT);
+	. = ALIGN(COHERENCY_UNIT);
+	.data.cacheline_aligned :
+	{
+		*(.data.cacheline_aligned)
+	}
+	. = ALIGN(COHERENCY_UNIT);
+	.data.read_mostly :
+	{
+		*(.data.read_mostly)
+	}
+	. = ALIGN(COHERENCY_UNIT);
 
-  _edata = . ;
-  PROVIDE (edata = .) ;
-  __bss_start = . ;
-  .bss :
-  {
-    *(.bss)
-    *(.bss.*)
-    *(COMMON)
-    . = ALIGN(64 / 8);
-  }
-  . = ALIGN(64 / 8);
-  _end = . ;
-  PROVIDE (end = .) ;
-  .note.netbsd.ident :
-  {
-    KEEP(*(.note.netbsd.ident));
-  }
+	_edata = . ;
+	PROVIDE (edata = .) ;
+	__bss_start = . ;
+	.bss :
+	{
+		*(.bss)
+		*(.bss.*)
+		*(COMMON)
+		. = ALIGN(64 / 8);
+	}
+	. = ALIGN(64 / 8);
+	_end = . ;
+	PROVIDE (end = .) ;
+	.note.netbsd.ident :
+	{
+		KEEP(*(.note.netbsd.ident));
+	}
 }
+
 SECTIONS
 {
-  .text :
-  AT (ADDR(.text) & 0x0fffffff)
-  {
-    *(.text)
-  } =0
+	.text :
+	AT (ADDR(.text) & 0x0fffffff)
+	{
+		*(.text)
+	} = 0
 }
--- a/sys/arch/amd64/include/param.h	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/include/param.h	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.18 2012/04/20 22:23:24 rmind Exp $	*/
+/*	$NetBSD: param.h,v 1.18.16.1 2015/12/27 12:09:28 skrll Exp $	*/
 
 #ifdef __x86_64__
 
@@ -59,7 +59,7 @@
 #define	INTRSTACKSIZE	4096
 
 #ifndef MSGBUFSIZE
-#define MSGBUFSIZE	8*NBPG		/* default message buffer size */
+#define MSGBUFSIZE	(8*NBPG)	/* default message buffer size */
 #endif
 
 /*
--- a/sys/arch/amd64/include/ptrace.h	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amd64/include/ptrace.h	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.3.100.1 2015/09/22 12:05:36 skrll Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.3.100.2 2015/12/27 12:09:28 skrll Exp $	*/
 
 /*
  * Copyright (c) 1993 Christopher G. Demetriou
@@ -55,6 +55,10 @@
 #define PTRACE_REG_SP(r)	(r)->regs[_REG_RSP]
 #define PTRACE_REG_INTRV(r)	(r)->regs[_REG_RAX]
 
+#define PTRACE_BREAKPOINT	((const uint8_t[]) { 0xcc })
+#define PTRACE_BREAKPOINT_SIZE	1
+#define PTRACE_BREAKPOINT_ADJ	1
+
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd32.h"
 
--- a/sys/arch/amiga/amiga/bus.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amiga/amiga/bus.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.1 2011/08/04 17:48:50 rkujawa Exp $ */
+/*	$NetBSD: bus.c,v 1.1.30.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -48,11 +48,7 @@
 bus_space_mmap(bus_space_tag_t t, bus_addr_t addr, off_t off, int prot,
 	int flags)
 {
-#if defined(__m68k__)
-	return m68k_btop(addr + off);
-#else
-	return -1; /* FIXME */
-#endif
+	return MD_BTOP(addr + off);
 }
 
 void *
@@ -63,4 +59,3 @@
 
 	return va;
 }
-
--- a/sys/arch/amiga/conf/WSCONS	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amiga/conf/WSCONS	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: WSCONS,v 1.67 2013/10/03 13:40:26 rkujawa Exp $
+# $NetBSD: WSCONS,v 1.67.6.1 2015/12/27 12:09:28 skrll Exp $
 
 # GENERIC with wscons(4)
 #
@@ -6,8 +6,6 @@
 
 # wscons(4)-aware interface to amiga custom chips.
 #
-amidisplaycc0	at mainbus0		# wscons interface to custom chips
-wsdisplay0	at amidisplaycc0 console ?
 options 	WSEMUL_VT100
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
 options 	FONT_VT220L8x10
@@ -23,29 +21,21 @@
 ums*		at uhidev? reportid ? 
 wsmouse*	at ums?
 
+amidisplaycc0	at mainbus0		# wscons interface to custom chips
+
+# Disable grf(4) devices without wsdisplay support.
 no grfcc0	at mainbus0
 no grfrt0	at zbus0
 no grfrh0	at zbus0
-no grfcl*	at zbus0
 no grful0	at zbus0
 no grfet*	at zbus0
-#no grfcv0	at zbus0
-#no grfcv3d0	at zbus0
-
-# Disable grf(4) devices for non-wsdisplay drivers.
 no grf0		at grfcc0
 no grf1		at grfrt0
 no grf2		at grfrh0
-no grf3		at grfcl?
 no grf4		at grful0
 no grf6		at grfet?
-#no grf5	at grfcv0
-#no grf7	at grfcv3d0
 
-wsdisplay*	at grf5 console ?	# wsdisplay on top of grf (CV64)
-wsdisplay*	at grf7 console ?	# wsdisplay on top of grf (CV64/3D)
-
-# Disable ite(4) for all drivers.
+# Disable ite(4) for all grf(4) drivers.
 no ite0		at grf0
 no ite1		at grf1
 no ite2		at grf2
@@ -64,8 +54,8 @@
 # G-REX.
 #options		P5PB_CONSOLE
 
+wsdisplay0	at wsemuldisplaydev? console 1
 wsdisplay*	at wsemuldisplaydev? console ?
 
 pseudo-device	wsfont			# wsfont(4) dynamic font loading support
 pseudo-device	wsmux			# mouse & keyboard multiplexor
-
--- a/sys/arch/amiga/dev/amidisplaycc.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amiga/dev/amidisplaycc.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: amidisplaycc.c,v 1.27.6.1 2015/09/22 12:05:36 skrll Exp $ */
+/*	$NetBSD: amidisplaycc.c,v 1.27.6.2 2015/12/27 12:09:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 2000 Jukka Andberg.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.27.6.1 2015/09/22 12:05:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.27.6.2 2015/12/27 12:09:28 skrll Exp $");
 
 /*
  * wscons interface to amiga custom chips. Contains the necessary functions
@@ -1183,7 +1183,7 @@
 	rv = (paddr_t)bm->hardware_address;
 	rv += off;
 
-	return (rv >> PGSHIFT);
+	return MD_BTOP(rv);
 }
 
 
--- a/sys/arch/amiga/dev/clock.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amiga/dev/clock.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.54 2012/10/27 17:17:28 chs Exp $ */
+/*	$NetBSD: clock.c,v 1.54.14.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.54 2012/10/27 17:17:28 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.54.14.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -475,7 +475,7 @@
 void
 clockmap(dev_t dev, int off, int prot)
 {
-	return((off + (INTIOBASE+CLKBASE+CLKSR-1)) >> PGSHIFT);
+	return MD_BTOP(off + (INTIOBASE+CLKBASE+CLKSR-1));
 }
 
 int
--- a/sys/arch/amiga/dev/grf.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amiga/dev/grf.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf.c,v 1.62 2014/07/25 08:10:31 dholland Exp $ */
+/*	$NetBSD: grf.c,v 1.62.4.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.62 2014/07/25 08:10:31 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.62.4.1 2015/12/27 12:09:28 skrll Exp $");
 
 /*
  * Graphics display driver for the Amiga
@@ -76,7 +76,6 @@
 #include <amiga/amiga/color.h>	/* DEBUG */
 #include <amiga/amiga/device.h>
 #include <amiga/dev/grfioctl.h>
-#include <amiga/dev/grfws.h>
 #include <amiga/dev/grfvar.h>
 #include <amiga/dev/itevar.h>
 #include <amiga/dev/kbdvar.h>
@@ -141,7 +140,6 @@
 static void grf_init_screen(void *, struct vcons_screen *, int, long *);
 static struct rasops_info *grf_setup_rasops(struct grf_softc *,
     struct vcons_screen *);
-static paddr_t grf_wsmmap_md(off_t off);
 
 cons_decl(grf);
 #endif
@@ -182,11 +180,11 @@
 	grfsp[gp->g_unit] = gp;
 
 	/*
-	 * find our major device number
+	 * find our major device number, make device
 	 */
 	maj = cdevsw_lookup_major(&grf_cdevsw);
+	gp->g_grfdev = makedev(maj, gp->g_unit);
 
-	gp->g_grfdev = makedev(maj, gp->g_unit);
 	if (self != NULL) {
 		printf(": width %d height %d", gp->g_display.gd_dwidth,
 		    gp->g_display.gd_dheight);
@@ -194,23 +192,25 @@
 			printf(" monochrome\n");
 		else
 			printf(" colors %d\n", gp->g_display.gd_colors);
+
 #if NWSDISPLAY > 0
-		vcons_init(&gp->g_vd, gp, gp->g_screens[0], gp->g_accessops);
+		vcons_init(&gp->g_vd, gp, gp->g_defaultscr, gp->g_accessops);
 		gp->g_vd.init_screen = grf_init_screen;
+
 		if (gp->g_flags & GF_CONSOLE) {
 			console_vcons.scr_flags |= VCONS_SCREEN_IS_STATIC;
 			vcons_init_screen(&gp->g_vd,
 			    &console_vcons, 1, &defattr);
-			gp->g_screens[0]->textops =
+			gp->g_defaultscr->textops =
 			    &console_vcons.scr_ri.ri_ops;
-			wsdisplay_cnattach(gp->g_screens[0],
+			wsdisplay_cnattach(gp->g_defaultscr,
 			    &console_vcons.scr_ri, 0, 0, defattr);
 			vcons_replay_msgbuf(&console_vcons);
 		}
 
 		/* attach wsdisplay */
 		wa.console = (gp->g_flags & GF_CONSOLE) != 0;
-		wa.scrdata = &gp->g_screenlist;
+		wa.scrdata = gp->g_scrlist;
 		wa.accessops = gp->g_accessops;
 		wa.accesscookie = &gp->g_vd;
 		config_found(self, &wa, wsemuldisplaydevprint);
@@ -368,14 +368,14 @@
 	 * control registers
 	 */
 	if (off >= 0 && off < gi->gd_regsize)
-		return(((paddr_t)gi->gd_regaddr + off) >> PGSHIFT);
+		return MD_BTOP((paddr_t)gi->gd_regaddr + off);
 
 	/*
 	 * frame buffer
 	 */
 	if (off >= gi->gd_regsize && off < gi->gd_regsize+gi->gd_fbsize) {
 		off -= gi->gd_regsize;
-		return(((paddr_t)gi->gd_fbaddr + off) >> PGSHIFT);
+		return MD_BTOP((paddr_t)gi->gd_fbaddr + off);
 	}
 	/* bogus */
 	return(-1);
@@ -477,16 +477,17 @@
 		gp = grfsp[unit];
 		if (gp != NULL && (gp->g_flags & GF_ALIVE)) {
 			gp->g_flags |= GF_CONSOLE;  /* we are console! */
-			gp->g_screens[0]->ncols = gp->g_display.gd_fbwidth /
-			    gp->g_screens[0]->fontwidth;
-			gp->g_screens[0]->nrows = gp->g_display.gd_fbheight /
-			    gp->g_screens[0]->fontheight;
+
+			gp->g_defaultscr->ncols = gp->g_display.gd_fbwidth /
+			    gp->g_defaultscr->fontwidth;
+			gp->g_defaultscr->nrows = gp->g_display.gd_fbheight /
+			    gp->g_defaultscr->fontheight;
 
 			ri = grf_setup_rasops(gp, &console_vcons);
 			console_vcons.scr_cookie = gp;
 			defattr = 0;  /* XXX */
 
-			wsdisplay_preattach(gp->g_screens[0], ri, 0, 0,
+			wsdisplay_preattach(gp->g_defaultscr, ri, 0, 0,
 			    defattr);
 #if NKBD > 0
 			/* tell kbd device it is used as console keyboard */
@@ -519,8 +520,8 @@
 	scr->scr_flags |= VCONS_DONT_READ;
 	memset(ri, 0, sizeof(struct rasops_info));
 
-	ri->ri_rows = gp->g_screens[0]->nrows;
-	ri->ri_cols = gp->g_screens[0]->ncols;
+	ri->ri_rows = gp->g_defaultscr->nrows;
+	ri->ri_cols = gp->g_defaultscr->ncols;
 	ri->ri_hw = scr;
 	ri->ri_ops.cursor    = gp->g_emulops->cursor;
 	ri->ri_ops.mapchar   = gp->g_emulops->mapchar;
@@ -538,6 +539,66 @@
 	return ri;
 }
 
+/*
+ * Called as fallback for ioctls which are not handled by the specific
+ * grf driver.
+ */
+int
+grf_wsioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
+{
+	struct wsdisplayio_fbinfo *iofbi;
+	struct wsdisplay_fbinfo *fbinfo;
+	struct vcons_data *vd;
+	struct grf_softc *gp;
+	struct vcons_screen *scr;
+	struct grfinfo *gi;
+
+	vd = v;
+	gp = vd->cookie;
+	scr = vd->active;
+
+	switch (cmd) {
+	case WSDISPLAYIO_GET_FBINFO:
+		if (scr != NULL) {
+			iofbi = data;
+			return wsdisplayio_get_fbinfo(&scr->scr_ri, iofbi);
+		}
+		return ENODEV;
+
+	case WSDISPLAYIO_GINFO:
+		if (scr != NULL) {
+			fbinfo = (struct wsdisplay_fbinfo *)data;
+			gi = &gp->g_display;
+
+			/*
+			 * We should return truth about the current mode here,
+			 * because X11 wsfb driver depends on this!
+			 */
+			fbinfo->height = gi->gd_fbheight;
+			fbinfo->width = gi->gd_fbwidth;
+			fbinfo->depth = gi->gd_planes;
+			fbinfo->cmsize = gi->gd_colors;
+			return 0;
+		}
+		return ENODEV;
+
+	case WSDISPLAYIO_GTYPE:
+		*(u_int *)data = WSDISPLAY_TYPE_GRF;
+		return 0;
+
+	case WSDISPLAYIO_SMODE:
+		if ((*(int *)data) != gp->g_wsmode) {
+			gp->g_wsmode = *(int *)data;
+			if (gp->g_wsmode == WSDISPLAYIO_MODE_EMUL &&
+			    scr != NULL)
+				vcons_redraw_screen(scr);
+		} 
+		return 0;
+	}
+
+	return EPASSTHROUGH;
+}
+
 paddr_t
 grf_wsmmap(void *v, void *vs, off_t off, int prot)
 {
@@ -551,8 +612,12 @@
 
 	/* Normal fb mapping */
 	if (off < gi->gd_fbsize)
-		return grf_wsmmap_md(((bus_addr_t)gp->g_fbkva) + off);
+		return MD_BTOP(((paddr_t)gi->gd_fbaddr) + off);
 
+	/*
+	 * restrict all other mappings to processes with superuser privileges
+	 * or the kernel itself
+	 */
 	if (kauth_authorize_machdep(kauth_cred_get(), KAUTH_MACHDEP_UNMANAGEDMEM,
 	    NULL, NULL, NULL, NULL) != 0) {
 		aprint_normal("%s: permission to mmap denied.\n",
@@ -560,258 +625,18 @@
 		return -1;
 	}
 
-	if ((off >= (bus_addr_t)gp->g_fbkva ) &&
-	    (off < ( (bus_addr_t)gp->g_fbkva + (size_t)gi->gd_fbsize)))
-		return grf_wsmmap_md(off);
+	/* Handle register mapping */
+	if ((off >= (paddr_t)gi->gd_regaddr) &&
+	    (off < ((paddr_t)gi->gd_regaddr + (size_t)gi->gd_regsize)))
+		return MD_BTOP(off);
 
-	/* Handle register mapping */
-	if ((off >= (bus_addr_t)gi->gd_regaddr) &&
-	    (off < ((bus_addr_t)gi->gd_regaddr + (size_t)gi->gd_regsize)))
-		return grf_wsmmap_md(off);
+	if ((off >= (paddr_t)gi->gd_fbaddr) &&
+	    (off < ((paddr_t)gi->gd_fbaddr + (size_t)gi->gd_fbsize)))
+		return MD_BTOP(off);
 
 	return -1;
 }
 
-static paddr_t
-grf_wsmmap_md(off_t off) 
-{
-#if defined(__m68k__)
-	return (paddr_t) m68k_btop(off);
-#else
-	return -1; /* FIXME */
-#endif
-}
-
-int
-grf_wsioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
-{
-	struct vcons_data *vd;
-	struct grf_softc *gp;
-
-	vd = v;
-	gp = vd->cookie;
-
-	switch (cmd) {
-	/* XXX: check if ptr to implementation is not null */
-	case WSDISPLAYIO_GINFO:
-		return gp->g_wsioctl->ginfo(gp, data);
-	case WSDISPLAYIO_SMODE:
-		return gp->g_wsioctl->smode(gp, data);
-	case WSDISPLAYIO_GMODE:
-		return gp->g_wsioctl->gmode(gp, data);
-	case WSDISPLAYIO_GTYPE:
-		return gp->g_wsioctl->gtype(gp, data);
-	case WSDISPLAYIO_SVIDEO:
-		return gp->g_wsioctl->svideo(gp, data);
-	case WSDISPLAYIO_GVIDEO:
-		return gp->g_wsioctl->gvideo(gp, data);
-	case WSDISPLAYIO_GETCMAP:
-		return gp->g_wsioctl->getcmap(gp, data);
-	case WSDISPLAYIO_PUTCMAP:
-		return gp->g_wsioctl->putcmap(gp, data);
-	}
-
-	return EPASSTHROUGH;
-}
-
-/* wsdisplay_accessops ioctls */
-
-int 
-grf_wsaogetcmap(void *c, void *data) 
-{
-	u_int index, count;
-	struct grf_softc *gp;
-	struct wsdisplay_cmap *cm __unused;
-
-	cm = (struct wsdisplay_cmap*) data;
-	gp = c;
-	index = 0;
-	count = 0;
-
-	if (gp->g_wsmode == WSDISPLAYIO_MODE_EMUL)
-		return EINVAL;
-
-	if (index >= 255 || count > 256 || index + count > 256)
-		return EINVAL;
-
-	/* 
-	 * TODO: copyout values for r, g, b. This function should be 
-	 * driver-specific... 
-	 */
-
-	return 0;
-}
-
-int
-grf_wsaoputcmap(void *c, void *data)
-{
-	/*
-	 * We probably couldn't care less about color map in MODE_EMUL,
-	 * I don't know about X11 yet. Also, these ioctls could be used by
-	 * fullscreen console programs (think wsdisplay picture viewer, or
-	 * the wsimgshow tool written by Yasushi Oshima).
-	 */
-	struct grf_softc *gp;
-
-	gp = c;
-
-	if (gp->g_wsmode == WSDISPLAYIO_MODE_EMUL)
-		return EINVAL;
-	/* ... */
-
-	return 0;
-}
-
-int
-grf_wsaosvideo(void *c, void *data)
-{
-#if 0
-	struct grf_softc *gp;
-	dev_t dev; 
-	int rv;
-
-	gp = c;
-	dev = (dev_t) &gp->g_grfdev;
-
-	if (*(u_int *)data == WSDISPLAYIO_VIDEO_OFF) {
-		if ((gp->g_flags & GF_GRFON) == 0)
-			rv = 0;
-		else {
-			gp->g_flags &= ~GF_GRFON;
-			rv = gp->g_mode(gp, (dev & GRFOVDEV) ? 
-			    GM_GRFOVOFF : GM_GRFOFF, NULL, 0, 0);
-		}
-
-	} else {
-		if ((gp->g_flags & GF_GRFON))
-        		rv = 0;
-		else
-			gp->g_flags |= GF_GRFON;
-			rv = gp->g_mode(gp, (dev & GRFOVDEV) ? 
-			    GM_GRFOVON : GM_GRFON, NULL, 0, 0);
-	}
-
-	return rv;
-#endif
-	return 0;
-}
-
-int
-grf_wsaogvideo(void *c, void *data) 
-{
-	struct grf_softc *gp;
-
-	gp = c;
-
-	if(gp->g_flags & GF_GRFON) 
-		*(u_int *)data = WSDISPLAYIO_VIDEO_ON;
-	else
-		*(u_int *)data = WSDISPLAYIO_VIDEO_OFF;
-
-	return 0;
-}
-
-int
-grf_wsaogtype(void *c, void *data)
-{
-	struct grf_softc *gp __unused;
-
-	gp = c;
-
-	*(u_int *)data = WSDISPLAY_TYPE_GRF;
-	return 0;
-}
-
-int
-grf_wsaogmode(void *c, void *data)
-{
-	struct grf_softc *gp;
-
-	gp = c;
-
-	*(u_int *)data = gp->g_wsmode;
-	return 0;
-}
-
-int
-grf_wsaosmode(void *c, void *data)
-{
-	/* XXX: should provide hw-dependent impl of this in grf_xxx driver? */
-	struct grf_softc *gp;
-
-	gp = c;
-
-	if ((*(int*) data) != gp->g_wsmode) {
-		gp->g_wsmode = (*(int*) data);
-		if ((*(int*) data) == WSDISPLAYIO_MODE_EMUL) {
-			//vcons_redraw_screen( active vcons screen );
-		} 
-	}
-	return 0;
-}
-
-int
-grf_wsaoginfo(void *c, void *data) 
-{
-	struct wsdisplay_fbinfo *fbinfo;
-	struct grf_softc *gp;
-	struct grfinfo *gi;
-
-	gp = c;
-
-	fbinfo = (struct wsdisplay_fbinfo *)data;
-	gi = &gp->g_display;
-
-	/*
-	 * TODO: better sanity checking, it is possible that 
-	 * wsdisplay is initialized, but no screen is opened
-	 * (for example, device is not used).
-	 */
-
-	/*
-	 * We shold return truth about current mode here because
-	 * X11 wsfb driver denepds on this!
-	 */
-	fbinfo->height = gi->gd_fbheight;
-	fbinfo->width = gi->gd_fbwidth;
-	fbinfo->depth = gi->gd_planes;
-	fbinfo->cmsize = gi->gd_colors;
-
-	return 0;
-}
-
 #endif  /* NWSDISPLAY > 0 */
 
-#ifdef DEBUG
-void
-grfdebug(struct grf_softc *gp, const char *fmt, ...)
-{
-	static int ccol = 0, crow = 1;
-	volatile char *cp;
-	char buf[256];
-	va_list ap;
-	int ncols;
-	char *bp;
-
-	va_start(ap, fmt);
-	vsnprintf(buf, 256, fmt, ap);
-	va_end(ap);
-
-	cp = gp->g_fbkva;
-	ncols = gp->g_display.gd_fbwidth / 8;
-	cp += (crow * ncols + ccol) << 2;
-	for (bp = buf; *bp != '\0'; bp++) {
-		if (*bp == '\n') {
-			ccol = 0;
-			crow++;
-			continue;
-		}
-		*cp++ = *bp;
-		*cp = 0x0a;
-		cp += 3;
-		ccol++;
-	}
-}
-#endif  /* DEBUG */
-
 #endif	/* NGRF > 0 */
--- a/sys/arch/amiga/dev/grf_cl.c	Wed Dec 23 16:02:42 2015 +0000
+++ b/sys/arch/amiga/dev/grf_cl.c	Sun Dec 27 12:09:27 2015 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cl.c,v 1.49 2014/01/22 00:25:16 christos Exp $ */
+/*	$NetBSD: grf_cl.c,v 1.49.6.1 2015/12/27 12:09:28 skrll Exp $ */
 
 /*
  * Copyright (c) 1997 Klaus Burkert
@@ -36,10 +36,11 @@
 #include "opt_amigacons.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grf_cl.c,v 1.49 2014/01/22 00:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cl.c,v 1.49.6.1 2015/12/27 12:09:28 skrll Exp $");
 
 #include "grfcl.h"
 #include "ite.h"
+#include "wsdisplay.h"
 #if NGRFCL > 0
 
 /*
@@ -81,6 +82,12 @@
 
 #include <machine/cpu.h>
 #include <dev/cons.h>
+#if NWSDISPLAY > 0
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsdisplayvar.h>
+#include <dev/rasops/rasops.h>
+#include <dev/wscons/wsdisplay_vconsvar.h>
+#endif
 #include <amiga/dev/itevar.h>
 #include <amiga/amiga/device.h>
 #include <amiga/dev/grfioctl.h>
@@ -106,7 +113,8 @@
 static int cl_setspriteinfo(struct grf_softc *, struct grf_spriteinfo *);
 int	cl_getspriteinfo(struct grf_softc *, struct grf_spriteinfo *);
 static int cl_getspritemax(struct grf_softc *, struct grf_position *);
-int	cl_blank(struct grf_softc *, int *);
+int	cl_blank(struct grf_softc *, int);
+int	cl_isblank(struct grf_softc *);
 int	cl_setmonitor(struct grf_softc *, struct grfvideo_mode *);
 void	cl_writesprpos(volatile char *, short, short);
 void	writeshifted(volatile char *, signed char, signed char);
@@ -120,6 +128,21 @@
 int	grfclmatch(device_t, cfdata_t, void *);
 void	cl_memset(unsigned char *, unsigned char, int);
 
+#if NWSDISPLAY > 0
+/* wsdisplay acessops, emulops */
+static int	cl_wsioctl(void *, void *, u_long, void *, int, struct lwp *);
+static int	cl_get_fbinfo(struct grf_softc *, struct wsdisplayio_fbinfo *);
+
+static void	cl_wscursor(void *, int, int, int);
+static void	cl_wsputchar(void *, int, int, u_int, long);
+static void	cl_wscopycols(void *, int, int, int, int);
+static void	cl_wserasecols(void *, int, int, int, long);
+static void	cl_wscopyrows(void *, int, int, int);
+static void	cl_wseraserows(void *, int, int, long);
+static int	cl_wsallocattr(void *, int, int, int, long *);
+static int	cl_wsmapchar(void *, int, unsigned int *);
+#endif  /* NWSDISPLAY > 0 */
+
 /* Graphics display definitions.
  * These are filled by 'grfconfig' using GRFIOCSETMON.
  */
@@ -162,6 +185,7 @@
 int	cltype = 0;		/* Picasso, Spectrum or Piccolo */
 int	cl_64bit = 0;		/* PiccoloSD64 or PicassoIV */
 unsigned char cl_pass_toggle;	/* passthru status tracker */
+static int cl_blanked;		/* true when video is currently blanked out */
 
 /*
  * because all 542x-boards have 2 configdev entries, one for
@@ -188,6 +212,41 @@
 static unsigned char cl_imageptr[8 * 64], cl_maskptr[8 * 64];
 static unsigned char cl_sprred[2], cl_sprgreen[2], cl_sprblue[2];
 
+#if NWSDISPLAY > 0
+static struct wsdisplay_accessops cl_accessops = {
+	.ioctl		= cl_wsioctl,
+	.mmap		= grf_wsmmap
+};
+
+static struct wsdisplay_emulops cl_textops = {
+	.cursor		= cl_wscursor,
+	.mapchar	= cl_wsmapchar,
+	.putchar	= cl_wsputchar,
+	.copycols	= cl_wscopycols,
+	.erasecols	= cl_wserasecols,
+	.copyrows	= cl_wscopyrows,
+	.eraserows	= cl_wseraserows,
+	.allocattr	= cl_wsallocattr
+};
+
+static struct wsscreen_descr cl_defaultscreen = {
+	.name		= "default",
+	.textops	= &cl_textops,
+	.fontwidth	= 8,
+	.fontheight	= CIRRUSFONTY,
+	.capabilities	= WSSCREEN_HILIT | WSSCREEN_BLINK |
+			  WSSCREEN_REVERSE | WSSCREEN_UNDERLINE
+};
+
+static const struct wsscreen_descr *cl_screens[] = {
+	&cl_defaultscreen,
+};
+
+static struct wsscreen_list cl_screenlist = {
+	sizeof(cl_screens) / sizeof(struct wsscreen_descr *), cl_screens
+};
+#endif  /* NWSDISPLAY > 0 */
+
 /* standard driver stuff */
 CFATTACH_DECL_NEW(grfcl, sizeof(struct grf_softc),
     grfclmatch, grfclattach, NULL, NULL);
@@ -377,13 +436,20 @@
 
 		/* wakeup the board */
 		cl_boardinit(gp);
+
 #ifdef CL5426CONSOLE
+#if NWSDISPLAY > 0
+		gp->g_accessops = &cl_accessops;
+		gp->g_emulops = &cl_textops;
+		gp->g_defaultscr = &cl_defaultscreen;
+		gp->g_scrlist = &cl_screenlist;
+#else
 #if NITE > 0
 		grfcl_iteinit(gp);
 #endif
+#endif  /* NWSDISPLAY > 0 */
 		(void) cl_load_mon(gp, &clconsole_mode);
 #endif
-
 	}
 
 	/*
@@ -488,6 +554,7 @@
 
 		/* setup initial unchanging parameters */
 
+		cl_blanked = 1;
 		WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x21);	/* 8 dot - display off */
 		vgaw(ba, GREG_MISC_OUTPUT_W, 0xed);	/* mem disable */
 
@@ -660,14 +727,24 @@
 	RegOnpass(ba);
 	vgaw(ba, SEQ_ADDRESS, SEQ_ID_CLOCKING_MODE);
 	vgaw(ba, SEQ_ADDRESS_W, vgar(ba, SEQ_ADDRESS_W) | 0x20);
+	cl_blanked = 1;
 }
 #endif
 
 int
-cl_blank(struct grf_softc *gp, int *on)
+cl_blank(struct grf_softc *gp, int on)
 {
-        WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on > 0 ? 0x01 : 0x21);
-        return(0);
+
+	WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, on ? 0x01 : 0x21);
+	cl_blanked = !on;
+	return 0;
+}
+
+int
+cl_isblank(struct grf_softc *gp)
+{
+
+	return cl_blanked;
 }
 
 /*
@@ -755,7 +832,7 @@
 		return (cl_setmonitor(gp, (struct grfvideo_mode *) data));
 
             case GRFIOCBLANK:
-                return (cl_blank(gp, (int *)data));
+                return (cl_blank(gp, *(int *)data));
 
 	}
 	return (EPASSTHROUGH);
@@ -1626,6 +1703,7 @@
 	}
 	WSeq(ba, SEQ_ID_CURSOR_ATTR, 0x14);
 	WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x01);
+	cl_blanked = 0;
 
 	/* Pass-through */
 
@@ -1772,4 +1850,341 @@
 	delay(200000);
 }
 
+#if NWSDISPLAY > 0
+static void
+cl_wscursor(void *c, int on, int row, int col) 
+{
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	struct grf_softc *gp;
+	volatile void *ba;
+	int offs;
+
+	ri = c;
+	scr = ri->ri_hw;
+	gp = scr->scr_cookie;
+	ba = gp->g_regkva;
+
+	if ((ri->ri_flg & RI_CURSOR) && !on) {
+		/* cursor was visible, but we want to remove it */
+		/*WCrt(ba, CRT_ID_CURSOR_START, | 0x20);*/
+		ri->ri_flg &= ~RI_CURSOR;
+	}
+
+	ri->ri_crow = row;
+	ri->ri_ccol = col;
+
+	if (on) {
+		/* move cursor to new location */
+		if (!(ri->ri_flg & RI_CURSOR)) {
+			/*WCrt(ba, CRT_ID_CURSOR_START, | 0x20);*/
+			ri->ri_flg |= RI_CURSOR;
+		}
+		offs = gp->g_rowoffset[row] + col;
+		WCrt(ba, CRT_ID_CURSOR_LOC_LOW, offs & 0xff);
+		WCrt(ba, CRT_ID_CURSOR_LOC_HIGH, offs >> 8);
+	}
+}
+
+static void
+cl_wsputchar(void *c, int row, int col, u_int ch, long attr)
+{
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	struct grf_softc *gp;
+	volatile unsigned char *ba, *cp;
+
+	ri = c;
+	scr = ri->ri_hw;
+	gp = scr->scr_cookie;
+	ba = gp->g_regkva;
+	cp = gp->g_fbkva;
+
+	cp += gp->g_rowoffset[row] + col;
+	SetTextPlane(ba, 0x00);
+	*cp = ch;
+	SetTextPlane(ba, 0x01);
+	*cp = attr;
+}
+
+static void     
+cl_wscopycols(void *c, int row, int srccol, int dstcol, int ncols) 
+{
+	volatile unsigned char *ba, *dst, *src;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	struct grf_softc *gp;
+	int i;
+
+	KASSERT(ncols > 0);
+	ri = c;
+	scr = ri->ri_hw;
+	gp = scr->scr_cookie;
+	ba = gp->g_regkva;
+	src = gp->g_fbkva;
+
+	src += gp->g_rowoffset[row];
+	dst = src;
+	src += srccol;
+	dst += dstcol;
+	if (srccol < dstcol) {
+		/* need to copy backwards */
+		src += ncols;
+		dst += ncols;
+		SetTextPlane(ba, 0x00);
+		for (i = 0; i < ncols; i++)
+			*(--dst) = *(--src);
+		src += ncols;
+		dst += ncols;
+		SetTextPlane(ba, 0x01);
+		for (i = 0; i < ncols; i++)
+			*(--dst) = *(--src);
+	} else {
+		SetTextPlane(ba, 0x00);
+		for (i = 0; i < ncols; i++)
+			*dst++ = *src++;
+		src -= ncols;
+		dst -= ncols;
+		SetTextPlane(ba, 0x01);
+		for (i = 0; i < ncols; i++)
+			*dst++ = *src++;
+	}
+}
+
+static void     
+cl_wserasecols(void *c, int row, int startcol, int ncols, long fillattr)
+{
+	volatile unsigned char *ba, *cp;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	struct grf_softc *gp;
+	int i;
+
+	ri = c;
+	scr = ri->ri_hw;
+	gp = scr->scr_cookie;
+	ba = gp->g_regkva;
+	cp = gp->g_fbkva;
+
+	cp += gp->g_rowoffset[row] + startcol;
+	SetTextPlane(ba, 0x00);
+	for (i = 0; i < ncols; i++)
+		*cp++ = 0x20;
+	cp -= ncols;
+	SetTextPlane(ba, 0x01);
+	for (i = 0; i < ncols; i++)
+		*cp++ = 0x07;
+}
+
+static void     
+cl_wscopyrows(void *c, int srcrow, int dstrow, int nrows) 
+{
+	volatile unsigned char *ba, *dst, *src;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	struct grf_softc *gp;
+	int i, n;
+
+	KASSERT(nrows > 0);
+	ri = c;
+	scr = ri->ri_hw;
+	gp = scr->scr_cookie;
+	ba = gp->g_regkva;
+	src = dst = gp->g_fbkva;
+	n = ri->ri_cols * nrows;
+
+	if (srcrow < dstrow) {
+		/* need to copy backwards */
+		src += gp->g_rowoffset[srcrow + nrows];
+		dst += gp->g_rowoffset[dstrow + nrows];
+		SetTextPlane(ba, 0x00);
+		for (i = 0; i < n; i++)
+			*(--dst) = *(--src);
+		src += n;
+		dst += n;
+		SetTextPlane(ba, 0x01);
+		for (i = 0; i < n; i++)
+			*(--dst) = *(--src);
+	} else {
+		src += gp->g_rowoffset[srcrow];
+		dst += gp->g_rowoffset[dstrow];
+		SetTextPlane(ba, 0x00);
+		for (i = 0; i < n; i++)
+			*dst++ = *src++;
+		src -= n;
+		dst -= n;
+		SetTextPlane(ba, 0x01);
+		for (i = 0; i < n; i++)
+			*dst++ = *src++;
+	}
+}
+
+static void     
+cl_wseraserows(void *c, int row, int nrows, long fillattr) 
+{
+	volatile unsigned char *ba, *cp;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	struct grf_softc *gp;
+	int i, n;
+
+	ri = c;
+	scr = ri->ri_hw;
+	gp = scr->scr_cookie;
+	ba = gp->g_regkva;
+	cp = gp->g_fbkva;
+
+	cp += gp->g_rowoffset[row];
+	n = ri->ri_cols * nrows;
+	SetTextPlane(ba, 0x00);
+	for (i = 0; i < n; i++)
+		*cp++ = 0x20;
+	cp -= n;
+	SetTextPlane(ba, 0x01);
+	for (i = 0; i < n; i++)
+		*cp++ = 0x07;
+}
+
+static int
+cl_wsallocattr(void *c, int fg, int bg, int flg, long *attr)
+{
+
+	/* XXX color support? */
+	*attr = (flg & WSATTR_REVERSE) ? 0x70 : 0x07;
+	if (flg & WSATTR_UNDERLINE)	*attr = 0x01;
+	if (flg & WSATTR_HILIT)		*attr |= 0x08;
+	if (flg & WSATTR_BLINK)		*attr |= 0x80;
+	return 0;
+}
+
+/* our font does not support unicode extensions */
+static int      
+cl_wsmapchar(void *c, int ch, unsigned int *cp)
+{
+
+	if (ch > 0 && ch < 256) {
+		*cp = ch;
+		return 5;
+	}
+	*cp = ' ';
+	return 0;
+}
+
+static int
+cl_wsioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
+{
+	struct vcons_data *vd;
+	struct grf_softc *gp;
+
+	vd = v;
+	gp = vd->cookie;
+
+	switch (cmd) {
+	case WSDISPLAYIO_GETCMAP:
+		/* Note: wsdisplay_cmap and grf_colormap have same format */
+		if (gp->g_display.gd_planes == 8)
+			return cl_getcmap(gp, (struct grf_colormap *)data);
+		return EINVAL;
+
+	case WSDISPLAYIO_PUTCMAP:
+		/* Note: wsdisplay_cmap and grf_colormap have same format */
+		if (gp->g_display.gd_planes == 8)
+			return cl_putcmap(gp, (struct grf_colormap *)data);
+		return EINVAL;
+
+	case WSDISPLAYIO_GVIDEO:
+		if (cl_isblank(gp))
+			*(u_int *)data = WSDISPLAYIO_VIDEO_OFF;
+		else
+			*(u_int *)data = WSDISPLAYIO_VIDEO_ON;
+		return 0;
+
+	case WSDISPLAYIO_SVIDEO:
+		return cl_blank(gp, *(u_int *)data == WSDISPLAYIO_VIDEO_ON);
+
+	case WSDISPLAYIO_SMODE:
+		if ((*(int *)data) != gp->g_wsmode) {
+			if (*(int *)data == WSDISPLAYIO_MODE_EMUL) {
+				/* load console text mode, redraw screen */
+				(void)cl_load_mon(gp, &clconsole_mode);
+				if (vd->active != NULL)
+					vcons_redraw_screen(vd->active);
+			} else {
+				/* switch to current graphics mode */
+				if (!cl_load_mon(gp,
+				    (struct grfcltext_mode *)monitor_current))
+					return EINVAL;
+			}
+			gp->g_wsmode = *(int *)data;
+		} 
+		return 0;
+
+	case WSDISPLAYIO_GET_FBINFO:
+		return cl_get_fbinfo(gp, data);
+	}
+
+	/* handle this command hw-independant in grf(4) */
+	return grf_wsioctl(v, vs, cmd, data, flag, l);
+}
+
+/*
+ * Fill the wsdisplayio_fbinfo structure with information from the current
+ * graphics mode. Even when text mode is active.
+ */
+static int
+cl_get_fbinfo(struct grf_softc *gp, struct wsdisplayio_fbinfo *fbi)
+{
+	struct grfvideo_mode *md;
+	uint32_t rbits, gbits, bbits;
+
+	md = monitor_current;
+
+	switch (md->depth) {
+	case 8:
+		fbi->fbi_bitsperpixel = 8;
+		rbits = gbits = bbits = 6;  /* keep gcc happy */
+		break;
+	case 15:
+		fbi->fbi_bitsperpixel = 16;
+		rbits = gbits = bbits = 5;
+		break;
+	case 16:
+		fbi->fbi_bitsperpixel = 16;
+		rbits = bbits = 5;
+		gbits = 6;
+		break;
+	case 24:
+		fbi->fbi_bitsperpixel = 24;
+		rbits = gbits = bbits = 8;
+		break;
+	default:
+		return EINVAL;
+	}
+
+	fbi->fbi_stride = (fbi->fbi_bitsperpixel / 8) * md->disp_width;
+	fbi->fbi_width = md->disp_width;
+	fbi->fbi_height = md->disp_height;
+
+	if (md->depth > 8) {
+		fbi->fbi_pixeltype = WSFB_RGB;
+		fbi->fbi_subtype.fbi_rgbmasks.red_offset = bbits + gbits;
+		fbi->fbi_subtype.fbi_rgbmasks.red_size = rbits;
+		fbi->fbi_subtype.fbi_rgbmasks.green_offset = bbits;
+		fbi->fbi_subtype.fbi_rgbmasks.green_size = gbits;</