Sync with HEAD nick-nhusb
authorskrll <skrll@NetBSD.org>
Wed, 05 Oct 2016 20:55:23 +0000
branchnick-nhusb
changeset 278601 0e9a0ff85e3f
parent 278600 897c4f2166ae
child 278602 9466bb814e94
Sync with HEAD
sys/arch/acorn32/podulebus/esc.c
sys/arch/acorn32/podulebus/sfas.c
sys/arch/algor/algor/algor_intr.c
sys/arch/alpha/include/Makefile
sys/arch/alpha/include/fenv.h
sys/arch/alpha/include/ieeefp.h
sys/arch/alpha/tc/tc_bus_mem.c
sys/arch/amd64/acpi/acpi_wakecode.S
sys/arch/amd64/acpi/acpi_wakeup_low.S
sys/arch/amd64/amd64/amd64_trap.S
sys/arch/amd64/amd64/gdt.c
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/trap.c
sys/arch/amd64/amd64/vector.S
sys/arch/amd64/conf/ALL
sys/arch/amd64/conf/GENERIC
sys/arch/amd64/conf/MODULAR
sys/arch/amd64/conf/XEN3_DOM0
sys/arch/amd64/conf/kern.ldscript.Xen
sys/arch/amd64/conf/std.xen
sys/arch/amd64/include/gdt.h
sys/arch/amd64/include/i82093reg.h
sys/arch/amd64/include/pmap.h
sys/arch/amd64/include/segments.h
sys/arch/amd64/include/vmparam.h
sys/arch/amiga/amiga/conf.c
sys/arch/amiga/conf/WSCONS
sys/arch/amiga/conf/files.amiga
sys/arch/amiga/dev/mntva.c
sys/arch/amiga/dev/mntvareg.h
sys/arch/amiga/dev/mntvavar.h
sys/arch/amiga/dev/zbus.c
sys/arch/amiga/stand/bootblock/Makefile.booters
sys/arch/amiga/stand/bootblock/boot/Makefile
sys/arch/amiga/stand/bootblock/elf2bb/Makefile
sys/arch/amiga/stand/bootblock/installboot/Makefile
sys/arch/amiga/stand/bootblock/txlt/Makefile
sys/arch/arc/arc/bus_space_sparse.c
sys/arch/arc/arc/c_nec_eisa.c
sys/arch/arc/include/param.h
sys/arch/arc/stand/Makefile.inc
sys/arch/arc/stand/boot/Makefile
sys/arch/arm/arm32/arm32_machdep.c
sys/arch/arm/arm32/arm32_tlb.c
sys/arch/arm/arm32/armv7_generic_space.c
sys/arch/arm/arm32/cpu.c
sys/arch/arm/arm32/kobj_machdep.c
sys/arch/arm/arm32/pmap.c
sys/arch/arm/imx/if_enet.c
sys/arch/arm/include/arm32/pmap.h
sys/arch/arm/include/cpufunc.h
sys/arch/arm/include/param.h
sys/arch/arm/marvell/pci_machdep.c
sys/arch/arm/nvidia/files.tegra
sys/arch/arm/nvidia/tegra124_car.c
sys/arch/arm/nvidia/tegra124_carreg.h
sys/arch/arm/nvidia/tegra_i2c.c
sys/arch/arm/nvidia/tegra_pcie.c
sys/arch/arm/nvidia/tegra_xusb-fw.mk
sys/arch/arm/nvidia/tegra_xusb.c
sys/arch/arm/nvidia/tegra_xusbpadreg.h
sys/arch/arm/nvidia/tegra_xusbreg.h
sys/arch/arm/omap/if_cpsw.c
sys/arch/arm/omap/omap2_gpio.c
sys/arch/arm/omap/omap2_reg.h
sys/arch/arm/omap/omap3_scm.c
sys/arch/arm/omap/omap3_sdhc.c
sys/arch/arm/omap/omap3_sdmmcreg.h
sys/arch/arm/omap/omap_edma.c
sys/arch/arm/omap/tiotg.c
sys/arch/atari/stand/Makefile.booters
sys/arch/atari/stand/binpatch/binpatch.c
sys/arch/cats/conf/INSTALL
sys/arch/cobalt/cobalt/machdep.c
sys/arch/cobalt/stand/Makefile.inc
sys/arch/cobalt/stand/boot/Makefile
sys/arch/dreamcast/include/Makefile
sys/arch/dreamcast/include/fenv.h
sys/arch/emips/ebus/if_le_ebus.c
sys/arch/emips/emips/interrupt.c
sys/arch/emips/emips/xilinx_ml40x.c
sys/arch/emips/emips/xs_bee3.c
sys/arch/evbarm/conf/ARMADILLO-IOT-G3
sys/arch/evbarm/conf/CUBOX-I
sys/arch/evbarm/conf/EXYNOS
sys/arch/evbarm/conf/KURONAS_X4
sys/arch/evbarm/conf/NITROGEN6X
sys/arch/evbarm/conf/OVERO
sys/arch/evbarm/conf/PANDABOARD
sys/arch/evbarm/conf/README.evbarm
sys/arch/evbarm/conf/TEGRA
sys/arch/evbarm/conf/VTC100
sys/arch/evbarm/conf/mk.tegra
sys/arch/evbarm/conf/std.overo
sys/arch/evbarm/stand/bootimx23/power_prep.c
sys/arch/evbmips/alchemy/mach_intr.c
sys/arch/evbmips/atheros/mach_intr.c
sys/arch/evbmips/cavium/mach_intr.c
sys/arch/evbmips/cavium/machdep.c
sys/arch/evbmips/conf/ERLITE
sys/arch/evbmips/conf/INSTALL_MALTA32
sys/arch/evbmips/conf/LOONGSON
sys/arch/evbmips/evbmips/interrupt.c
sys/arch/evbmips/gdium/gdium_intr.c
sys/arch/evbmips/gdium/machdep.c
sys/arch/evbmips/gdium/mainbus.c
sys/arch/evbmips/include/intr.h
sys/arch/evbmips/ingenic/clock.c
sys/arch/evbmips/ingenic/cpu.c
sys/arch/evbmips/ingenic/intr.c
sys/arch/evbmips/ingenic/machdep.c
sys/arch/evbmips/loongson/loongson_intr.c
sys/arch/evbmips/loongson/mainbus.c
sys/arch/evbmips/loongson/yeeloong_machdep.c
sys/arch/evbmips/malta/dev/mainbus.c
sys/arch/evbmips/malta/machdep.c
sys/arch/evbmips/malta/malta_intr.c
sys/arch/evbppc/conf/Makefile.ev64260.inc
sys/arch/evbppc/conf/Makefile.obs405.inc
sys/arch/evbppc/conf/Makefile.walnut.inc
sys/arch/evbsh3/include/Makefile
sys/arch/evbsh3/include/fenv.h
sys/arch/evbsh3/stand/mesboot/src/mesboot.c
sys/arch/ews4800mips/conf/RAMDISK
sys/arch/ews4800mips/stand/Makefile.bootxx
sys/arch/ews4800mips/stand/Makefile.inc
sys/arch/ews4800mips/stand/boot/Makefile
sys/arch/hpcmips/conf/std.hpcmips.vr41
sys/arch/hpcmips/conf/std.lcard
sys/arch/hpcmips/hpcmips/bus_space.c
sys/arch/hpcmips/tx/tx3912video.c
sys/arch/hpcsh/include/Makefile
sys/arch/hpcsh/include/fenv.h
sys/arch/i386/acpi/acpi_wakecode.S
sys/arch/i386/acpi/acpi_wakeup_low.S
sys/arch/i386/conf/ALL
sys/arch/i386/conf/GENERIC
sys/arch/i386/conf/MODULAR
sys/arch/i386/conf/XEN3_DOM0
sys/arch/i386/conf/kern.ldscript.Xen
sys/arch/i386/i386/copy.S
sys/arch/i386/i386/gdt.c
sys/arch/i386/i386/locore.S
sys/arch/i386/i386/machdep.c
sys/arch/i386/i386/trap.c
sys/arch/i386/i386/vector.S
sys/arch/i386/include/gdt.h
sys/arch/i386/include/param.h
sys/arch/i386/include/pmap.h
sys/arch/i386/include/segments.h
sys/arch/i386/include/vmparam.h
sys/arch/i386/isa/ahc_isa.c
sys/arch/i386/pci/gcscide.c
sys/arch/i386/pci/geodewdg.c
sys/arch/i386/pci/glxsb.c
sys/arch/i386/pci/piixpcib.c
sys/arch/i386/pnpbios/fdc_pnpbios.c
sys/arch/i386/pnpbios/lpt_pnpbios.c
sys/arch/i386/pnpbios/sb_pnpbios.c
sys/arch/i386/pnpbios/wss_pnpbios.c
sys/arch/i386/pnpbios/ym_pnpbios.c
sys/arch/ia64/conf/files.ia64
sys/arch/ia64/disasm/disasm.h
sys/arch/ia64/disasm/disasm_decode.c
sys/arch/ia64/disasm/disasm_extract.c
sys/arch/ia64/disasm/disasm_format.c
sys/arch/ia64/disasm/disasm_int.h
sys/arch/ia64/ia64/context.S
sys/arch/ia64/ia64/core_machdep.c
sys/arch/ia64/ia64/db_trace.c
sys/arch/ia64/ia64/procfs_machdep.c
sys/arch/ia64/ia64/support.S
sys/arch/ia64/ia64/vm_machdep.c
sys/arch/ia64/include/Makefile
sys/arch/ia64/include/acpi_func.h
sys/arch/ia64/include/atomic.h
sys/arch/ia64/include/bus.h
sys/arch/ia64/include/efilib.h
sys/arch/ia64/include/elf_machdep.h
sys/arch/ia64/include/ia64_cpu.h
sys/arch/ia64/include/lock.h
sys/arch/ia64/include/mcontext.h
sys/arch/ia64/include/pci_machdep.h
sys/arch/ia64/include/pte.h
sys/arch/ia64/include/vmparam.h
sys/arch/ia64/pci/pci_machdep.c
sys/arch/ia64/stand/common/Makefile.inc
sys/arch/ia64/stand/common/dev_net.c
sys/arch/ia64/stand/common/dev_net.h
sys/arch/ia64/stand/common/load_elf64.c
sys/arch/ia64/stand/efi/include/README
sys/arch/ia64/stand/efi/include/efi.h
sys/arch/ia64/stand/efi/include/efi_nii.h
sys/arch/ia64/stand/efi/include/efiapi.h
sys/arch/ia64/stand/efi/include/eficon.h
sys/arch/ia64/stand/efi/include/efidebug.h
sys/arch/ia64/stand/efi/include/efidef.h
sys/arch/ia64/stand/efi/include/efidevp.h
sys/arch/ia64/stand/efi/include/efierr.h
sys/arch/ia64/stand/efi/include/efifpswa.h
sys/arch/ia64/stand/efi/include/efifs.h
sys/arch/ia64/stand/efi/include/efilib.h
sys/arch/ia64/stand/efi/include/efinet.h
sys/arch/ia64/stand/efi/include/efipart.h
sys/arch/ia64/stand/efi/include/efiprot.h
sys/arch/ia64/stand/efi/include/efipxebc.h
sys/arch/ia64/stand/efi/include/efiser.h
sys/arch/ia64/stand/efi/include/efistdarg.h
sys/arch/ia64/stand/efi/include/ia64/efibind.h
sys/arch/ia64/stand/efi/include/ia64/pe.h
sys/arch/ia64/stand/efi/libefi/Makefile
sys/arch/ia64/stand/efi/libefi/bootinfo.c
sys/arch/ia64/stand/efi/libefi/copy.c
sys/arch/ia64/stand/efi/libefi/devicename.c
sys/arch/ia64/stand/efi/libefi/efi.c
sys/arch/ia64/stand/efi/libefi/efiboot.h
sys/arch/ia64/stand/efi/libefi/efifpswa.c
sys/arch/ia64/stand/efi/libefi/efinet.c
sys/arch/ia64/stand/efi/libefi/exec.c
sys/arch/ia64/stand/efi/libefi/time.c
sys/arch/ia64/stand/ia64/Makefile.booters
sys/arch/ia64/stand/ia64/efi/Makefile
sys/arch/ia64/stand/ia64/efi/conf.c
sys/arch/ia64/stand/ia64/efi/main.c
sys/arch/ia64/stand/ia64/ski/Makefile
sys/arch/ia64/stand/ia64/ski/conf.c
sys/arch/ia64/stand/ia64/ski/devicename.c
sys/arch/ia64/stand/ia64/ski/time.c
sys/arch/ia64/unwind/stackframe.c
sys/arch/ia64/unwind/stackframe.h
sys/arch/landisk/conf/GENERIC
sys/arch/landisk/include/Makefile
sys/arch/landisk/include/fenv.h
sys/arch/landisk/stand/Makefile.inc
sys/arch/landisk/stand/mbr/Makefile.mbr
sys/arch/luna68k/conf/INSTALL
sys/arch/m68k/fpe/fpu_cordic.c
sys/arch/m68k/fpe/fpu_emulate.h
sys/arch/m68k/fpe/fpu_trig.c
sys/arch/mac68k/dev/if_mc.c
sys/arch/macppc/dev/am79c950.c
sys/arch/macppc/dev/awacs.c
sys/arch/macppc/dev/dbdma.c
sys/arch/macppc/dev/dbdma.h
sys/arch/macppc/dev/esp.c
sys/arch/macppc/dev/if_bm.c
sys/arch/macppc/dev/if_mc.c
sys/arch/macppc/dev/kauai.c
sys/arch/macppc/dev/mesh.c
sys/arch/macppc/dev/platinumfb.c
sys/arch/macppc/dev/snapper.c
sys/arch/macppc/dev/wdc_obio.c
sys/arch/mips/adm5120/adm5120_intr.c
sys/arch/mips/atheros/dev/argpio.c
sys/arch/mips/atheros/dev/ehci_arbus.c
sys/arch/mips/cavium/dev/if_cnmac.c
sys/arch/mips/cavium/dev/octeon_ciureg.h
sys/arch/mips/cavium/dev/octeon_dwctwo.c
sys/arch/mips/cavium/dev/octeon_powvar.h
sys/arch/mips/cavium/octeon_cpunode.c
sys/arch/mips/cavium/octeon_dma.c
sys/arch/mips/cavium/octeon_intr.c
sys/arch/mips/cavium/octeonvar.h
sys/arch/mips/conf/files.mips
sys/arch/mips/include/asm.h
sys/arch/mips/include/bus_dma_defs.h
sys/arch/mips/include/bus_space_defs.h
sys/arch/mips/include/cache.h
sys/arch/mips/include/cache_ls2.h
sys/arch/mips/include/cache_mipsNN.h
sys/arch/mips/include/cache_octeon.h
sys/arch/mips/include/cache_r10k.h
sys/arch/mips/include/cache_r3k.h
sys/arch/mips/include/cache_r4k.h
sys/arch/mips/include/cache_r5900.h
sys/arch/mips/include/cache_r5k.h
sys/arch/mips/include/cache_tx39.h
sys/arch/mips/include/cpu.h
sys/arch/mips/include/cpu_counter.h
sys/arch/mips/include/cpuregs.h
sys/arch/mips/include/ecoff_machdep.h
sys/arch/mips/include/locore.h
sys/arch/mips/include/mips3_pte.h
sys/arch/mips/include/mipsNN.h
sys/arch/mips/include/mips_param.h
sys/arch/mips/include/pmap.h
sys/arch/mips/include/psl.h
sys/arch/mips/include/pte.h
sys/arch/mips/include/types.h
sys/arch/mips/include/vmparam.h
sys/arch/mips/ingenic/ingenic_regs.h
sys/arch/mips/mips/bus_dma.c
sys/arch/mips/mips/bus_space_alignstride_chipdep.c
sys/arch/mips/mips/cache.c
sys/arch/mips/mips/cache_ls2.c
sys/arch/mips/mips/cache_mipsNN.c
sys/arch/mips/mips/cache_octeon.c
sys/arch/mips/mips/cache_r10k.c
sys/arch/mips/mips/cache_r3k.c
sys/arch/mips/mips/cache_r4k.c
sys/arch/mips/mips/cache_r4k_pcache128.S
sys/arch/mips/mips/cache_r4k_pcache16.S
sys/arch/mips/mips/cache_r4k_pcache32.S
sys/arch/mips/mips/cache_r4k_pcache64.S
sys/arch/mips/mips/cache_r4k_scache128.S
sys/arch/mips/mips/cache_r4k_scache16.S
sys/arch/mips/mips/cache_r4k_scache32.S
sys/arch/mips/mips/cache_r4k_scache64.S
sys/arch/mips/mips/cache_r4k_subr.S
sys/arch/mips/mips/cache_r5k.c
sys/arch/mips/mips/cache_tx39.c
sys/arch/mips/mips/cpu_subr.c
sys/arch/mips/mips/db_interface.c
sys/arch/mips/mips/genassym.cf
sys/arch/mips/mips/kgdb_machdep.c
sys/arch/mips/mips/lock_stubs_llsc.S
sys/arch/mips/mips/lock_stubs_ras.S
sys/arch/mips/mips/locore.S
sys/arch/mips/mips/locore_mips1.S
sys/arch/mips/mips/locore_mips3.S
sys/arch/mips/mips/locore_octeon.S
sys/arch/mips/mips/mipsX_subr.S
sys/arch/mips/mips/mips_fixup.c
sys/arch/mips/mips/mips_machdep.c
sys/arch/mips/mips/pmap.c
sys/arch/mips/mips/pmap_machdep.c
sys/arch/mips/mips/pmap_segtab.c
sys/arch/mips/mips/pmap_tlb.c
sys/arch/mips/mips/sigcode.S
sys/arch/mips/mips/spl.S
sys/arch/mips/mips/syscall.c
sys/arch/mips/mips/trap.c
sys/arch/mips/mips/vm_machdep.c
sys/arch/mips/mips/wired_map.c
sys/arch/mips/ralink/ralink_intr.c
sys/arch/mips/rmi/rmixl_intr.c
sys/arch/mips/sibyte/dev/sbbuswatch.c
sys/arch/mips/sibyte/dev/sbmac.c
sys/arch/mips/sibyte/dev/sbobio.c
sys/arch/mips/sibyte/dev/sbscn.c
sys/arch/mips/sibyte/dev/sbtimer.c
sys/arch/mips/sibyte/dev/sbwdog.c
sys/arch/mips/sibyte/pci/sbbrz.c
sys/arch/mips/sibyte/pci/sbbrz_pci.c
sys/arch/mipsco/stand/Makefile.booters
sys/arch/mipsco/stand/Makefile.inc
sys/arch/mmeye/conf/MMTAICE
sys/arch/mmeye/include/Makefile
sys/arch/mmeye/include/fenv.h
sys/arch/mmeye/stand/Makefile.inc
sys/arch/newsmips/apbus/xafb.c
sys/arch/newsmips/dev/scsi_1185.c
sys/arch/newsmips/dev/zs_hb.c
sys/arch/newsmips/include/intr.h
sys/arch/newsmips/newsmips/machdep.c
sys/arch/newsmips/newsmips/news5000.c
sys/arch/newsmips/stand/Makefile.inc
sys/arch/playstation2/dev/ohci_sbus.c
sys/arch/playstation2/dev/sbus.c
sys/arch/playstation2/dev/spd.c
sys/arch/playstation2/ee/sif.c
sys/arch/playstation2/playstation2/cpu.c
sys/arch/playstation2/playstation2/interrupt.c
sys/arch/playstation2/playstation2/mainbus.c
sys/arch/playstation2/playstation2/sifbios.h
sys/arch/pmax/conf/GENERIC
sys/arch/pmax/stand/Makefile.booters
sys/arch/powerpc/booke/booke_machdep.c
sys/arch/powerpc/booke/booke_pmap.c
sys/arch/powerpc/booke/booke_stubs.c
sys/arch/powerpc/booke/dev/pq3etsec.c
sys/arch/powerpc/booke/e500_tlb.c
sys/arch/powerpc/include/booke/pmap.h
sys/arch/powerpc/include/booke/pte.h
sys/arch/riscv/conf/GENERIC
sys/arch/sandpoint/stand/Makefile.inc
sys/arch/sbmips/sbmips/cpu.c
sys/arch/sbmips/sbmips/rtc.c
sys/arch/sbmips/sbmips/sb1250_icu.c
sys/arch/sbmips/stand/Makefile.bootxx
sys/arch/sgimips/gio/gio.c
sys/arch/sgimips/hpc/hpc.c
sys/arch/sgimips/mace/mace.c
sys/arch/sgimips/mace/pci_mace.c
sys/arch/sgimips/sgimips/bus.c
sys/arch/sgimips/stand/Makefile.booters
sys/arch/sgimips/stand/Makefile.inc
sys/arch/sgimips/stand/boot64/Makefile
sys/arch/sh3/include/Makefile
sys/arch/sh3/include/fenv.h
sys/arch/sh3/include/fpreg.h
sys/arch/sh3/include/ieeefp.h
sys/arch/sh3/include/pmap.h
sys/arch/sh3/include/vmparam.h
sys/arch/sh3/sh3/pmap.c
sys/arch/shark/isa/isa_io.c
sys/arch/sparc/dev/cgfourteen.c
sys/arch/sparc/sparc/emul.c
sys/arch/sparc/stand/Makefile.buildboot
sys/arch/sparc/stand/Makefile.inc
sys/arch/sparc/stand/bootblk/Makefile
sys/arch/sparc/stand/ofwboot/Makefile
sys/arch/sparc/stand/ofwboot/boot.c
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c
sys/arch/sparc64/conf/GENERIC
sys/arch/sparc64/conf/files.sparc64
sys/arch/sparc64/dev/cbus.c
sys/arch/sparc64/dev/iommureg.h
sys/arch/sparc64/dev/ldc.c
sys/arch/sparc64/dev/ldcvar.h
sys/arch/sparc64/dev/vdsk.c
sys/arch/sparc64/dev/viovar.h
sys/arch/sparc64/doc/TODO
sys/arch/sparc64/include/ptrace.h
sys/arch/sparc64/sparc64/autoconf.c
sys/arch/sparc64/sparc64/copy.S
sys/arch/sparc64/sparc64/kobj_machdep.c
sys/arch/sparc64/sparc64/locore.s
sys/arch/sun68k/stand/Makefile.inc
sys/arch/x68k/conf/INSTALL
sys/arch/x68k/dev/zs.c
sys/arch/x68k/stand/Makefile.booters
sys/arch/x68k/stand/boot/boot.c
sys/arch/x86/acpi/acpi_machdep.c
sys/arch/x86/acpi/acpi_wakeup.c
sys/arch/x86/include/autoconf.h
sys/arch/x86/include/cpu_extended_state.h
sys/arch/x86/include/machdep.h
sys/arch/x86/include/pci_machdep_common.h
sys/arch/x86/include/pmap.h
sys/arch/x86/include/specialreg.h
sys/arch/x86/pci/ichlpcib.c
sys/arch/x86/pci/pchb.c
sys/arch/x86/pci/pci_intr_machdep.c
sys/arch/x86/pci/pci_machdep.c
sys/arch/x86/pci/tcpcib.c
sys/arch/x86/x86/efi.c
sys/arch/x86/x86/fpu.c
sys/arch/x86/x86/idt.c
sys/arch/x86/x86/intr.c
sys/arch/x86/x86/lapic.c
sys/arch/x86/x86/pmap.c
sys/arch/x86/x86/procfs_machdep.c
sys/arch/x86/x86/sys_machdep.c
sys/arch/x86/x86/vmt.c
sys/arch/x86/x86/x86_autoconf.c
sys/arch/x86/x86/x86_machdep.c
sys/arch/x86/x86/x86_stub.c
sys/arch/xen/conf/std.xen
sys/arch/xen/x86/x86_xpmap.c
sys/arch/xen/xen/hypervisor.c
sys/arch/zaurus/conf/INSTALL
sys/arch/zaurus/conf/INSTALL_C700
sys/coda/coda_vnops.c
sys/compat/common/Makefile
sys/compat/common/if_43.c
sys/compat/common/rtsock_70.c
sys/compat/common/uipc_syscalls_40.c
sys/compat/common/uipc_syscalls_43.c
sys/compat/common/vfs_syscalls_43.c
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_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_syscall.h
sys/compat/linux/arch/arm/linux_syscallargs.h
sys/compat/linux/arch/arm/linux_syscalls.c
sys/compat/linux/arch/arm/linux_sysent.c
sys/compat/linux/arch/arm/linux_systrace_args.c
sys/compat/linux/arch/arm/syscalls.master
sys/compat/linux/arch/i386/linux_machdep.c
sys/compat/linux/arch/i386/linux_syscall.h
sys/compat/linux/arch/i386/linux_syscallargs.h
sys/compat/linux/arch/i386/linux_syscalls.c
sys/compat/linux/arch/i386/linux_sysent.c
sys/compat/linux/arch/i386/linux_systrace_args.c
sys/compat/linux/arch/i386/syscalls.master
sys/compat/linux/arch/m68k/linux_syscall.h
sys/compat/linux/arch/m68k/linux_syscallargs.h
sys/compat/linux/arch/m68k/linux_syscalls.c
sys/compat/linux/arch/m68k/linux_sysent.c
sys/compat/linux/arch/m68k/syscalls.master
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_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_futex.c
sys/compat/linux/common/linux_misc.c
sys/compat/linux/common/linux_misc.h
sys/compat/linux/common/linux_socket.c
sys/compat/linux32/arch/amd64/linux32_machdep.c
sys/compat/linux32/common/linux32_exec_elf32.c
sys/compat/linux32/common/linux32_socket.c
sys/compat/net/if.h
sys/compat/net/route.h
sys/compat/netbsd32/netbsd32.h
sys/compat/netbsd32/netbsd32_compat_43.c
sys/compat/netbsd32/netbsd32_exec_aout.c
sys/compat/netbsd32/netbsd32_exec_elf32.c
sys/compat/netbsd32/netbsd32_ioctl.c
sys/compat/netbsd32/netbsd32_ioctl.h
sys/compat/netbsd32/netbsd32_netbsd.c
sys/compat/netbsd32/netbsd32_signal.c
sys/compat/netbsd32/netbsd32_socket.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/netbsd32_wait.c
sys/compat/netbsd32/syscalls.master
sys/compat/osf1/osf1_socket.c
sys/compat/svr4/svr4_sockio.c
sys/compat/svr4/svr4_stream.c
sys/compat/sys/stat.h
sys/conf/files
sys/conf/majors
sys/dev/DEVNAMES
sys/dev/acpi/acpi_mcfg.c
sys/dev/acpi/com_acpi.c
sys/dev/acpi/sdhc_acpi.c
sys/dev/acpi/vald_acpi.c
sys/dev/acpi/wss_acpi.c
sys/dev/acpi/ym_acpi.c
sys/dev/ata/ata_raid.c
sys/dev/ata/ld_ataraid.c
sys/dev/ata/wd.c
sys/dev/ata/wdvar.h
sys/dev/audio.c
sys/dev/bluetooth/bcsp.c
sys/dev/cardbus/adv_cardbus.c
sys/dev/cardbus/ahc_cardbus.c
sys/dev/cardbus/cardslot.c
sys/dev/cardbus/ehci_cardbus.c
sys/dev/cardbus/fwohci_cardbus.c
sys/dev/cardbus/if_ral_cardbus.c
sys/dev/cardbus/if_tlp_cardbus.c
sys/dev/cardbus/njs_cardbus.c
sys/dev/cardbus/ohci_cardbus.c
sys/dev/cardbus/uhci_cardbus.c
sys/dev/ccd.c
sys/dev/cgd.c
sys/dev/clock_subr.c
sys/dev/dec/lk201_ws.c
sys/dev/dksubr.c
sys/dev/dm/device-mapper.c
sys/dev/eisa/ahb.c
sys/dev/eisa/ahc_eisa.c
sys/dev/eisa/cac_eisa.c
sys/dev/eisa/dpt_eisa.c
sys/dev/eisa/eisa.c
sys/dev/eisa/if_fea.c
sys/dev/eisa/if_tlp_eisa.c
sys/dev/eisa/mlx_eisa.c
sys/dev/eisa/uha_eisa.c
sys/dev/fss.c
sys/dev/gpib/cs80bus.c
sys/dev/gpib/ct.c
sys/dev/gpib/gpib.c
sys/dev/gpib/mt.c
sys/dev/gpib/rd.c
sys/dev/gpio/gpiopwm.c
sys/dev/gpio/gpiosim.c
sys/dev/hpc/btnmgr.c
sys/dev/i2c/as3722.c
sys/dev/i2c/at24cxx.c
sys/dev/i2c/dbcool.c
sys/dev/i2c/i2c.c
sys/dev/i2c/ibmhawk.c
sys/dev/i2c/sdtemp.c
sys/dev/i2c/sdtemp_reg.h
sys/dev/i2c/spdmem_i2c.c
sys/dev/i2c/titemp.c
sys/dev/i2o/ld_iop.c
sys/dev/ic/aac.c
sys/dev/ic/aacvar.h
sys/dev/ic/adv.c
sys/dev/ic/adw.c
sys/dev/ic/aha.c
sys/dev/ic/aic79xx_osm.c
sys/dev/ic/atppcreg.h
sys/dev/ic/bha.c
sys/dev/ic/cac.c
sys/dev/ic/cacvar.h
sys/dev/ic/ciss.c
sys/dev/ic/ct65550.c
sys/dev/ic/elink3.c
sys/dev/ic/hme.c
sys/dev/ic/i82586.c
sys/dev/ic/igsfb.c
sys/dev/ic/interwave.c
sys/dev/ic/lance.c
sys/dev/ic/ld_aac.c
sys/dev/ic/ld_cac.c
sys/dev/ic/ld_icp.c
sys/dev/ic/ld_mlx.c
sys/dev/ic/ld_nvme.c
sys/dev/ic/mlx.c
sys/dev/ic/mlxvar.h
sys/dev/ic/mtd803.c
sys/dev/ic/nvme.c
sys/dev/ic/nvmereg.h
sys/dev/ic/nvmevar.h
sys/dev/ic/opl.c
sys/dev/ic/pckbc.c
sys/dev/ic/rrunner.c
sys/dev/ic/rt2860.c
sys/dev/ic/rt2860reg.h
sys/dev/ic/rtw.c
sys/dev/ic/rtwreg.h
sys/dev/ic/rtwvar.h
sys/dev/ic/siisata.c
sys/dev/ic/sl811hs.c
sys/dev/ic/sl811hsreg.h
sys/dev/ic/spdmem.c
sys/dev/ic/spdmemvar.h
sys/dev/ic/tropic.c
sys/dev/ic/tulip.c
sys/dev/ic/uha.c
sys/dev/ic/wdc.c
sys/dev/if_ndis/if_ndis.c
sys/dev/if_ndis/if_ndis_pccard.c
sys/dev/ir/cir.c
sys/dev/isa/addcom_isa.c
sys/dev/isa/ast.c
sys/dev/isa/bha_isa.c
sys/dev/isa/boca.c
sys/dev/isa/cec.c
sys/dev/isa/dpt_isa.c
sys/dev/isa/ess.c
sys/dev/isa/gus.c
sys/dev/isa/i82365_isa.c
sys/dev/isa/if_eg.c
sys/dev/isa/if_ep_isa.c
sys/dev/isa/if_ix.c
sys/dev/isa/if_iy.c
sys/dev/isa/if_lc_isa.c
sys/dev/isa/if_ntwoc_isa.c
sys/dev/isa/if_tr_isa.c
sys/dev/isa/ioat66.c
sys/dev/isa/isic_isa.c
sys/dev/isa/mcd.c
sys/dev/isa/moxa_isa.c
sys/dev/isa/mpu_isa.c
sys/dev/isa/pcdisplay.c
sys/dev/isa/rtfps.c
sys/dev/isa/sbdsp.c
sys/dev/isa/seagate.c
sys/dev/isa/slhci_isa.c
sys/dev/isa/soekrisgpio.c
sys/dev/isa/spkr.c
sys/dev/isa/tcic2_isa.c
sys/dev/isa/tcom.c
sys/dev/isa/wds.c
sys/dev/isa/wt.c
sys/dev/isapnp/aha_isapnp.c
sys/dev/isapnp/gus_isapnp.c
sys/dev/isapnp/i82365_isapnp.c
sys/dev/isapnp/if_an_isapnp.c
sys/dev/isapnp/if_cs_isapnp.c
sys/dev/isapnp/if_ep_isapnp.c
sys/dev/isapnp/if_tr_isapnp.c
sys/dev/isapnp/isic_isapnp.c
sys/dev/kttcp.c
sys/dev/ld.c
sys/dev/ldvar.h
sys/dev/mca/ed_mca.c
sys/dev/mca/edc_mca.c
sys/dev/mca/esp_mca.c
sys/dev/mca/if_elmc_mca.c
sys/dev/mca/if_ep_mca.c
sys/dev/mca/if_tr_mca.c
sys/dev/mca/if_tra_mca.c
sys/dev/mca/mca.c
sys/dev/md.c
sys/dev/microcode/aic7xxx/aicasm.c
sys/dev/microcode/ral/microcode.h
sys/dev/microcode/ral/ral-license
sys/dev/microcode/ral/ral-rt2860
sys/dev/microcode/ral/ral-rt2870
sys/dev/microcode/ral/ral-rt3070
sys/dev/microcode/ral/ral-rt3071
sys/dev/microcode/ral/ral-rt3090
sys/dev/microcode/ral/ral-rt3290
sys/dev/microcode/ral/ral-rt73
sys/dev/midi.c
sys/dev/mii/inbmphyreg.h
sys/dev/mm.c
sys/dev/mm.h
sys/dev/ofw/ofnet.c
sys/dev/pci/aac_pci.c
sys/dev/pci/ahc_pci.c
sys/dev/pci/ahcisata_pci.c
sys/dev/pci/amr.c
sys/dev/pci/bktr/bktr_os.c
sys/dev/pci/cac_pci.c
sys/dev/pci/ciss_pci.c
sys/dev/pci/cmpci.c
sys/dev/pci/cxgb/cxgb_mvec.h
sys/dev/pci/gffb.c
sys/dev/pci/gtp.c
sys/dev/pci/hdaudio_pci.c
sys/dev/pci/iavc_pci.c
sys/dev/pci/ibmcd.c
sys/dev/pci/icp_pci.c
sys/dev/pci/if_atw_pci.c
sys/dev/pci/if_bge.c
sys/dev/pci/if_iwi.c
sys/dev/pci/if_iwm.c
sys/dev/pci/if_iwn.c
sys/dev/pci/if_ntwoc_pci.c
sys/dev/pci/if_sip.c
sys/dev/pci/if_ti.c
sys/dev/pci/if_txp.c
sys/dev/pci/if_vioif.c
sys/dev/pci/if_vr.c
sys/dev/pci/if_vte.c
sys/dev/pci/if_wi_pci.c
sys/dev/pci/if_wm.c
sys/dev/pci/if_xge.c
sys/dev/pci/igsfb_pci.c
sys/dev/pci/iop_pci.c
sys/dev/pci/isic_pci.c
sys/dev/pci/ismt.c
sys/dev/pci/isp_pci.c
sys/dev/pci/iwic_pci.c
sys/dev/pci/ixgbe/ixgbe.c
sys/dev/pci/ixpide.c
sys/dev/pci/jmide.c
sys/dev/pci/ld_amr.c
sys/dev/pci/ld_twa.c
sys/dev/pci/ld_twe.c
sys/dev/pci/ld_virtio.c
sys/dev/pci/lynxfb.c
sys/dev/pci/machfb.c
sys/dev/pci/mfi_pci.c
sys/dev/pci/mlx_pci.c
sys/dev/pci/mpt_pci.c
sys/dev/pci/njs_pci.c
sys/dev/pci/nvme_pci.c
sys/dev/pci/pci_stub.c
sys/dev/pci/pci_subr.c
sys/dev/pci/pci_usrreq.c
sys/dev/pci/pcidevs
sys/dev/pci/pcidevs.h
sys/dev/pci/pcidevs_data.h
sys/dev/pci/pciio.h
sys/dev/pci/pcireg.h
sys/dev/pci/pcivar.h
sys/dev/pci/piixpm.c
sys/dev/pci/pwdog.c
sys/dev/pci/satalink.c
sys/dev/pci/siisata_pci.c
sys/dev/pci/sv.c
sys/dev/pci/twa.c
sys/dev/pci/twe.c
sys/dev/pci/viomb.c
sys/dev/pci/virtio.c
sys/dev/pci/virtiovar.h
sys/dev/pci/voodoofb.c
sys/dev/pci/voyager/pwmclock.c
sys/dev/pci/wcfb.c
sys/dev/pci/yds.c
sys/dev/pcmcia/if_awi_pcmcia.c
sys/dev/pcmcia/if_cnw.c
sys/dev/pcmcia/if_tr_pcmcia.c
sys/dev/pcmcia/if_xi.c
sys/dev/pcmcia/isic_pcmcia.c
sys/dev/qbus/if_dmc.c
sys/dev/raidframe/rf_netbsdkintf.c
sys/dev/sbus/be.c
sys/dev/sbus/qe.c
sys/dev/sbus/tcx.c
sys/dev/scsipi/if_se.c
sys/dev/scsipi/scsipi_base.c
sys/dev/scsipi/scsipi_verbose.c
sys/dev/scsipi/ses.c
sys/dev/scsipi/st.c
sys/dev/scsipi/st_atapi.c
sys/dev/scsipi/uk.c
sys/dev/sdmmc/ld_sdmmc.c
sys/dev/sdmmc/sbt.c
sys/dev/sdmmc/sdhc.c
sys/dev/sdmmc/sdmmc_mem.c
sys/dev/sdmmc/sdmmcreg.h
sys/dev/spi/spiflash.c
sys/dev/tc/files.tc
sys/dev/tc/slhci_tcu.c
sys/dev/tc/tc.c
sys/dev/tc/tcdevs
sys/dev/tc/tcu.c
sys/dev/usb/ehci.c
sys/dev/usb/if_athn_usb.c
sys/dev/usb/if_axe.c
sys/dev/usb/if_run.c
sys/dev/usb/if_runvar.h
sys/dev/usb/if_urndis.c
sys/dev/usb/if_urtw.c
sys/dev/usb/ohci.c
sys/dev/usb/uark.c
sys/dev/usb/ubt.c
sys/dev/usb/ucom.c
sys/dev/usb/uhub.c
sys/dev/usb/usb.h
sys/dev/usb/usb_subr.c
sys/dev/usb/usbdevices.config
sys/dev/usb/usbdevs
sys/dev/usb/usbdevs.h
sys/dev/usb/usbdevs_data.h
sys/dev/usb/uscanner.c
sys/dev/usb/uthum.c
sys/dev/usb/utoppy.c
sys/dev/usb/uyap.c
sys/dev/usb/xhci.c
sys/dev/usb/xhcireg.h
sys/dev/vnd.c
sys/dist/pf/net/pf_if.c
sys/external/bsd/acpica/dist/changes.txt
sys/external/bsd/acpica/dist/compiler/asloptions.c
sys/external/bsd/acpica/dist/debugger/dbobject.c
sys/external/bsd/acpica/dist/disassembler/dmopcode.c
sys/external/bsd/acpica/dist/disassembler/dmwalk.c
sys/external/bsd/acpica/dist/dispatcher/dsutils.c
sys/external/bsd/acpica/dist/executer/exfldio.c
sys/external/bsd/acpica/dist/hardware/hwregs.c
sys/external/bsd/acpica/dist/include/acglobal.h
sys/external/bsd/acpica/dist/include/acmacros.h
sys/external/bsd/acpica/dist/include/acoutput.h
sys/external/bsd/acpica/dist/include/acpixf.h
sys/external/bsd/acpica/dist/include/acutils.h
sys/external/bsd/acpica/dist/include/platform/aclinux.h
sys/external/bsd/acpica/dist/namespace/nsaccess.c
sys/external/bsd/acpica/dist/namespace/nsdump.c
sys/external/bsd/acpica/dist/os_specific/service_layers/osbsdtbl.c
sys/external/bsd/acpica/dist/tools/acpisrc/asfile.c
sys/external/bsd/acpica/dist/tools/acpisrc/asremove.c
sys/external/bsd/acpica/dist/utilities/utdebug.c
sys/external/bsd/acpica/dist/utilities/utdecode.c
sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
sys/external/bsd/gnu-efi/dist/inc/efiapi.h
sys/external/bsd/gnu-efi/dist/inc/efifpswa.h
sys/external/bsd/ipf/netinet/fil.c
sys/external/bsd/ipf/netinet/ip_compat.h
sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
sys/fs/adosfs/advnops.c
sys/fs/cd9660/cd9660_node.c
sys/fs/efs/efs_vnops.c
sys/fs/filecorefs/filecore_node.c
sys/fs/hfs/hfs_vnops.c
sys/fs/msdosfs/msdosfs_denode.c
sys/fs/nfs/files.newnfs
sys/fs/nilfs/nilfs_vnops.c
sys/fs/ntfs/ntfs_vnops.c
sys/fs/ptyfs/ptyfs_vnops.c
sys/fs/puffs/puffs_node.c
sys/fs/puffs/puffs_vnops.c
sys/fs/smbfs/smbfs_node.c
sys/fs/sysvbfs/sysvbfs_vnops.c
sys/fs/tmpfs/tmpfs_mem.c
sys/fs/tmpfs/tmpfs_vfsops.c
sys/fs/tmpfs/tmpfs_vnops.c
sys/fs/udf/udf_vnops.c
sys/fs/union/union_subr.c
sys/fs/v7fs/v7fs_vnops.c
sys/gdbscripts/kdump
sys/kern/core_elf32.c
sys/kern/exec_elf.c
sys/kern/files.kern
sys/kern/init_main.c
sys/kern/kern_event.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_ktrace.c
sys/kern/kern_module.c
sys/kern/kern_pax.c
sys/kern/kern_proc.c
sys/kern/kern_resource.c
sys/kern/kern_sig.c
sys/kern/subr_autoconf.c
sys/kern/subr_kobj.c
sys/kern/subr_kobj_vfs.c
sys/kern/subr_prf.c
sys/kern/sys_process.c
sys/kern/sys_sched.c
sys/kern/sys_sig.c
sys/kern/sysv_msg.c
sys/kern/tty.c
sys/kern/uipc_mbuf.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/kern/uipc_syscalls.c
sys/kern/vfs_bio.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnode.c
sys/kern/vfs_wapbl.c
sys/lib/libkern/arch/ia64/Makefile.inc
sys/lib/libkern/arch/ia64/memcpy.S
sys/lib/libkern/crc16.h
sys/lib/libsa/checkpasswd.c
sys/lib/libsa/ext2fs.c
sys/lib/libsa/gets.c
sys/lib/libsa/loadfile_elf32.c
sys/lib/libsa/stand.h
sys/miscfs/fdesc/fdesc_vnops.c
sys/miscfs/genfs/genfs_io.c
sys/miscfs/genfs/layer_vnops.c
sys/miscfs/kernfs/kernfs_vnops.c
sys/miscfs/procfs/procfs_vnops.c
sys/miscfs/specfs/spec_vnops.c
sys/modules/Makefile
sys/modules/aac/Makefile
sys/modules/aac/aac.ioconf
sys/modules/amr/Makefile
sys/modules/amr/amr.ioconf
sys/modules/ataraid/Makefile
sys/modules/ataraid/ataraid.ioconf
sys/modules/cac/Makefile
sys/modules/cac/cac.ioconf
sys/modules/cac_eisa/Makefile
sys/modules/cac_eisa/cac_eisa.ioconf
sys/modules/cac_pci/Makefile
sys/modules/cac_pci/cac_pci.ioconf
sys/modules/compat_netbsd32/Makefile
sys/modules/dtrace/fbt/Makefile
sys/modules/ext2fs/Makefile
sys/modules/if_agr/Makefile
sys/modules/if_agr/agr.ioconf
sys/modules/if_faith/Makefile
sys/modules/if_faith/faith.ioconf
sys/modules/if_gif/Makefile
sys/modules/if_gif/gif.ioconf
sys/modules/if_gre/Makefile
sys/modules/if_gre/gre.ioconf
sys/modules/if_loop/Makefile
sys/modules/if_loop/loop.ioconf
sys/modules/if_mpls/Makefile
sys/modules/if_mpls/mpls.ioconf
sys/modules/if_ppp/Makefile
sys/modules/if_ppp/ppp.ioconf
sys/modules/if_pppoe/Makefile
sys/modules/if_pppoe/pppoe.ioconf
sys/modules/if_sl/Makefile
sys/modules/if_sl/sl.ioconf
sys/modules/if_srt/Makefile
sys/modules/if_srt/srt.ioconf
sys/modules/if_stf/Makefile
sys/modules/if_stf/stf.ioconf
sys/modules/if_strip/Makefile
sys/modules/if_strip/strip.ioconf
sys/modules/if_tun/Makefile
sys/modules/if_tun/tun.ioconf
sys/modules/if_vioif/Makefile
sys/modules/if_vioif/if_vioif.ioconf
sys/modules/if_vlan/Makefile
sys/modules/if_vlan/vlan.ioconf
sys/modules/ld/Makefile
sys/modules/ld_aac/Makefile
sys/modules/ld_aac/ld_aac.ioconf
sys/modules/ld_amr/Makefile
sys/modules/ld_amr/ld_amr.ioconf
sys/modules/ld_ataraid/Makefile
sys/modules/ld_ataraid/ld_ataraid.ioconf
sys/modules/ld_cac/Makefile
sys/modules/ld_cac/ld_cac.ioconf
sys/modules/ld_icp/Makefile
sys/modules/ld_icp/ld_icp.ioconf
sys/modules/ld_mlx/Makefile
sys/modules/ld_mlx/ld_mlx.ioconf
sys/modules/ld_nvme/Makefile
sys/modules/ld_nvme/ld_nvme.ioconf
sys/modules/ld_sdmmc/Makefile
sys/modules/ld_sdmmc/ld_sdmmc.ioconf
sys/modules/ld_twa/Makefile
sys/modules/ld_twa/ld_twa.ioconf
sys/modules/ld_twe/Makefile
sys/modules/ld_twe/ld_twe.ioconf
sys/modules/ld_virtio/Makefile
sys/modules/ld_virtio/ld_virtio.ioconf
sys/modules/lua/lua.c
sys/modules/mlx/Makefile
sys/modules/mlx/mlx.ioconf
sys/modules/mlx_eisa/Makefile
sys/modules/mlx_eisa/mlx_eisa.ioconf
sys/modules/mlx_pci/Makefile
sys/modules/mlx_pci/mlx_pci.ioconf
sys/modules/nvme/Makefile
sys/modules/nvme/nvme.ioconf
sys/modules/slcompress/Makefile
sys/modules/sppp_subr/Makefile
sys/modules/tun/Makefile
sys/modules/tun/tun.c
sys/modules/twa/Makefile
sys/modules/twa/twa.ioconf
sys/modules/twe/Makefile
sys/modules/twe/twe.ioconf
sys/modules/viomb/Makefile
sys/modules/viomb/viomb.ioconf
sys/modules/virtio/Makefile
sys/modules/virtio/virtio.ioconf
sys/net/agr/if_agr.c
sys/net/bpf.c
sys/net/bpfjit.c
sys/net/bsd-comp.c
sys/net/files.net
sys/net/if.c
sys/net/if.h
sys/net/if_arcsubr.c
sys/net/if_atmsubr.c
sys/net/if_bridge.c
sys/net/if_ecosubr.c
sys/net/if_etherip.c
sys/net/if_ethersubr.c
sys/net/if_faith.c
sys/net/if_fddisubr.c
sys/net/if_gif.c
sys/net/if_gre.c
sys/net/if_ieee1394subr.c
sys/net/if_loop.c
sys/net/if_media.h
sys/net/if_module.h
sys/net/if_mpls.c
sys/net/if_ppp.c
sys/net/if_pppoe.c
sys/net/if_sl.c
sys/net/if_spppsubr.c
sys/net/if_spppvar.h
sys/net/if_srt.c
sys/net/if_stf.c
sys/net/if_stf.h
sys/net/if_strip.c
sys/net/if_tap.c
sys/net/if_tokensubr.c
sys/net/if_tun.c
sys/net/if_vlan.c
sys/net/ppp-deflate.c
sys/net/ppp_tty.c
sys/net/route.c
sys/net/route.h
sys/net/rtsock.c
sys/net/slcompress.c
sys/net80211/ieee80211.h
sys/net80211/ieee80211_input.c
sys/net80211/ieee80211_netbsd.c
sys/net80211/ieee80211_node.c
sys/net80211/ieee80211_rssadapt.c
sys/net80211/ieee80211_var.h
sys/netatalk/aarp.c
sys/netatalk/at_control.c
sys/netatalk/ddp_input.c
sys/netatalk/ddp_usrreq.c
sys/netbt/l2cap_signal.c
sys/netinet/if_arp.c
sys/netinet/igmp.c
sys/netinet/in.c
sys/netinet/in.h
sys/netinet/in_gif.c
sys/netinet/in_pcb.c
sys/netinet/in_var.h
sys/netinet/ip_carp.c
sys/netinet/ip_flow.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet/ip_mroute.c
sys/netinet/ip_output.c
sys/netinet/ip_var.h
sys/netinet/raw_ip.c
sys/netinet/sctp_crc32.c
sys/netinet/tcp_timer.c
sys/netinet/tcp_vtw.c
sys/netinet6/files.netinet6
sys/netinet6/icmp6.c
sys/netinet6/in6.c
sys/netinet6/in6_gif.c
sys/netinet6/in6_ifattach.c
sys/netinet6/in6_pcb.c
sys/netinet6/in6_src.c
sys/netinet6/in6_var.h
sys/netinet6/ip6_flow.c
sys/netinet6/ip6_forward.c
sys/netinet6/ip6_input.c
sys/netinet6/ip6_mroute.c
sys/netinet6/ip6_output.c
sys/netinet6/ip6_var.h
sys/netinet6/mld6.c
sys/netinet6/nd6.c
sys/netinet6/nd6_nbr.c
sys/netinet6/nd6_rtr.c
sys/netinet6/raw_ip6.c
sys/netinet6/scope6.c
sys/netinet6/sctp6_usrreq.c
sys/netinet6/udp6_output.c
sys/netinet6/udp6_usrreq.c
sys/netipsec/key.c
sys/netmpls/mpls_proto.c
sys/netnatm/natm.c
sys/netnatm/natm_proto.c
sys/netsmb/smb_dev.c
sys/netsmb/smb_rq.c
sys/nfs/nfs_node.c
sys/opencrypto/aesxcbcmac.c
sys/rump/dev/lib/libbpf/bpf_component.c
sys/rump/dev/lib/libcgd/cgd_component.c
sys/rump/dev/lib/libfss/fss_component.c
sys/rump/dev/lib/libvnd/vnd_component.c
sys/rump/fs/lib/libext2fs/Makefile
sys/rump/librump/rumpkern/Makefile.rumpkern
sys/rump/librump/rumpkern/vm.c
sys/rump/librump/rumpvfs/rumpfs.c
sys/rump/net/Makefile.rumpnetcomp
sys/rump/net/lib/libnet/Makefile
sys/rump/net/lib/libnet/net_component.c
sys/rump/net/lib/libnetinet/netinet_component.c
sys/rump/net/lib/libnetinet6/netinet6_component.c
sys/rump/net/lib/libnetmpls/NETMPLS.ioconf
sys/rump/net/lib/libnetmpls/netmpls_component.c
sys/rump/net/lib/libtap/tap_component.c
sys/rump/net/lib/libtun/Makefile
sys/rump/net/lib/libtun/TUN.ioconf
sys/rump/net/lib/libtun/tun_component.c
sys/sys/exec.h
sys/sys/exec_elf.h
sys/sys/intrio.h
sys/sys/kobj_impl.h
sys/sys/ktrace.h
sys/sys/mbuf.h
sys/sys/param.h
sys/sys/pax.h
sys/sys/proc.h
sys/sys/signal.h
sys/sys/signalvar.h
sys/sys/socket.h
sys/sys/socketvar.h
sys/sys/termios.h
sys/sys/unistd.h
sys/sys/vnode.h
sys/sys/wapbl.h
sys/ufs/chfs/chfs_vnops.c
sys/ufs/chfs/ebh.h
sys/ufs/ext2fs/ext2fs.h
sys/ufs/ext2fs/ext2fs_alloc.c
sys/ufs/ext2fs/ext2fs_balloc.c
sys/ufs/ext2fs/ext2fs_bmap.c
sys/ufs/ext2fs/ext2fs_bswap.c
sys/ufs/ext2fs/ext2fs_dinode.h
sys/ufs/ext2fs/ext2fs_dir.h
sys/ufs/ext2fs/ext2fs_extents.c
sys/ufs/ext2fs/ext2fs_extents.h
sys/ufs/ext2fs/ext2fs_extern.h
sys/ufs/ext2fs/ext2fs_hash.c
sys/ufs/ext2fs/ext2fs_htree.c
sys/ufs/ext2fs/ext2fs_inode.c
sys/ufs/ext2fs/ext2fs_lookup.c
sys/ufs/ext2fs/ext2fs_readwrite.c
sys/ufs/ext2fs/ext2fs_rename.c
sys/ufs/ext2fs/ext2fs_subr.c
sys/ufs/ext2fs/ext2fs_vfsops.c
sys/ufs/ext2fs/ext2fs_vnops.c
sys/ufs/ext2fs/ext2fs_xattr.c
sys/ufs/ext2fs/ext2fs_xattr.h
sys/ufs/ffs/ffs_alloc.c
sys/ufs/ffs/ffs_balloc.c
sys/ufs/ffs/ffs_extern.h
sys/ufs/ffs/ffs_vfsops.c
sys/ufs/ffs/ffs_wapbl.c
sys/ufs/files.ufs
sys/ufs/lfs/lfs_alloc.c
sys/ufs/lfs/lfs_balloc.c
sys/ufs/lfs/lfs_pages.c
sys/ufs/lfs/lfs_vnops.c
sys/ufs/lfs/ulfs_inode.c
sys/ufs/ufs/inode.h
sys/ufs/ufs/ufs_inode.c
sys/uvm/files.uvm
sys/uvm/pmap/pmap.c
sys/uvm/pmap/pmap.h
sys/uvm/pmap/pmap_segtab.c
sys/uvm/pmap/pmap_synci.c
sys/uvm/pmap/pmap_synci.h
sys/uvm/pmap/pmap_tlb.c
sys/uvm/pmap/pmap_tlb.h
sys/uvm/pmap/tlb.h
sys/uvm/pmap/vmpagemd.h
sys/uvm/uvm_aobj.c
sys/uvm/uvm_extern.h
sys/uvm/uvm_km.c
sys/uvm/uvm_map.c
sys/uvm/uvm_mmap.c
--- a/sys/arch/acorn32/podulebus/esc.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/acorn32/podulebus/esc.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: esc.c,v 1.29.2.1 2015/12/27 12:09:27 skrll Exp $	*/
+/*	$NetBSD: esc.c,v 1.29.2.2 2016/10/05 20:55:23 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.2.1 2015/12/27 12:09:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esc.c,v 1.29.2.2 2016/10/05 20:55:23 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -675,7 +675,7 @@
 			dev->sc_interrupt = *esc_interrupt;
 		}
 	}
-	
+
 /* Update buffer pointers to reflect the sent/received data. */
 	dev->sc_buf = buf;
 	dev->sc_len = len;
@@ -1491,7 +1491,7 @@
 					 * Make sure that the specs are within
 					 * chip limits. Note that if we
 					 * initiated the negotiation the specs
-					 * WILL be withing chip limits. If it
+					 * WILL be within chip limits. If it
 					 * was the scsi unit that initiated
 					 * the negotiation, the specs may be
 					 * to high.
--- a/sys/arch/acorn32/podulebus/sfas.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/acorn32/podulebus/sfas.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: sfas.c,v 1.26 2014/10/25 10:58:12 skrll Exp $	*/
+/*	$NetBSD: sfas.c,v 1.26.2.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sfas.c,v 1.26 2014/10/25 10:58:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sfas.c,v 1.26.2.1 2016/10/05 20:55:23 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1410,7 +1410,7 @@
 					 * Make sure that the specs are within
 					 * chip limits. Note that if we
 					 * initiated the negotiation the specs
-					 * WILL be withing chip limits. If it
+					 * WILL be within chip limits. If it
 					 * was the scsi unit that initiated
 					 * the negotiation, the specs may be
 					 * to high.
--- a/sys/arch/algor/algor/algor_intr.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/algor/algor/algor_intr.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $	*/
+/*	$NetBSD: algor_intr.c,v 1.1.30.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_intr.c,v 1.1.30.1 2016/10/05 20:55:23 skrll Exp $");
 
 #define	__INTR_PRIVATE
 #include "opt_algor_p4032.h"
@@ -102,9 +102,9 @@
 
 #ifdef evbmips
 void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t pending)
+evbmips_iointr(int ipl, uint32_t pending, struct clockframe *cf)
 {
-	(*algor_iointr)(ipl, pc, pending);
+	(*algor_iointr)(ipl, cf->pc, pending);
 }
 
 void *
--- a/sys/arch/alpha/include/Makefile	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/alpha/include/Makefile	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2011/08/12 22:22:49 dyoung Exp $
+#	$NetBSD: Makefile,v 1.32.30.1 2016/10/05 20:55:23 skrll Exp $
 
 INCSDIR= /usr/include/alpha
 
@@ -7,7 +7,7 @@
 	cdefs.h cfbreg.h cpu.h cpuconf.h \
 	disklabel.h \
 	ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \
-	float.h fpu.h frame.h \
+	fenv.h float.h fpu.h frame.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/alpha/include/fenv.h	Wed Oct 05 20:55:23 2016 +0000
@@ -0,0 +1,186 @@
+/*	$NetBSD: fenv.h,v 1.2.4.2 2016/10/05 20:55:23 skrll Exp $	*/
+
+/*-
+ * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/msun/alpha/fenv.h,v 1.3 2005/03/16 19:03:44 das Exp $
+ */
+
+#ifndef	_ALPHA_FENV_H_
+#define	_ALPHA_FENV_H_
+
+#include <sys/stdint.h>
+
+typedef	__uint64_t	fenv_t;
+typedef	__uint16_t	fexcept_t;
+
+/* Exception flags */
+#define	FE_INVALID	0x01
+#define	FE_DIVBYZERO	0x02
+#define	FE_OVERFLOW	0x04
+#define	FE_UNDERFLOW	0x08
+#define	FE_INEXACT	0x10
+#define	FE_INTOVF	0x20	/* not maskable */
+#define	FE_ALL_EXCEPT	(FE_DIVBYZERO | FE_INEXACT | FE_INTOVF | \
+			 FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
+
+/* Rounding modes */
+#define	FE_TOWARDZERO	0x00
+#define	FE_DOWNWARD	0x01
+#define	FE_TONEAREST	0x02
+#define	FE_UPWARD	0x03
+#define	_ROUND_MASK	(FE_TONEAREST | FE_DOWNWARD | \
+			 FE_UPWARD | FE_TOWARDZERO)
+#define	_ROUND_SHIFT	58
+
+#define	_FPUSW_SHIFT	52
+
+#define	__excb()	__asm __volatile("excb")
+#define	__mf_fpcr(__cw)	__asm __volatile("mf_fpcr %0" : "=f" (*(__cw)))
+#define	__mt_fpcr(__cw)	__asm __volatile("mt_fpcr %0" : : "f" (__cw))
+
+union __fpcr {
+	double __d;
+	fenv_t __bits;
+};
+
+__BEGIN_DECLS
+
+/* Default floating-point environment */
+extern const fenv_t	__fe_dfl_env;
+#define	FE_DFL_ENV	(&__fe_dfl_env)
+
+static __inline int
+feclearexcept(int __excepts)
+{
+	union __fpcr __r;
+
+	__excb();
+	__mf_fpcr(&__r.__d);
+	__r.__bits &= ~((fenv_t)__excepts << _FPUSW_SHIFT);
+	__mt_fpcr(__r.__d);
+	__excb();
+	return 0;
+}
+
+static __inline int
+fegetexceptflag(fexcept_t *__flagp, int __excepts)
+{
+	union __fpcr __r;
+
+	__excb();
+	__mf_fpcr(&__r.__d);
+	__excb();
+	*__flagp = (__r.__bits >> _FPUSW_SHIFT) & __excepts;
+	return 0;
+}
+
+static __inline int
+fesetexceptflag(const fexcept_t *__flagp, int __excepts)
+{
+	union __fpcr __r;
+	fenv_t __xflag, __xexcepts;
+
+	__xflag = (fenv_t)*__flagp << _FPUSW_SHIFT;
+	__xexcepts = (fenv_t)__excepts << _FPUSW_SHIFT;
+	__excb();
+	__mf_fpcr(&__r.__d);
+	__r.__bits &= ~__xexcepts;
+	__r.__bits |= __xflag & __xexcepts;
+	__mt_fpcr(__r.__d);
+	__excb();
+	return 0;
+}
+
+static __inline int
+feraiseexcept(int __excepts)
+{
+
+	/*
+	 * XXX Generating exceptions this way does not actually invoke
+	 * a userland trap handler when enabled, but neither do
+	 * arithmetic operations as far as I can tell.  Perhaps there
+	 * are more bugs in the kernel trap handler.
+	 */
+	fexcept_t __ex = __excepts;
+	fesetexceptflag(&__ex, __excepts);
+	return 0;
+}
+
+static __inline int
+fetestexcept(int __excepts)
+{
+	union __fpcr __r;
+
+	__excb();
+	__mf_fpcr(&__r.__d);
+	__excb();
+	return (__r.__bits >> _FPUSW_SHIFT) & __excepts;
+}
+
+static __inline int
+fegetround(void)
+{
+	union __fpcr __r;
+
+	/*
+	 * No exception barriers should be required here if we assume
+	 * that only fesetround() can change the rounding mode.
+	 */
+	__mf_fpcr(&__r.__d);
+	return (int)(__r.__bits >> _ROUND_SHIFT) & _ROUND_MASK;
+}
+
+static __inline int
+fesetround(int __round)
+{
+	union __fpcr __r;
+
+	if (__round & ~_ROUND_MASK)
+		return (-1);
+	__excb();
+	__mf_fpcr(&__r.__d);
+	__r.__bits &= ~((fenv_t)_ROUND_MASK << _ROUND_SHIFT);
+	__r.__bits |= (fenv_t)__round << _ROUND_SHIFT;
+	__mt_fpcr(__r.__d);
+	__excb();
+	return 0;
+}
+
+int	fegetenv(fenv_t *);
+int	feholdexcept(fenv_t *);
+int	fesetenv(const fenv_t *);
+int	feupdateenv(const fenv_t *);
+
+#if defined(_NETBSD_SOURCE) || defined(_GNU_SOURCE)
+int	feenableexcept(int);
+int	fedisableexcept(int);
+int	fegetexcept(void);
+#endif /* _NETBSD_SOURCE || _GNU_SOURCE */
+
+
+__END_DECLS
+
+#endif	/* !_ALPHA_FENV_H_ */
--- a/sys/arch/alpha/include/ieeefp.h	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/alpha/include/ieeefp.h	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.8 2012/02/06 02:14:13 matt Exp $ */
+/* $NetBSD: ieeefp.h,v 1.8.24.1 2016/10/05 20:55:23 skrll Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 28, 1995
@@ -12,26 +12,7 @@
 
 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
-typedef int fenv_t;
-typedef int fexcept_t;
-
-#define	FE_INVALID	0x01	/* invalid operation exception */
-#define	FE_DIVBYZERO	0x02	/* divide-by-zero exception */
-#define	FE_OVERFLOW	0x04	/* overflow exception */
-#define	FE_UNDERFLOW	0x08	/* underflow exception */
-#define	FE_INEXACT	0x10	/* imprecise (loss of precision; "inexact") */
-#define	FE_IOVERFLOW	0x20    /* integer overflow */
-
-#define	FE_ALL_EXCEPT	0x3f
-
-/*
- * These bits match the fpcr as well as bits 12:11
- * in fp operate instructions
- */
-#define	FE_TOWARDZERO	0	/* round to zero (truncate) */
-#define	FE_DOWNWARD	1	/* round toward negative infinity */
-#define	FE_TONEAREST	2	/* round to nearest representable number */
-#define	FE_UPWARD	3	/* round toward positive infinity */
+#include <machine/fenv.h>
 
 #if !defined(_ISOC99_SOURCE)
 
@@ -63,7 +44,7 @@
 #define	FP_X_OFL	FE_OVERFLOW	/* overflow exception */
 #define	FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
 #define	FP_X_IMP	FE_INEXACT	/* imprecise (prec. loss; "inexact") */
-#define	FP_X_IOV	FE_IOVERFLOW	/* integer overflow */
+#define	FP_X_IOV	FE_INTOVF	/* integer overflow */
 
 /*
  * fp_rnd bits match the fpcr, below, as well as bits 12:11
--- a/sys/arch/alpha/tc/tc_bus_mem.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/alpha/tc/tc_bus_mem.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_bus_mem.c,v 1.35 2013/11/04 16:55:31 christos Exp $ */
+/* $NetBSD: tc_bus_mem.c,v 1.35.6.1 2016/10/05 20:55:23 skrll Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: tc_bus_mem.c,v 1.35 2013/11/04 16:55:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tc_bus_mem.c,v 1.35.6.1 2016/10/05 20:55:23 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -277,7 +277,7 @@
 		return (EOPNOTSUPP);
 
 	if (memaddr & 0x7)
-		panic("tc_mem_map needs 8 byte alignment");
+		panic("%s: need 8 byte alignment", __func__);
 	if (cacheable)
 		*memhp = ALPHA_PHYS_TO_K0SEG(memaddr);
 	else
@@ -314,7 +314,7 @@
 {
 
 	/* XXX XXX XXX XXX XXX XXX */
-	panic("tc_mem_alloc unimplemented");
+	panic("%s: unimplemented", __func__);
 }
 
 void
@@ -322,7 +322,7 @@
 {
 
 	/* XXX XXX XXX XXX XXX XXX */
-	panic("tc_mem_free unimplemented");
+	panic("%s: unimplemented", __func__);
 }
 
 void *
@@ -334,7 +334,7 @@
 		 * tc_mem_map() catches linear && !cacheable,
 		 * so we shouldn't come here
 		 */
-		panic("tc_mem_vaddr");
+		panic("%s: can't do sparse", __func__);
 	}
 #endif
 	return ((void *)bsh);
@@ -364,32 +364,49 @@
 		alpha_wmb();
 }
 
+/*
+ * https://web-docs.gsi.de/~kraemer/COLLECTION/DEC/d3syspmb.pdf
+ * http://h20565.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c04623255
+ */
+#define TC_SPARSE_PTR(memh, off) \
+    ((void *)((memh) + ((off & ((bus_size_t)-1 << 2)) << 1)))
+
 static inline uint8_t
 tc_mem_read_1(void *v, bus_space_handle_t memh, bus_size_t off)
 {
-	volatile uint8_t *p;
 
 	alpha_mb();		/* XXX XXX XXX */
 
-	if ((memh & TC_SPACE_SPARSE) != 0)
-		panic("tc_mem_read_1 not implemented for sparse space");
+	if ((memh & TC_SPACE_SPARSE) != 0) {
+		volatile uint32_t *p;
 
-	p = (uint8_t *)(memh + off);
-	return (*p);
+		p = TC_SPARSE_PTR(memh, off);
+		return ((*p >> ((off & 3) << 3)) & 0xff);
+	} else {
+		volatile uint8_t *p;
+
+		p = (uint8_t *)(memh + off);
+		return (*p);
+	}
 }
 
 static inline uint16_t
 tc_mem_read_2(void *v, bus_space_handle_t memh, bus_size_t off)
 {
-	volatile uint16_t *p;
 
 	alpha_mb();		/* XXX XXX XXX */
 
-	if ((memh & TC_SPACE_SPARSE) != 0)
-		panic("tc_mem_read_2 not implemented for sparse space");
+	if ((memh & TC_SPACE_SPARSE) != 0) {
+		volatile uint32_t *p;
 
-	p = (uint16_t *)(memh + off);
-	return (*p);
+		p = TC_SPARSE_PTR(memh, off);
+		return ((*p >> ((off & 2) << 3)) & 0xffff);
+	} else {
+		volatile uint16_t *p;
+
+		p = (uint16_t *)(memh + off);
+		return (*p);
+	}
 }
 
 static inline uint32_t
@@ -403,6 +420,12 @@
 		/* Nothing special to do for 4-byte sparse space accesses */
 		p = (uint32_t *)(memh + (off << 1));
 	else
+		/*
+		 * LDL to a dense space address always results in two
+		 * TURBOchannel I/O read transactions to consecutive longword
+		 * addresses. Use caution in dense space if the option has
+		 * registers with read side effects.
+		 */
 		p = (uint32_t *)(memh + off);
 	return (*p);
 }
@@ -415,7 +438,7 @@
 	alpha_mb();		/* XXX XXX XXX */
 
 	if ((memh & TC_SPACE_SPARSE) != 0)
-		panic("tc_mem_read_8 not implemented for sparse space");
+		panic("%s: not implemented for sparse space", __func__);
 
 	p = (uint64_t *)(memh + off);
 	return (*p);
@@ -461,23 +484,21 @@
 tc_mem_read_region_N(4,uint32_t)
 tc_mem_read_region_N(8,uint64_t)
 
+#define TC_SPARSE_WR_PVAL(msk, b, v) \
+    ((UINT64_C(msk) << (32 + (b))) | ((uint64_t)(v) << ((b) << 3)))
+
 static inline void
 tc_mem_write_1(void *v, bus_space_handle_t memh, bus_size_t off, uint8_t val)
 {
 
 	if ((memh & TC_SPACE_SPARSE) != 0) {
 		volatile uint64_t *p;
-		off &= 0x3;
-
-		p = (uint64_t *)(memh + (off << 1));
 
-		*p = val;
-	} else {
-		volatile uint8_t *p;
+		p = TC_SPARSE_PTR(memh, off);
+		*p = TC_SPARSE_WR_PVAL(0x1, off & 3, val);
+	} else
+		panic("%s: not implemented for dense space", __func__);
 
-		p = (uint8_t *)(memh + off);
-		*p = val;
-	}
 	alpha_mb();		/* XXX XXX XXX */
 }
 
@@ -488,17 +509,11 @@
 	if ((memh & TC_SPACE_SPARSE) != 0) {
 		volatile uint64_t *p;
 
-		off &= 0x3;
-
-		p = (uint64_t *)(memh + (off << 1));
+		p = TC_SPARSE_PTR(memh, off);
+		*p = TC_SPARSE_WR_PVAL(0x3, off & 2, val);
+	} else
+		panic("%s: not implemented for dense space", __func__);
 
-		*p = val;
-	} else {
-		volatile uint16_t *p;
-
-		p = (uint16_t *)(memh + off);
-		*p = val;
-	}
 	alpha_mb();		/* XXX XXX XXX */
 }
 
@@ -513,6 +528,7 @@
 	else
 		p = (uint32_t *)(memh + off);
 	*p = val;
+
 	alpha_mb();		/* XXX XXX XXX */
 }
 
@@ -522,10 +538,11 @@
 	volatile uint64_t *p;
 
 	if ((memh & TC_SPACE_SPARSE) != 0)
-		panic("tc_mem_read_8 not implemented for sparse space");
+		panic("%s: not implemented for sparse space", __func__);
 
 	p = (uint64_t *)(memh + off);
 	*p = val;
+
 	alpha_mb();		/* XXX XXX XXX */
 }
 
--- a/sys/arch/amd64/acpi/acpi_wakecode.S	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/acpi/acpi_wakecode.S	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakecode.S,v 1.12 2014/01/15 22:24:41 joerg Exp $	*/
+/*	$NetBSD: acpi_wakecode.S,v 1.12.6.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg@netbsd.org>
@@ -31,7 +31,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 /*
  * This code is derived from FreeBSD.  Original copyrights:
  *
@@ -144,7 +143,7 @@
 	data32 addr32 lgdt	tmp_gdt
 #endif
 
-	/* Enable protected mode w/o paging */
+	/* Enable protected mode without paging */
 	mov	%cr0,%eax
 	orl	$(CR0_PE),%eax
 	mov	%eax,%cr0
@@ -164,10 +163,10 @@
 	/*
 	 * Switched to protected mode w/o paging
 	 */
+	nop
 
-	nop
 	/* Set up segment registers and initial stack for protected mode */
-	movw	$0x10, %ax
+	movw	$0x10,%ax
 	movw	%ax,%ds
 	movw	%ax,%ss
 
@@ -193,7 +192,7 @@
 	movl	WAKEUP_efer + ACPI_WAKEUP_ADDR,%ebx
 	movl	$MSR_EFER,%ecx
 	rdmsr
-	orl	$EFER_LME, %eax
+	orl	$EFER_LME,%eax
 	wrmsr
 
 	/* Load temporary PML4, code will switch to full PML4 later */
@@ -204,9 +203,11 @@
 	movl	%cr0,%eax
 	orl	$(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_MP|CR0_WP|CR0_AM),%eax
 	movl	%eax,%cr0
-	/* Flush prefetch queue */
+
+	/* Flush the prefetch queue */
 	jmp	1f
 1:
+
 	/* Switch to temporary 64bit GDT */
 	lgdt	tmp_gdt64 + ACPI_WAKEUP_ADDR
 
@@ -220,7 +221,7 @@
 	 * Load the normal system value of MSR EFER.  This includes
 	 * enabling the SYSCALL extension and NXE (if supported).
 	 */
-	movl	%ebx, %eax
+	movl	%ebx,%eax
 	movl	$MSR_EFER,%ecx
 	wrmsr
 
@@ -228,6 +229,7 @@
 	movw	$GSEL(GDATA_SEL, SEL_KPL),%ax
 	movw	%ax,%ds
 
+	/* Restore registers */
 	movq	WAKEUP_curcpu + ACPI_WAKEUP_ADDR,%r8
 	movq	WAKEUP_restorecpu + ACPI_WAKEUP_ADDR,%rbx
 
@@ -270,7 +272,7 @@
 	.global WAKEUP_vbios_reset
 WAKEUP_vbios_reset:	.byte 0
 	.global WAKEUP_vesa_modenum
-WAKEUP_vesa_modenum:    .word 0
+WAKEUP_vesa_modenum:	.word 0
 	.global WAKEUP_beep_on_reset
 WAKEUP_beep_on_reset:	.byte 0
 
--- a/sys/arch/amd64/acpi/acpi_wakeup_low.S	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/acpi/acpi_wakeup_low.S	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup_low.S,v 1.4 2008/05/11 15:32:20 ad Exp $	*/
+/*	$NetBSD: acpi_wakeup_low.S,v 1.4.62.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg@netbsd.org>
@@ -80,7 +80,7 @@
 	movq	ACPI_SUSPEND_CR0(%r8),%rax
 	movq	%rax,%cr0
 
-	jmp 1f
+	jmp	1f
 1:
 
 	movq	CPUVAR(GDT),%rax
@@ -88,7 +88,7 @@
 	andq	$~0x0200,4(%rax,%rdx, 1)
 
 	ltr	%dx
-	lldt 	ACPI_SUSPEND_LDT(%r8)
+	lldt	ACPI_SUSPEND_LDT(%r8)
 	lidt	ACPI_SUSPEND_IDT(%r8)
 
 	movq	ACPI_SUSPEND_REG+(0*8)(%r8),%rsp
--- a/sys/arch/amd64/amd64/amd64_trap.S	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/amd64_trap.S	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.2.10.1 2015/12/27 12:09:28 skrll Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.2.10.2 2016/10/05 20:55:23 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.10.1 2015/12/27 12:09:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.2.10.2 2016/10/05 20:55:23 skrll Exp $");
 #endif
 
 /*
@@ -78,12 +78,12 @@
  * (possibly the next clock tick).  Thus, we disable interrupt before checking,
  * and only enable them again on the final `iret' or before calling the AST
  * handler.
- */ 
+ */
 
 /*****************************************************************************/
 
 #ifdef	XEN
-#define	PRE_TRAP	movq (%rsp),%rcx ; movq 8(%rsp),%r11 ; addq $0x10,%rsp 
+#define	PRE_TRAP	movq (%rsp),%rcx ; movq 8(%rsp),%r11 ; addq $0x10,%rsp
 #else
 #define	PRE_TRAP
 #endif
@@ -229,28 +229,36 @@
 IDTVEC(trap0b)		/* #NP() Segment not present */
 	TRAP_NJ(T_SEGNPFLT)
 	jmp	check_swapgs
-IDTVEC_END(trap0b)		/* #NP() Segment not present */
+IDTVEC_END(trap0b)
 
 IDTVEC(trap0c)		/* #SS() Stack exception */
 	TRAP_NJ(T_STKFLT)
 	jmp	check_swapgs
-IDTVEC_END(trap0c)		/* #SS() Stack exception */
+IDTVEC_END(trap0c)
 
 IDTVEC(trap0d)		/* #GP() General protection */
 	TRAP_NJ(T_PROTFLT)
 #ifdef check_swapgs
 	jmp	check_swapgs
 #else
-/* We need to worry about traps while the kernel %gs_base isn't loaded.
- * These are either loads to %gs (only 32bit) or faults on iret during
- * return to user. */
+/*
+ * We need to worry about traps in kernel mode while the kernel %gs isn't
+ * loaded. These are either faults on iretq during return to user or loads to
+ * %gs.
+ *
+ * When such traps happen, we have CPL=0 and %gs=userland, and we must perform
+ * an additional swapgs to get %gs=kernel.
+ */
 check_swapgs:
 	INTRENTRY_L(3f,1:)
-2:	sti
+2:
+	sti
 	jmp	calltrap
 3:
-	/* Trap in kernel mode. */
-	/* If faulting instruction is 'iret' we may need to do a 'swapgs'. */
+	/*
+	 * Trap in kernel mode.
+	 */
+	/* Case 1: fault on iretq? */
 	movq	TF_RIP(%rsp),%rax
 	cmpw	$0xcf48,(%rax)		/* Faulting instruction is iretq ? */
 	jne	5f			/* Jump if not */
@@ -259,7 +267,8 @@
 	je	2b			/* jump if iret was to kernel  */
 	jmp	1b			/* to user - must restore %gs */
 5:
-	/* Not 'iret', all moves to %gs also need a swapgs */
+
+	/* Case 2: move to %gs? */
 	movw	(%rax),%ax
 	andb	$070,%ah		/* mask mod/rm from mod/reg/rm */
 	cmpw	$0x8e+050*256,%ax	/* Any move to %gs (reg 5) */
--- a/sys/arch/amd64/amd64/gdt.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/gdt.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdt.c,v 1.25.6.1 2015/12/27 12:09:28 skrll Exp $	*/
+/*	$NetBSD: gdt.c,v 1.25.6.2 2016/10/05 20:55:23 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.6.1 2015/12/27 12:09:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.25.6.2 2016/10/05 20:55:23 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -64,9 +64,6 @@
 int gdt_free;		/* next free slot; terminated with GNULL_SEL */
 
 void gdt_init(void);
-void gdt_grow(void);
-int gdt_get_slot(void);
-void gdt_put_slot(int);
 
 void
 update_descriptor(void *tp, void *ep)
@@ -88,8 +85,7 @@
 }
 
 void
-set_sys_gdt(int slot, void *base, size_t limit,
-	    int type, int dpl, int gran)
+set_sys_gdt(int slot, void *base, size_t limit, int type, int dpl, int gran)
 {
 	union {
 		struct sys_segment_descriptor sd;
@@ -109,7 +105,8 @@
 }
 
 /*
- * Initialize the GDT.
+ * Initialize the GDT. We already have a gdtstore, which was temporarily used
+ * by the bootstrap code. Now, we allocate a new gdtstore, and put it in cpu0.
  */
 void
 gdt_init(void)
@@ -124,11 +121,18 @@
 	gdt_next = 0;
 	gdt_free = GNULL_SEL;
 	gdt_dynavail =
-	    (gdt_size - DYNSEL_START) / sizeof (struct sys_segment_descriptor);
+	    (gdt_size - DYNSEL_START) / sizeof(struct sys_segment_descriptor);
 
 	old_gdt = gdtstore;
+
+	/* Allocate MAXGDTSIZ bytes of virtual memory. */
 	gdtstore = (char *)uvm_km_alloc(kernel_map, MAXGDTSIZ, 0,
 	    UVM_KMF_VAONLY);
+
+	/*
+	 * Allocate only MINGDTSIZ bytes of physical memory. We will grow this
+	 * area in gdt_grow at run-time if needed.
+	 */
 	for (va = (vaddr_t)gdtstore; va < (vaddr_t)gdtstore + MINGDTSIZ;
 	    va += PAGE_SIZE) {
 		pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO);
@@ -139,17 +143,21 @@
 		    VM_PROT_READ | VM_PROT_WRITE, 0);
 	}
 	pmap_update(pmap_kernel());
+
+	/* Copy the initial bootstrap GDT into the new area. */
 	memcpy(gdtstore, old_gdt, DYNSEL_START);
 	ci->ci_gdt = (void *)gdtstore;
 #ifndef XEN
 	set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore,
 	    LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0);
 #endif
+
 	gdt_init_cpu(ci);
 }
 
 /*
- * Allocate shadow GDT for a slave CPU.
+ * Allocate shadow GDT for a secondary CPU. It contains the same values as the
+ * GDT present in cpu0 (gdtstore).
  */
 void
 gdt_alloc_cpu(struct cpu_info *ci)
@@ -161,6 +169,7 @@
 
 	ci->ci_gdt = (union descriptor *)uvm_km_alloc(kernel_map, max_len,
 	    0, UVM_KMF_VAONLY);
+
 	for (va = (vaddr_t)ci->ci_gdt; va < (vaddr_t)ci->ci_gdt + min_len;
 	    va += PAGE_SIZE) {
 		while ((pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO))
@@ -171,20 +180,22 @@
 		    VM_PROT_READ | VM_PROT_WRITE, 0);
 	}
 	pmap_update(pmap_kernel());
+
 	memset(ci->ci_gdt, 0, min_len);
 	memcpy(ci->ci_gdt, gdtstore, gdt_size);
 }
 
-
 /*
- * Load appropriate gdt descriptor; we better be running on *ci
- * (for the most part, this is how a CPU knows who it is).
+ * Load appropriate GDT descriptor into the currently running CPU, which must
+ * be ci.
  */
 void
 gdt_init_cpu(struct cpu_info *ci)
 {
 	struct region_descriptor region;
 
+	KASSERT(curcpu() == ci);
+
 #ifndef XEN
 	setregion(&region, ci->ci_gdt, (uint16_t)(MAXGDTSIZ - 1));
 #else
@@ -208,32 +219,41 @@
 }
 #endif
 
-
+#if !defined(XEN) || defined(USER_LDT)
 /*
- * Grow or shrink the GDT.
+ * Grow the GDT. The GDT is present on each CPU, so we need to iterate over all
+ * of them. We already have the virtual memory, we only need to grow the
+ * physical memory.
  */
-void
+static void
 gdt_grow(void)
 {
-	size_t old_len, new_len;
+	size_t old_size;
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
 	struct vm_page *pg;
 	vaddr_t va;
 
-	old_len = gdt_size;
+	old_size = gdt_size;
 	gdt_size <<= 1;
-	new_len = old_len << 1;
+	if (gdt_size > MAXGDTSIZ)
+		gdt_size = MAXGDTSIZ;
 	gdt_dynavail =
-	    (gdt_size - DYNSEL_START) / sizeof (struct sys_segment_descriptor);
+	    (gdt_size - DYNSEL_START) / sizeof(struct sys_segment_descriptor);
 
-	for (va = (vaddr_t)gdtstore + old_len; va < (vaddr_t)gdtstore + new_len;
-	    va += PAGE_SIZE) {
-		while ((pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO)) ==
-		       NULL) {
-			uvm_wait("gdt_grow");
+	for (CPU_INFO_FOREACH(cii, ci)) {
+		for (va = (vaddr_t)(ci->ci_gdt) + old_size;
+		     va < (vaddr_t)(ci->ci_gdt) + gdt_size;
+		     va += PAGE_SIZE) {
+			while ((pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO)) ==
+			    NULL) {
+				uvm_wait("gdt_grow");
+			}
+			pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
+			    VM_PROT_READ | VM_PROT_WRITE, 0);
 		}
-		pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
-		    VM_PROT_READ | VM_PROT_WRITE, 0);
 	}
+
 	pmap_update(pmap_kernel());
 }
 
@@ -245,7 +265,7 @@
  * 3) As a last resort, we increase the size of the GDT, and sweep through
  *    the new slots.
  */
-int
+static int
 gdt_get_slot(void)
 {
 	int slot;
@@ -259,28 +279,23 @@
 		slot = gdt_free;
 		gdt_free = gdt[slot].sd_xx3;	/* XXXfvdl res. field abuse */
 	} else {
-#ifdef DIAGNOSTIC
-		if (gdt_next != gdt_dyncount)
-			panic("gdt_get_slot botch 1");
-#endif
+		KASSERT(gdt_next == gdt_dyncount);
 		if (gdt_next >= gdt_dynavail) {
-#ifdef DIAGNOSTIC
 			if (gdt_size >= MAXGDTSIZ)
-				panic("gdt_get_slot botch 2");
-#endif
+				panic("gdt_get_slot: out of memory");
 			gdt_grow();
 		}
 		slot = gdt_next++;
 	}
 
 	gdt_dyncount++;
-	return (slot);
+	return slot;
 }
 
 /*
  * Deallocate a GDT slot, putting it on the free list.
  */
-void
+static void
 gdt_put_slot(int slot)
 {
 	struct sys_segment_descriptor *gdt;
@@ -294,6 +309,7 @@
 	gdt[slot].sd_xx3 = gdt_free;
 	gdt_free = slot;
 }
+#endif
 
 int
 tss_alloc(struct x86_64_tss *tss)
@@ -302,10 +318,13 @@
 	int slot;
 
 	mutex_enter(&cpu_lock);
+
 	slot = gdt_get_slot();
-	set_sys_gdt(slot, tss, sizeof (struct x86_64_tss) - 1,
-	    SDT_SYS386TSS, SEL_KPL, 0);
+	set_sys_gdt(slot, tss, sizeof(struct x86_64_tss) - 1, SDT_SYS386TSS,
+	    SEL_KPL, 0);
+
 	mutex_exit(&cpu_lock);
+
 	return GDYNSEL(slot, SEL_KPL);
 #else  /* XEN */
 	/* TSS, what for? */
@@ -326,29 +345,30 @@
 }
 
 #ifdef USER_LDT
-void
-ldt_alloc(struct pmap *pmap, char *ldt, size_t len)
-{
-	int slot;
-	struct sys_segment_descriptor *gdt;
-
-	KASSERT(mutex_owned(&cpu_lock));
-
-	gdt = (struct sys_segment_descriptor *)&gdtstore[DYNSEL_START];
-
-	slot = gdt_get_slot();
-	set_sys_gdt(slot, ldt, len - 1, SDT_SYSLDT, SEL_KPL, 0);
-	pmap->pm_ldt_sel = GSEL(slot, SEL_KPL);
-}
-
-void
-ldt_free(struct pmap *pmap)
+/*
+ * XXX: USER_LDT is not implemented on amd64.
+ */
+int
+ldt_alloc(void *ldtp, size_t len)
 {
 	int slot;
 
 	KASSERT(mutex_owned(&cpu_lock));
 
-	slot = IDXDYNSEL(pmap->pm_ldt_sel);
+	slot = gdt_get_slot();
+	set_sys_gdt(slot, ldtp, len - 1, SDT_SYSLDT, SEL_KPL, 0);
+
+	return GDYNSEL(slot, SEL_KPL);
+}
+
+void
+ldt_free(int sel)
+{
+	int slot;
+
+	KASSERT(mutex_owned(&cpu_lock));
+
+	slot = IDXDYNSEL(sel);
 
 	gdt_put_slot(slot);
 }
--- a/sys/arch/amd64/amd64/locore.S	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/locore.S	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.77.2.4 2016/07/09 20:24:49 skrll Exp $	*/
+/*	$NetBSD: locore.S,v 1.77.2.5 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -301,7 +301,7 @@
 	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "")
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
 	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long,  PG_V, PG_V)\
-	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")     
+	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
 	ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long,  0)
 #if NKSYMS > 0 || defined(DDB) || defined(MODULAR)
 	ELFNOTE(Xen, XEN_ELFNOTE_BSD_SYMTAB,     .asciz, "yes")
@@ -316,30 +316,16 @@
 #if NLAPIC > 0
 	.align	PAGE_SIZE
 	.globl	_C_LABEL(local_apic)
-	.globl	_C_LABEL(lapic_id)
 	.globl	_C_LABEL(lapic_tpr)
 
 	.type	_C_LABEL(local_apic), @object
 LABEL(local_apic)
-	.space	LAPIC_ID
+	.space	LAPIC_TPRI
 END(local_apic)
-	.type	_C_LABEL(lapic_id), @object
-LABEL(lapic_id)
-	.long	0x00000000
-	.space	LAPIC_TPRI-(LAPIC_ID+4)
-END(lapic_id)
 	.type	_C_LABEL(lapic_tpr), @object
 LABEL(lapic_tpr)
-	.space	LAPIC_PPRI-LAPIC_TPRI
+	.space	PAGE_SIZE-LAPIC_TPRI
 END(lapic_tpr)
-	.type	_C_LABEL(lapic_ppr), @object
-_C_LABEL(lapic_ppr):
-	.space	LAPIC_ISR-LAPIC_PPRI
-END(lapic_ppr)
-	.type	_C_LABEL(lapic_isr), @object
-_C_LABEL(lapic_isr):
-	.space	PAGE_SIZE-LAPIC_ISR
-END(lapic_isr)
 #endif /* NLAPIC > 0 */
 
 	.globl	_C_LABEL(tablesize)
@@ -985,10 +971,9 @@
 	movq	%rsi,%rdi
 	addq	$USPACE,%rdi
 	subq	$KERNBASE,%rdi	/* init_x86_64 wants a physical address */
+#endif	/* XEN */
 
-#endif	/* XEN */
 	call	_C_LABEL(init_x86_64)
-
 	call 	_C_LABEL(main)
 END(start)
 
@@ -1175,9 +1160,10 @@
 
 	/* The 32bit LWPs are handled differently. */
 	testl	$PCB_COMPAT32,PCB_FLAGS(%r14)
-	jne	32f
+	jne	lwp_64bit
 
-	/* Zero out %fs/%gs registers and GDT descriptors. */
+lwp_32bit:
+	/* Zero out %fs/%gs registers. */
 	xorq	%rax,%rax
 	movw	%ax,%fs
 	CLI(cx)
@@ -1186,6 +1172,7 @@
 	SWAPGS
 	STI(cx)
 
+	/* Zero out GDT descriptors. */
 	movq	CPUVAR(GDT),%rcx
 	movq	%rax,(GUFS_SEL*8)(%rcx)
 	movq	%rax,(GUGS_SEL*8)(%rcx)
@@ -1199,9 +1186,10 @@
 	movl	PCB_GS(%r14),%eax
 	movl	4+PCB_GS(%r14),%edx
 	wrmsr
+
 	jmp	switch_return
 
-32:
+lwp_64bit:
 	/* Reload %fs/%gs GDT descriptors. */
 	movq	CPUVAR(GDT),%rcx
 	movq	PCB_FS(%r14),%rax
@@ -1259,14 +1247,16 @@
 IDTVEC(syscall)
 #ifndef XEN
 	/*
-	 * The user %rip is in %rcx and the user %flags in %r11.
-	 * The kernel %cs and %ss are loaded, but nothing else is.
-	 * The 'swapgs' gives us access to cpu-specific memory where
-	 * we can save a user register and then read the lwps
-	 * kernel stack pointer,
-	 * This code doesn't seem to set %ds, this may not matter since it
-	 * is ignored in 64bit mode, OTOH the syscall instruction sets %ss
-	 * and that is ignored as well.
+	 * The user %rip is in %rcx and the user %rflags in %r11. The kernel %cs
+	 * and %ss are loaded, but nothing else is.
+	 *
+	 * The 'swapgs' instruction gives us access to cpu-specific memory where
+	 * we can save a user register and then read the LWP's kernel stack
+	 * pointer.
+	 *
+	 * This code doesn't seem to set %ds, this may not matter since it is
+	 * ignored in 64bit mode, OTOH the syscall instruction sets %ss and that
+	 * is ignored as well.
 	 */
 	swapgs
 	movq	%r15,CPUVAR(SCRATCH)
@@ -1276,19 +1266,18 @@
 
 	/* Make stack look like an 'int nn' frame */
 #define SP(x)	(x)-(TF_SS+8)(%r15)
-	movq	$(LSEL(LUDATA_SEL, SEL_UPL)), SP(TF_SS) /* user %ss */
-	movq	%rsp, SP(TF_RSP) 	/* User space rsp */
-
-	movq	%r11, SP(TF_RFLAGS)	/* old rflags from syscall insn */
-	movq	$(LSEL(LUCODE_SEL, SEL_UPL)), SP(TF_CS)
-	movq	%rcx, SP(TF_RIP)	/* syscall saves rip in rcx */
+	movq	$(LSEL(LUDATA_SEL, SEL_UPL)),SP(TF_SS)	/* user %ss */
+	movq	%rsp,SP(TF_RSP)				/* user %rsp */
+	movq	%r11,SP(TF_RFLAGS)			/* user %rflags */
+	movq	$(LSEL(LUCODE_SEL, SEL_UPL)),SP(TF_CS)	/* user %cs */
+	movq	%rcx,SP(TF_RIP)				/* user %rip */
 
 	leaq	SP(0),%rsp		/* %rsp now valid after frame */
 	movq	CPUVAR(SCRATCH),%r15
 #undef SP
 
 	movq	$2,TF_ERR(%rsp)		/* syscall instruction size */
-	movq	$T_ASTFLT, TF_TRAPNO(%rsp)
+	movq	$T_ASTFLT,TF_TRAPNO(%rsp)
 
 	movw	%es,TF_ES(%rsp)
 	sti
@@ -1328,27 +1317,29 @@
 	 */
 	CLI(si)
 	/* Check for ASTs on exit to user mode. */
-	movl	L_MD_ASTPENDING(%r14), %eax
-	orl	CPUVAR(WANT_PMAPLOAD), %eax
+	movl	L_MD_ASTPENDING(%r14),%eax
+	orl	CPUVAR(WANT_PMAPLOAD),%eax
 	jnz	9f
+
 #ifdef DIAGNOSTIC
 	cmpl	$IPL_NONE,CPUVAR(ILEVEL)
-	jne	3f
+	jne	spl_error
 #endif
-	testl	$(MDL_IRET | MDL_COMPAT32), L_MD_FLAGS(%r14)
+
+	testl	$(MDL_IRET|MDL_COMPAT32),L_MD_FLAGS(%r14)
 	INTR_RESTORE_GPRS
 	movw	TF_ES(%rsp),%es
 	SWAPGS
 	jnz	2f
 #ifndef XEN
-	movq	TF_RIP(%rsp), %rcx	/* %rip for sysret */
-	movq	TF_RFLAGS(%rsp), %r11	/* %flags for sysret */
-	movw	TF_DS(%rsp), %ds
-	movq	TF_RSP(%rsp), %rsp
+	movq	TF_RIP(%rsp),%rcx	/* %rip for sysret */
+	movq	TF_RFLAGS(%rsp),%r11	/* %flags for sysret */
+	movw	TF_DS(%rsp),%ds
+	movq	TF_RSP(%rsp),%rsp
 	sysretq
 #else
-	movw	TF_DS(%rsp), %ds
-	addq	$TF_RIP, %rsp
+	movw	TF_DS(%rsp),%ds
+	addq	$TF_RIP,%rsp
 	pushq	$256	/* VGCF_IN_SYSCALL */
 	jmp	HYPERVISOR_iret
 #endif
@@ -1360,13 +1351,14 @@
  * then a SIGSEGV will be signalled.
  */
 2:
-	movw	TF_DS(%rsp), %ds
-	addq	$TF_RIP, %rsp
+	movw	TF_DS(%rsp),%ds
+	addq	$TF_RIP,%rsp
 	iretq
 
-/* Report SPL error */
 #ifdef DIAGNOSTIC
-3:	movabsq	$4f, %rdi
+	/* Report SPL error */
+spl_error:
+	movabsq	$4f,%rdi
 	movl	TF_RAX(%rsp),%esi
 	movl	TF_RDI(%rsp),%edx
 	movl	%ebx,%ecx
@@ -1381,7 +1373,7 @@
 
 /* AST pending or pmap load needed */
 9:
-	cmpl	$0, CPUVAR(WANT_PMAPLOAD)
+	cmpl	$0,CPUVAR(WANT_PMAPLOAD)
 	jz	10f
 	STI(si)
 	call	_C_LABEL(do_pmap_load)
--- a/sys/arch/amd64/amd64/machdep.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/machdep.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.211.4.6 2016/07/09 20:24:49 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.211.4.7 2016/10/05 20:55:23 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.6 2016/07/09 20:24:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.211.4.7 2016/10/05 20:55:23 skrll Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -217,25 +217,22 @@
 char machine[] = "amd64";		/* CPU "architecture" */
 char machine_arch[] = "x86_64";		/* machine == machine_arch */
 
-extern struct bi_devmatch *x86_alldisks;
-extern int x86_ndisks;
-
 #ifdef CPURESET_DELAY
-int	cpureset_delay = CPURESET_DELAY;
+int cpureset_delay = CPURESET_DELAY;
 #else
-int     cpureset_delay = 2000; /* default to 2s */
+int cpureset_delay = 2000; /* default to 2s */
 #endif
 
-int	cpu_class = CPUCLASS_686;
+int cpu_class = CPUCLASS_686;
 
 #ifdef MTRR
 struct mtrr_funcs *mtrr_funcs;
 #endif
 
-uint64_t	dumpmem_low;
-uint64_t	dumpmem_high;
-int	cpu_class;
-int	use_pae;
+uint64_t dumpmem_low;
+uint64_t dumpmem_high;
+int cpu_class;
+int use_pae;
 
 #ifndef NO_SPARSE_DUMP
 int sparse_dump = 1;
@@ -255,8 +252,7 @@
 size_t dump_header_size;
 size_t dump_totalbytesleft;
 
-vaddr_t	msgbuf_vaddr;
-paddr_t msgbuf_paddr;
+vaddr_t msgbuf_vaddr;
 
 struct {
 	paddr_t paddr;
@@ -264,8 +260,12 @@
 } msgbuf_p_seg[VM_PHYSSEG_MAX];
 unsigned int msgbuf_p_cnt = 0;
 
-vaddr_t	idt_vaddr;
-paddr_t	idt_paddr;
+vaddr_t idt_vaddr;
+paddr_t idt_paddr;
+vaddr_t gdt_vaddr;
+paddr_t gdt_paddr;
+vaddr_t ldt_vaddr;
+paddr_t ldt_paddr;
 
 vaddr_t module_start, module_end;
 static struct vm_map module_map_store;
@@ -274,9 +274,9 @@
 
 struct vm_map *phys_map = NULL;
 
-extern	paddr_t avail_start, avail_end;
+extern paddr_t avail_start, avail_end;
 #ifdef XEN
-extern  paddr_t pmap_pa_start, pmap_pa_end;
+extern paddr_t pmap_pa_start, pmap_pa_end;
 #endif
 
 #ifndef XEN
@@ -292,15 +292,15 @@
  * Size of memory segments, before any memory is stolen.
  */
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
-int	mem_cluster_cnt;
+int mem_cluster_cnt;
 
-char	x86_64_doubleflt_stack[4096];
+char x86_64_doubleflt_stack[4096];
 
-int	cpu_dump(void);
-int	cpu_dumpsize(void);
-u_long	cpu_dump_mempagecnt(void);
-void	dodumpsys(void);
-void	dumpsys(void);
+int cpu_dump(void);
+int cpu_dumpsize(void);
+u_long cpu_dump_mempagecnt(void);
+void dodumpsys(void);
+void dumpsys(void);
 
 extern int time_adjusted;	/* XXX no common header */
 
@@ -323,7 +323,7 @@
 int dump_seg_count_range(paddr_t, paddr_t);
 int dumpsys_seg(paddr_t, paddr_t);
 
-void	init_x86_64(paddr_t);
+void init_x86_64(paddr_t);
 
 static int valid_user_selector(struct lwp *, uint64_t);
 
@@ -351,17 +351,15 @@
 	for (x = 0, sz = 0; x < msgbuf_p_cnt; sz += msgbuf_p_seg[x++].sz)
 		continue;
 
-	msgbuf_vaddr = uvm_km_alloc(kernel_map, sz, 0,
-	    UVM_KMF_VAONLY);
+	msgbuf_vaddr = uvm_km_alloc(kernel_map, sz, 0, UVM_KMF_VAONLY);
 	if (msgbuf_vaddr == 0)
 		panic("failed to valloc msgbuf_vaddr");
 
-	/* msgbuf_paddr was init'd in pmap */
 	for (y = 0, sz = 0; y < msgbuf_p_cnt; y++) {
 		for (x = 0; x < btoc(msgbuf_p_seg[y].sz); x++, sz += PAGE_SIZE)
 			pmap_kenter_pa((vaddr_t)msgbuf_vaddr + sz,
-				       msgbuf_p_seg[y].paddr + x * PAGE_SIZE,
-				       VM_PROT_READ | VM_PROT_WRITE, 0);
+			    msgbuf_p_seg[y].paddr + x * PAGE_SIZE,
+			    VM_PROT_READ|VM_PROT_WRITE, 0);
 	}
 
 	pmap_update(pmap_kernel());
@@ -383,9 +381,8 @@
 	 * created in locore.S, which is not big enough if we want to load many
 	 * modules dynamically. We really should be using kernel_map instead.
 	 *
-	 * But because of the R_X86_64_32 relocations that are usually present
-	 * in dynamic modules, the module map must be in low memory, and this
-	 * wouldn't been guaranteed if we were using kernel_map.
+	 * But the modules must be located above the kernel image, and that
+	 * wouldn't be guaranteed if we were using kernel_map.
 	 */
 	uvm_map_setup(&module_map_store, module_start, module_end, 0);
 	module_map_store.pmap = pmap_kernel();
@@ -1543,14 +1540,8 @@
 	int x;
 #ifndef XEN
 	int ist;
-	extern struct extent *iomem_ex;
-#if !defined(REALEXTMEM) && !defined(REALBASEMEM)
-	struct btinfo_memmap *bim;
-#endif
 #endif /* !XEN */
 
-	cpu_probe(&cpu_info_primary);
-
 #ifdef XEN
 	KASSERT(HYPERVISOR_shared_info != NULL);
 	cpu_info_primary.ci_vcpu = &HYPERVISOR_shared_info->vcpu_info[0];
@@ -1558,6 +1549,7 @@
 	__PRINTK(("init_x86_64(0x%lx)\n", first_avail));
 #endif /* XEN */
 
+	cpu_probe(&cpu_info_primary);
 	cpu_init_msrs(&cpu_info_primary, true);
 
 	use_pae = 1; /* PAE always enabled in long mode */
@@ -1596,25 +1588,10 @@
 	 */
 	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.
-	 */
-	bim = lookup_bootinfo(BTINFO_MEMMAP);
-	if (bim != NULL && bim->num > 0)
-		initx86_parse_memmap(bim, iomem_ex);
-#endif	/* ! REALBASEMEM && ! REALEXTMEM */
-
-	/*
-	 * If the loop above didn't find any valid segment, fall back to
-	 * former code.
-	 */
-	if (mem_cluster_cnt == 0)
-		initx86_fake_memmap(iomem_ex);
-
+	/* Initialize the memory clusters (needed in pmap_boostrap). */
+	init_x86_clusters();
 #else	/* XEN */
-	/* Parse Xen command line (replace bootinfo */
+	/* Parse Xen command line (replace bootinfo) */
 	xen_parse_cmdline(XEN_PARSE_BOOTFLAGS, NULL);
 
 	/* Determine physical address space */
@@ -1632,11 +1609,9 @@
 	 */
 	pmap_bootstrap(VM_MIN_KERNEL_ADDRESS);
 
-	if (avail_start != PAGE_SIZE)
-		pmap_prealloc_lowmem_ptps();
-
 #ifndef XEN
-	initx86_load_memmap(first_avail);
+	/* Internalize the physical pages into the VM system. */
+	init_x86_vm(first_avail);
 #else	/* XEN */
 	kern_end = KERNBASE + first_avail;
 	physmem = xen_start_info.nr_pages;
@@ -1651,54 +1626,53 @@
 	pmap_growkernel(VM_MIN_KERNEL_ADDRESS + 32 * 1024 * 1024);
 
 	kpreempt_disable();
+
 	pmap_kenter_pa(idt_vaddr, idt_paddr, VM_PROT_READ|VM_PROT_WRITE, 0);
+	pmap_kenter_pa(gdt_vaddr, gdt_paddr, VM_PROT_READ|VM_PROT_WRITE, 0);
+	pmap_kenter_pa(ldt_vaddr, ldt_paddr, VM_PROT_READ|VM_PROT_WRITE, 0);
 	pmap_update(pmap_kernel());
 	memset((void *)idt_vaddr, 0, PAGE_SIZE);
+	memset((void *)gdt_vaddr, 0, PAGE_SIZE);
+	memset((void *)ldt_vaddr, 0, PAGE_SIZE);
 
 #ifndef XEN
 	pmap_changeprot_local(idt_vaddr, VM_PROT_READ);
 #endif
-	pmap_kenter_pa(idt_vaddr + PAGE_SIZE, idt_paddr + PAGE_SIZE,
-	    VM_PROT_READ|VM_PROT_WRITE, 0);
-#ifdef XEN
-	/* Steal one more page for LDT */
-	pmap_kenter_pa(idt_vaddr + 2 * PAGE_SIZE, idt_paddr + 2 * PAGE_SIZE,
-	    VM_PROT_READ|VM_PROT_WRITE, 0);
-#endif
+
 	pmap_update(pmap_kernel());
 
 #ifndef XEN
-	idt_init();
 	idt = (struct gate_descriptor *)idt_vaddr;
-	gdtstore = (char *)(idt + NIDT);
-	ldtstore = gdtstore + DYNSEL_START;
 #else
 	xen_idt = (struct trap_info *)idt_vaddr;
 	xen_idt_idx = 0;
-	/* Xen wants page aligned GDT/LDT in separated pages */
-	ldtstore = (char *) roundup((vaddr_t) (xen_idt + NIDT), PAGE_SIZE);
-	gdtstore = (char *) (ldtstore + PAGE_SIZE);
-#endif /* XEN */
+#endif
+	gdtstore = (char *)gdt_vaddr;
+	ldtstore = (char *)ldt_vaddr;
 
-	/* make gdt gates and memory segments */
+	/*
+	 * Make GDT gates and memory segments.
+	 */
 	set_mem_segment(GDT_ADDR_MEM(gdtstore, GCODE_SEL), 0,
 	    0xfffff, SDT_MEMERA, SEL_KPL, 1, 0, 1);
 
 	set_mem_segment(GDT_ADDR_MEM(gdtstore, GDATA_SEL), 0,
 	    0xfffff, SDT_MEMRWA, SEL_KPL, 1, 0, 1);
 
-#ifndef XEN
-	set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore,
-	    LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0);
-#endif
-
 	set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE_SEL), 0,
 	    x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 0, 1);
 
 	set_mem_segment(GDT_ADDR_MEM(gdtstore, GUDATA_SEL), 0,
 	    x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 0, 1);
 
-	/* make ldt gates and memory segments */
+#ifndef XEN
+	set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore,
+	    LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0);
+#endif
+
+	/*
+	 * Make LDT gates and memory segments.
+	 */
 	setgate((struct gate_descriptor *)(ldtstore + LSYS5CALLS_SEL),
 	    &IDTVEC(oosyscall), 0, SDT_SYS386CGT, SEL_UPL,
 	    GSEL(GCODE_SEL, SEL_KPL));
@@ -1733,7 +1707,7 @@
 	    SDT_MEMRWA, SEL_UPL, 1, 1, 0);
 
 	/*
-	 * Other entries.
+	 * Other LDT entries.
 	 */
 	memcpy((struct gate_descriptor *)(ldtstore + LSOL26CALLS_SEL),
 	    (struct gate_descriptor *)(ldtstore + LSYS5CALLS_SEL),
@@ -1742,8 +1716,8 @@
 	    (struct gate_descriptor *)(ldtstore + LSYS5CALLS_SEL),
 	    sizeof (struct gate_descriptor));
 
-	/* exceptions */
-	for (x = 0; x < 32; x++) {
+	/* CPU-specific IDT exceptions. */
+	for (x = 0; x < NCPUIDT; x++) {
 #ifndef XEN
 		idt_vec_reserve(x);
 		switch (x) {
@@ -1854,8 +1828,6 @@
 	 */
 	kpreempt_disable();
 	pmap_changeprot_local(idt_vaddr, VM_PROT_READ|VM_PROT_WRITE);
-	pmap_changeprot_local(idt_vaddr + PAGE_SIZE,
-	    VM_PROT_READ|VM_PROT_WRITE);
 	memset((void *)idt, 0, NIDT * sizeof(idt[0]));
 	kpreempt_enable();
 	breakpoint();
--- a/sys/arch/amd64/amd64/mptramp.S	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/mptramp.S	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mptramp.S,v 1.17.6.2 2016/05/29 08:44:15 skrll Exp $	*/
+/*	$NetBSD: mptramp.S,v 1.17.6.3 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 2000, 2016 The NetBSD Foundation, Inc.
@@ -42,11 +42,11 @@
  *    documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software
  *    must display the following acknowledgement:
- *      This product includes software developed by the NetBSD 
- *      Foundation, Inc. and its contributors.  
- * 4. Neither the name of The NetBSD Foundation nor the names of its 
- *    contributors may be used to endorse or promote products derived  
- *    from this software without specific prior written permission.   
+ *      This product includes software developed by the NetBSD
+ *      Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -116,7 +116,6 @@
 	.global _C_LABEL(cpu_spinup_trampoline_end)
 	.global _C_LABEL(cpu_hatch)
 	.global _C_LABEL(mp_pdirpa)
-	.global _C_LABEL(local_apic)
 
 	.text
 	.align 4,0x0
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.92.6.2 2015/12/27 12:09:28 skrll Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.92.6.3 2016/10/05 20:55:23 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.2 2015/12/27 12:09:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.92.6.3 2016/10/05 20:55:23 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -81,7 +81,7 @@
 
 /* Provide a the name of the architecture we're emulating */
 const char	machine32[] = "i386";
-const char	machine_arch32[] = "i386";	
+const char	machine_arch32[] = "i386";
 
 #ifdef MTRR
 static int x86_64_get_mtrr32(struct lwp *, void *, register_t *);
@@ -116,7 +116,7 @@
 	pcb = lwp_getpcb(l);
 
 #if defined(USER_LDT) && 0
-	pmap_ldt_cleanup(p);
+	pmap_ldt_cleanup(l);
 #endif
 
 	netbsd32_adjust_limits(p);
@@ -435,7 +435,7 @@
 #ifdef COREDUMP
 /*
  * Dump the machine specific segment at the start of a core dump.
- */     
+ */
 struct md_core32 {
 	struct reg32 intreg;
 	struct fpreg32 freg;
@@ -973,7 +973,7 @@
 		return error;
 
 	tf->tf_gs = context.sc_gs;
-	tf->tf_fs = context.sc_fs;		
+	tf->tf_fs = context.sc_fs;
 	tf->tf_es = context.sc_es;
 	tf->tf_ds = context.sc_ds;
 	tf->tf_rflags = context.sc_eflags;
--- a/sys/arch/amd64/amd64/trap.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/trap.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.79.2.2 2015/12/27 12:09:28 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.79.2.3 2016/10/05 20:55:23 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.2 2015/12/27 12:09:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.79.2.3 2016/10/05 20:55:23 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -374,7 +374,7 @@
 		case 0x848e:	/* mov 0xa8(%rsp),%es (8e 84 24 a8 00 00 00) */
 		case 0x9c8e:	/* mov 0xb0(%rsp),%ds (8e 9c 24 b0 00 00 00) */
 			/*
-			 * We faulted loading one if the user segment registers.
+			 * We faulted loading one of the user segment registers.
 			 * The stack frame containing the user registers is
 			 * still valid and pointed to by tf_rsp.
 			 * Maybe we should check the iretq follows.
@@ -724,7 +724,7 @@
 	userret(l);
 }
 
-/* 
+/*
  * startlwp: start of a new LWP.
  */
 void
--- a/sys/arch/amd64/amd64/vector.S	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/amd64/vector.S	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.44.10.1 2015/12/27 12:09:28 skrll Exp $	*/
+/*	$NetBSD: vector.S,v 1.44.10.2 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -107,30 +107,22 @@
  * If the interrupt frame is made more flexible,  INTR can push %eax first and
  * decide the ipending case with less overhead, e.g., by avoiding loading the
  * segment registers.
- *
  */
 
-/* XXX See comment in locore.s */
-#ifdef __ELF__
-#define	XINTR(name,num)		Xintr_ ## name ## num
-#else
-#define	XINTR(name,num)		_Xintr_ ## name ## num
-#endif
-
 #if NLAPIC > 0
 #ifdef MULTIPROCESSOR
 IDTVEC(recurse_lapic_ipi)
 	INTR_RECURSE_HWFRAME
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	jmp	1f
 IDTVEC_END(recurse_lapic_ipi)
 
 IDTVEC(intr_lapic_ipi)
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 	movl	CPUVAR(ILEVEL),%ebx
 	cmpl	$IPL_HIGH,%ebx
@@ -166,22 +158,22 @@
 IDTVEC_END(intrddb)
 #endif /* DDB */
 #endif /* MULTIPROCESSOR */
-	
+
 	/*
 	 * Interrupt from the local APIC timer.
 	 */
 IDTVEC(recurse_lapic_ltimer)
 	INTR_RECURSE_HWFRAME
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	jmp	1f
 IDTVEC_END(recurse_lapic_ltimer)
 
 IDTVEC(intr_lapic_ltimer)
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 	movl	CPUVAR(ILEVEL),%ebx
 	cmpl	$IPL_CLOCK,%ebx
@@ -211,7 +203,7 @@
 	pushq	$0
 	pushq	$T_ASTFLT
 	INTRENTRY
-	movl	$0, _C_LABEL(local_apic)+LAPIC_EOI
+	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 	callq	_C_LABEL(pmap_tlb_intr)
 	INTRFASTEXIT
 IDTVEC_END(intr_lapic_tlb)
@@ -236,14 +228,14 @@
 IDTVEC(resume_ ## name ## num)						\
 	movq	$IREENT_MAGIC,TF_ERR(%rsp)				;\
 	movl	%ebx,%r13d						;\
-	movq	CPUVAR(ISOURCES) + (num) * 8, %r14			;\
+	movq	CPUVAR(ISOURCES) + (num) * 8,%r14			;\
 	movl	IS_MAXLEVEL(%r14),%ebx					;\
 	jmp	1f							;\
 IDTVEC(intr_ ## name ## num)						;\
 	pushq	$0			/* dummy error code */		;\
 	pushq	$T_ASTFLT		/* trap # for doing ASTs */	;\
 	INTRENTRY							;\
-	movq	CPUVAR(ISOURCES) + (num) * 8, %r14			;\
+	movq	CPUVAR(ISOURCES) + (num) * 8,%r14			;\
 	mask(num)			/* mask it in hardware */	;\
 	early_ack(num)			/* and allow other intrs */	;\
 	testq	%r14,%r14						;\
@@ -279,14 +271,14 @@
 	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
 7:									\
 	cli								;\
-	orl     $(1 << num),CPUVAR(IPENDING)				;\
+	orl	$(1 << num),CPUVAR(IPENDING)				;\
 	level_mask(num)							;\
 	late_ack(num)							;\
 	sti								;\
 	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
 10:									\
 	cli								;\
-	orl     $(1 << num),CPUVAR(IPENDING)				;\
+	orl	$(1 << num),CPUVAR(IPENDING)				;\
 	level_mask(num)							;\
 	late_ack(num)							;\
 	INTRFASTEXIT							;\
@@ -581,39 +573,39 @@
 /* Resume/recurse procedures for spl() */
 #define	XENINTRSTUB(name, num, early_ack, late_ack, mask, unmask, level_mask) \
 IDTVEC(recurse_ ## name ## num)						;\
-  	INTR_RECURSE_HWFRAME						;\
-  	subq	$8,%rsp							;\
-  	pushq	$T_ASTFLT		/* trap # for doing ASTs */	;\
-  	INTRENTRY							;\
+	INTR_RECURSE_HWFRAME						;\
+	subq	$8,%rsp							;\
+	pushq	$T_ASTFLT		/* trap # for doing ASTs */	;\
+	INTRENTRY							;\
 IDTVEC(resume_ ## name ## num)						\
-  	movq	$IREENT_MAGIC,TF_ERR(%rsp)				;\
-  	movl	%ebx,%r13d						;\
-  	movq	CPUVAR(ISOURCES) + (num) * 8, %r14			;\
+	movq	$IREENT_MAGIC,TF_ERR(%rsp)				;\
+	movl	%ebx,%r13d						;\
+	movq	CPUVAR(ISOURCES) + (num) * 8,%r14			;\
 1:									\
-  	pushq	%r13							;\
-  	movl	$num,CPUVAR(ILEVEL)					;\
-  	STI(si)								;\
-  	incl	CPUVAR(IDEPTH)						;\
-  	movq	IS_HANDLERS(%r14),%rbx					;\
+	pushq	%r13							;\
+	movl	$num,CPUVAR(ILEVEL)					;\
+	STI(si)								;\
+	incl	CPUVAR(IDEPTH)						;\
+	movq	IS_HANDLERS(%r14),%rbx					;\
 6:									\
-  	movq	IH_ARG(%rbx),%rdi					;\
-  	movq	%rsp,%rsi						;\
-  	call	*IH_FUN(%rbx)		/* call it */			;\
-  	movq	IH_IPL_NEXT(%rbx),%rbx	/* next handler in chain */	;\
-  	testq	%rbx,%rbx						;\
-  	jnz	6b							;\
+	movq	IH_ARG(%rbx),%rdi					;\
+	movq	%rsp,%rsi						;\
+	call	*IH_FUN(%rbx)		/* call it */			;\
+	movq	IH_IPL_NEXT(%rbx),%rbx	/* next handler in chain */	;\
+	testq	%rbx,%rbx						;\
+	jnz	6b							;\
 5:									\
-  	CLI(si)								;\
-  	unmask(num)			/* unmask it in hardware */	;\
-  	late_ack(num)							;\
-  	STI(si)								;\
-  	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
-  
-# The unmask func for Xen events
+	CLI(si)								;\
+	unmask(num)			/* unmask it in hardware */	;\
+	late_ack(num)							;\
+	STI(si)								;\
+	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
+
+/* The unmask func for Xen events */
 #define hypervisor_asm_unmask(num)			\
-  	movq $num, %rdi					;\
-  	call _C_LABEL(hypervisor_enable_ipl)
-  
+	movq	$num,%rdi				;\
+	call	_C_LABEL(hypervisor_enable_ipl)
+
 XENINTRSTUB(xenev,0,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
 XENINTRSTUB(xenev,1,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
 XENINTRSTUB(xenev,2,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
@@ -682,19 +674,21 @@
 	.quad _C_LABEL(Xrecurse_xenev31), _C_LABEL(Xresume_xenev31)
 END(xenev_stubs)
 
-# Xen callbacks
+/*
+ * Xen callbacks
+ */
 
-# Hypervisor callback
+/* Hypervisor callback */
 NENTRY(hypervisor_callback)
 	movq	(%rsp),%rcx
 	movq	8(%rsp),%r11
 	addq	$16,%rsp
-	pushq	$0	# Dummy error code
+	pushq	$0		/* Dummy error code */
 	pushq	$T_ASTFLT
 	INTRENTRY
-	# sti??
-	movq	%rsp, %rdi
-	subq	$8, %rdi; /* don't forget if_ppl */
+	/* sti?? */
+	movq	%rsp,%rdi
+	subq	$8,%rdi;	/* don't forget if_ppl */
 	call	do_hypervisor_callback
 	testb	$SEL_RPL,TF_CS(%rsp)
 	jnz	doreti_checkast
@@ -702,7 +696,7 @@
 	INTRFASTEXIT
 END(hypervisor_callback)
 
-# Panic?
+/* Panic? */
 NENTRY(failsafe_callback)
 	movq	(%rsp),%rcx
 	movq	8(%rsp),%r11
@@ -710,11 +704,11 @@
 	pushq	$0
 	pushq	$T_ASTFLT
 	INTRENTRY
-	movq	%rsp, %rdi
-	subq	$8, %rdi; /* don't forget if_ppl */
+	movq	%rsp,%rdi
+	subq	$8,%rdi;	/* don't forget if_ppl */
 	call	xen_failsafe_handler
 	INTRFASTEXIT
-#	jmp	HYPERVISOR_iret
+/*	jmp	HYPERVISOR_iret */
 END(failsafe_callback)
 
 #endif	/* !XEN */
--- a/sys/arch/amd64/conf/ALL	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/conf/ALL	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.23.2.5 2016/05/29 08:44:15 skrll Exp $
+# $NetBSD: ALL,v 1.23.2.6 2016/10/05 20:55:23 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.5 $"
+#ident 		"ALL-$Revision: 1.23.2.6 $"
 
 maxusers	64		# estimated number of users
 
@@ -219,7 +219,7 @@
 options 	INET6		# IPv6
 options 	IPSEC		# IP security
 #options 	IPSEC_DEBUG	# debug for IP security
-options 	MPLS		# MultiProtocol Label Switching (needs ifmpls)
+options 	MPLS		# MultiProtocol Label Switching (needs mpls)
 options 	MROUTING	# IP multicast routing
 options 	PIM		# Protocol Independent Multicast
 options 	NETATALK	# AppleTalk networking protocols
@@ -671,6 +671,13 @@
 spdmem* at iic? addr 0x56
 spdmem* at iic? addr 0x57
 sdtemp* at iic? addr 0x18
+sdtemp* at iic? addr 0x19
+sdtemp* at iic? addr 0x1a
+sdtemp* at iic? addr 0x1b
+sdtemp* at iic? addr 0x1c
+sdtemp* at iic? addr 0x1d
+sdtemp* at iic? addr 0x1e
+sdtemp* at iic? addr 0x1f
 
 # I2O devices
 iop*	at pci? dev ? function ?	# I/O processor
@@ -689,6 +696,10 @@
 # 1-Wire devices
 owtemp* 	at onewire?			# Temperature sensors
 
+# I2C support
+gpioiic*	at gpio?
+iic*		at gpioiic?
+
 # Keylock support
 gpiolock*	at gpio?
 
@@ -1540,7 +1551,7 @@
 pseudo-device	bpfilter		# Berkeley packet filter
 pseudo-device	carp			# Common Address Redundancy Protocol
 pseudo-device	ipfilter		# IP filter (firewall) and NAT
-pseudo-device	ifmpls			# MPLS pseudo-interface
+pseudo-device	mpls			# MPLS pseudo-interface
 pseudo-device	loop			# network loopback
 pseudo-device	ppp			# Point-to-Point Protocol
 pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
--- a/sys/arch/amd64/conf/GENERIC	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/conf/GENERIC	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.404.2.9 2016/07/09 20:24:49 skrll Exp $
+# $NetBSD: GENERIC,v 1.404.2.10 2016/10/05 20:55:23 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.9 $"
+#ident 		"GENERIC-$Revision: 1.404.2.10 $"
 
 maxusers	64		# estimated number of users
 
@@ -190,7 +190,7 @@
 options 	INET6		# IPV6
 options 	IPSEC		# IP security
 #options 	IPSEC_DEBUG	# debug for IP security
-#options 	MPLS		# MultiProtocol Label Switching (needs ifmpls)
+#options 	MPLS		# MultiProtocol Label Switching (needs mpls)
 #options 	MROUTING	# IP multicast routing
 #options 	PIM		# Protocol Independent Multicast
 options 	NETATALK	# AppleTalk networking protocols
@@ -534,6 +534,14 @@
 #spdmem* at iic? addr 0x55
 #spdmem* at iic? addr 0x56
 #spdmem* at iic? addr 0x57
+#sdtemp* at iic? addr 0x18
+#sdtemp* at iic? addr 0x19
+#sdtemp* at iic? addr 0x1a
+#sdtemp* at iic? addr 0x1b
+#sdtemp* at iic? addr 0x1c
+#sdtemp* at iic? addr 0x1d
+#sdtemp* at iic? addr 0x1e
+#sdtemp* at iic? addr 0x1f
 
 # I2O devices
 iop*	at pci? dev ? function ?	# I/O processor
@@ -1247,7 +1255,7 @@
 #pseudo-device	carp			# Common Address Redundancy Protocol
 pseudo-device	ipfilter		# IP filter (firewall) and NAT
 pseudo-device	loop			# network loopback
-#pseudo-device	ifmpls			# MPLS pseudo-interface
+#pseudo-device	mpls			# MPLS pseudo-interface
 pseudo-device	ppp			# Point-to-Point Protocol
 pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
 pseudo-device	sl			# Serial Line IP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amd64/conf/MODULAR	Wed Oct 05 20:55:23 2016 +0000
@@ -0,0 +1,137 @@
+# $NetBSD: MODULAR,v 1.5.2.2 2016/10/05 20:55:23 skrll Exp $
+#
+# Try to exclude all the drivers in GENERIC that have been modularized
+# XXX: incomplete
+
+include "arch/amd64/conf/GENERIC"
+options 	MODULAR		# new style module(7) framework
+options 	MODULAR_DEFAULT_AUTOLOAD
+
+-no acpicpu*	at cpu?
+-no est0		at cpu0
+-no powernow0	at cpu0
+-no vmt0		at cpu0
+
+-no options 	COMPAT_15	# NetBSD 1.5,
+-no options 	COMPAT_16	# NetBSD 1.6,
+-no options 	COMPAT_20	# NetBSD 2.0,
+-no options 	COMPAT_30	# NetBSD 3.0,
+-no options 	COMPAT_40	# NetBSD 4.0,
+-no options 	COMPAT_50	# NetBSD 5.0,
+-no options 	COMPAT_60	# NetBSD 6.0, and
+-no options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+-no options 	COMPAT_43	# and 4.3BSD
+#options 	COMPAT_386BSD_MBRPART # recognize old partition ID
+
+-no options 	COMPAT_OSSAUDIO
+-no options 	COMPAT_NETBSD32
+-no options 	COMPAT_LINUX
+-no options 	COMPAT_LINUX32	# req. COMPAT_LINUX and COMPAT_NETBSD32
+-no options 	EXEC_ELF32
+-no options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+-no options	SYSVMSG		# System V-like message queues
+-no options	SYSVSEM		# System V-like semaphores
+-no options	SYSVSHM		# System V-like memory sharing
+
+# XXX: for now
+#no file-system 	FFS		# UFS
+-no file-system	MFS		# memory file system
+-no file-system 	NFS		# Network File System client
+-no file-system	TMPFS		# Efficient memory file-system
+-no file-system	EXT2FS		# second extended file system (linux)
+-no file-system	LFS		# log-structured file system
+-no file-system	NTFS		# Windows/NT file system (experimental)
+-no file-system	CD9660		# ISO 9660 + Rock Ridge file system
+-no file-system	MSDOSFS		# MS-DOS file system
+-no file-system	FDESC		# /dev/fd
+-no file-system	KERNFS		# /kern
+-no file-system	NULLFS		# loopback file system
+-no file-system	OVERLAY		# overlay file system
+-no file-system	PROCFS		# /proc
+-no file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+-no file-system	SMBFS		# experimental - CIFS; also needs nsmb (below)
+-no file-system	UMAPFS		# NULLFS + uid and gid remapping
+-no file-system	UNION		# union file system
+-no file-system	CODA		# Coda File System; also needs vcoda (below)
+-no file-system	PTYFS		# /dev/ptm support
+
+-no options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+-no options 	PPP_DEFLATE	# Deflate compression support for PPP
+
+-no options	AIO
+
+-no acpiacad*	at acpi?		# ACPI AC Adapter
+-no acpibat*	at acpi?		# ACPI Battery
+-no acpibut*	at acpi?		# ACPI Button
+-no acpifan*	at acpi?		# ACPI Fan
+-no acpilid*	at acpi?		# ACPI Lid Switch
+-no acpitz* 	at acpi?		# ACPI Thermal Zone
+-no acpivga*	at acpi?		# ACPI Display Adapter
+-no acpiwdrt*	at acpi?		# ACPI Watchdog Resource Table
+-no acpiwmi*	at acpi?		# ACPI WMI Mapper
+
+-no options	NFSSERVER
+
+-no axe*	at uhub?
+-no axen*	at uhub?
+-no rum*	at uhub?
+-no urtwn*	at uhub?
+-no urtw*	at uhub?
+-no run*	at uhub?
+-no athn*	at uhub?
+
+-no alc*	at pci?
+-no ath*	at pci?
+
+-no select sppp			# Synchronous-Point-to-Point Protocol
+
+-no pseudo-device 	crypto			# /dev/crypto device
+-no pseudo-device	swcrypto		# software crypto implementation
+
+# disk/mass storage pseudo-devices
+-no pseudo-device	ccd			# concatenated/striped disk devices
+-no pseudo-device	cgd			# cryptographic disk devices
+-no pseudo-device	raid			# RAIDframe disk driver
+-no pseudo-device	fss			# file system snapshot device
+-no pseudo-device	putter			# for puffs and pud
+
+-no pseudo-device	vnd			# disk-like interface to files
+
+# network pseudo-devices
+-no pseudo-device	bpfilter		# Berkeley packet filter
+-no pseudo-device	ipfilter		# IP filter (firewall) and NAT
+# Loopback is hardcoded (looutput) everywhere!
+#no pseudo-device	loop			# network loopback
+-no pseudo-device	mpls			# MPLS pseudo-interface
+-no pseudo-device	ppp			# Point-to-Point Protocol
+-no pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
+-no pseudo-device	sl			# Serial Line IP
+-no pseudo-device	strip			# Starmode Radio IP (Metricom)
+-no pseudo-device	tun			# network tunneling over tty
+-no pseudo-device	tap			# virtual Ethernet
+-no pseudo-device	gre			# generic L3 over IP tunnel
+-no pseudo-device	gif			# IPv[46] over IPv[46] tunnel (RFC1933)
+-no pseudo-device	faith			# IPv[46] tcp relay translation i/f
+-no pseudo-device	stf			# 6to4 IPv6 over IPv4 encapsulation
+-no pseudo-device	vlan			# IEEE 802.1q encapsulation
+-no pseudo-device	agr			# IEEE 802.3ad link aggregation
+-no pseudo-device	npf			# NPF packet filter
+
+#
+# accept filters
+-no pseudo-device   accf_data		# "dataready" accept filter
+-no pseudo-device   accf_http		# "httpready" accept filter
+
+# miscellaneous pseudo-devices
+-no pseudo-device	clockctl		# user control of clock subsystem
+-no pseudo-device	vcoda			# coda minicache <-> venus comm.
+
+# a pseudo device needed for SMBFS
+-no pseudo-device	nsmb			# experimental - SMB requester
+
+# pseudo audio device driver
+-no pseudo-device	pad
+
+# userland interface to drivers, including autoconf and properties retrieval
+-no pseudo-device	drvctl
--- a/sys/arch/amd64/conf/XEN3_DOM0	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/conf/XEN3_DOM0	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.112.2.6 2016/05/29 08:44:15 skrll Exp $
+# $NetBSD: XEN3_DOM0,v 1.112.2.7 2016/10/05 20:55:23 skrll Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -301,11 +301,33 @@
 amdpm*	at pci? dev ? function ?	# RNG and SMBus 1.0 interface
 #iic*	at amdpm?			# sensors below are on this bus
 
+# Intel ICH SMBus controller
+ichsmb* at pci? dev ? function ?
+iic*	at ichsmb?
+
 # Thermal monitor and fan controller
 #dbcool* at iic? addr 0x2C		# Unknown other motherboard(s)
 #dbcool* at iic? addr 0x2D		# Tyan S2881
 #dbcool* at iic? addr 0x2E		# Tyan S2882-D
 
+# Serial Presence Detect capable memory modules
+#spdmem* at iic? addr 0x50
+#spdmem* at iic? addr 0x51
+#spdmem* at iic? addr 0x52
+#spdmem* at iic? addr 0x53
+#spdmem* at iic? addr 0x54
+#spdmem* at iic? addr 0x55
+#spdmem* at iic? addr 0x56
+#spdmem* at iic? addr 0x57
+#sdtemp* at iic? addr 0x18
+#sdtemp* at iic? addr 0x19
+#sdtemp* at iic? addr 0x1a
+#sdtemp* at iic? addr 0x1b
+#sdtemp* at iic? addr 0x1c
+#sdtemp* at iic? addr 0x1d
+#sdtemp* at iic? addr 0x1e
+#sdtemp* at iic? addr 0x1f
+
 # Winbond LPC Super I/O
 #wbsio*	at isa? port 0x2e
 #wbsio*	at isa? port 0x4e
--- a/sys/arch/amd64/conf/kern.ldscript.Xen	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/conf/kern.ldscript.Xen	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern.ldscript.Xen,v 1.5.2.2 2016/05/29 08:44:15 skrll Exp $	*/
+/*	$NetBSD: kern.ldscript.Xen,v 1.5.2.3 2016/10/05 20:55:23 skrll Exp $	*/
 
 #include "assym.h"
 
@@ -7,24 +7,26 @@
 ENTRY(_start)
 SECTIONS
 {
-	/* Read-only sections, merged into text segment: */
 	.text :
 	{
 		*(.text)
 		*(.text.*)
 		*(.stub)
-		*(.rodata)
 	}
 	_etext = . ;
 	PROVIDE (etext = .) ;
 
-	/*
-	 * 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));
+	. = ALIGN(__PAGE_SIZE);
 
 	__rodata_start = . ;
+	.rodata :
+	{
+		*(.rodata)
+		*(.rodata.*)
+	}
+
+	. = ALIGN(__PAGE_SIZE);
+
 	__data_start = . ;
 	.data :
 	{
@@ -53,7 +55,12 @@
 		*(COMMON)
 		. = ALIGN(64 / 8);
 	}
-	. = ALIGN(64 / 8);
+
+	. = ALIGN(__PAGE_SIZE);
+
+	/* End of the kernel image */
+	__kernel_end = . ;
+
 	_end = . ;
 	PROVIDE (end = .) ;
 	.note.netbsd.ident :
--- a/sys/arch/amd64/conf/std.xen	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/conf/std.xen	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: std.xen,v 1.7 2014/10/11 09:50:03 uebayasi Exp $
+# $NetBSD: std.xen,v 1.7.2.1 2016/10/05 20:55:23 skrll Exp $
 # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp 
 #
 # standard, required NetBSD/i386 'options'
@@ -13,3 +13,6 @@
 options 	EXEC_ELF64	# exec ELF binaries
 options 	EXEC_SCRIPT	# exec #! scripts
 options 	MTRR
+
+options 	CHILD_MAX=1024	# 160 is too few
+options 	OPEN_MAX=1024	# 128 is too few
--- a/sys/arch/amd64/include/gdt.h	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/include/gdt.h	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdt.h,v 1.7 2010/07/07 01:14:52 chs Exp $	*/
+/*	$NetBSD: gdt.h,v 1.7.36.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -42,8 +42,8 @@
 int tss_alloc(struct x86_64_tss *);
 void tss_free(int);
 
-void ldt_alloc(struct pmap *, char *, size_t);
-void ldt_free(struct pmap *);
+int ldt_alloc(void *, size_t);
+void ldt_free(int);
 
 void set_sys_gdt(int, void *, size_t, int, int, int);
 #endif
--- a/sys/arch/amd64/include/i82093reg.h	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/include/i82093reg.h	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.5 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.5.60.1 2016/10/05 20:55:23 skrll Exp $ */
 
 #include <x86/i82093reg.h>
 
@@ -9,7 +9,7 @@
 #endif
 
 #define ioapic_asm_ack(num) \
-	movl	$0,(_C_LABEL(local_apic)+LAPIC_EOI)(%rip)
+	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 
 #ifdef MULTIPROCESSOR
 
--- a/sys/arch/amd64/include/pmap.h	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/include/pmap.h	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.34.16.2 2016/05/29 08:44:15 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.34.16.3 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -84,7 +84,7 @@
 #endif /* XEN */
 
 /*
- * The x86_64 pmap module closely resembles the i386 one and it 
+ * The x86_64 pmap module closely resembles the i386 one and it
  * uses the same recursive entry scheme. See the i386 pmap.h
  * for a description. The obvious difference is that 3 extra
  * levels of page table need to be dealt with. The level 1 page
@@ -323,7 +323,6 @@
 }
 #endif
 
-void pmap_prealloc_lowmem_ptps(void);
 void pmap_changeprot_local(vaddr_t, vm_prot_t);
 
 #include <x86/pmap_pv.h>
--- a/sys/arch/amd64/include/segments.h	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/include/segments.h	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: segments.h,v 1.24 2013/01/07 17:03:06 chs Exp $	*/
+/*	$NetBSD: segments.h,v 1.24.14.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -95,17 +95,17 @@
  * Selectors
  */
 
-#define	ISPL(s)		((s) & SEL_RPL)	/* what is the priority level of a selector */
+#define ISPL(s)		((s) & SEL_RPL)	/* what is the priority level of a selector */
 #ifdef XEN
-#define	SEL_KPL		3		/* kernel privilege level */	
-#define	SEL_XPL		0		/* Xen Hypervisor privilege level */	
+#define SEL_KPL		3		/* kernel privilege level */
+#define SEL_XPL		0		/* Xen Hypervisor privilege level */
 #else
-#define	SEL_KPL		0		/* kernel privilege level */	
+#define SEL_KPL		0		/* kernel privilege level */
 #endif
-#define	SEL_UPL		3		/* user privilege level */	
-#define	SEL_RPL		3		/* requester's privilege level mask */
-#define	ISLDT(s)	((s) & SEL_LDT)	/* is it local or global */
-#define	SEL_LDT		4		/* local descriptor table */	
+#define SEL_UPL		3		/* user privilege level */
+#define SEL_RPL		3		/* requester's privilege level mask */
+#define ISLDT(s)	((s) & SEL_LDT)	/* is it local or global */
+#define SEL_LDT		4		/* local descriptor table */
 
 /* Dynamically allocated TSSs and LDTs start (byte offset) */
 #define SYSSEL_START	(NGDT_MEM << 3)
@@ -120,24 +120,24 @@
  * The rest is 16-byte descriptors for TSS and LDT.
  */
 
-#define	IDXSEL(s)	(((s) >> 3) & 0x1fff)
+#define IDXSEL(s)	(((s) >> 3) & 0x1fff)
 #define IDXDYNSEL(s)	((((s) & ~SEL_RPL) - DYNSEL_START) >> 4)
 
-#define	GSEL(s,r)	(((s) << 3) | r)
-#define	GSYSSEL(s,r)	((((s) << 4) + SYSSEL_START) | r)
+#define GSEL(s,r)	(((s) << 3) | r)
+#define GSYSSEL(s,r)	((((s) << 4) + SYSSEL_START) | r)
 #define GDYNSEL(s,r)	((((s) << 4) + DYNSEL_START) | r | SEL_KPL)
 
 #define LSEL(s,r)	((s) | r | SEL_LDT)
 
-#define	USERMODE(c, f)		(ISPL(c) == SEL_UPL)
+#define USERMODE(c, f)		(ISPL(c) == SEL_UPL)
 #ifdef XEN
 /*
  * As KPL == UPL, Xen emulate interrupt in kernel context by pushing
  * a fake CS with XPL privilege
  */
-#define	KERNELMODE(c, f)	(ISPL(c) == SEL_XPL)
+#define KERNELMODE(c, f)	(ISPL(c) == SEL_XPL)
 #else
-#define	KERNELMODE(c, f)	(ISPL(c) == SEL_KPL)
+#define KERNELMODE(c, f)	(ISPL(c) == SEL_KPL)
 #endif
 
 #ifndef _LOCORE
@@ -147,38 +147,38 @@
  */
 
 /*
- * Below is used for TSS and LDT.
+ * System segment descriptor (16 bytes): used for TSS and LDT.
  */
 struct sys_segment_descriptor {
-/*BITFIELDTYPE*/ uint64_t sd_lolimit:16;/* segment extent (lsb) */
-/*BITFIELDTYPE*/ uint64_t sd_lobase:24;/* segment base address (lsb) */
-/*BITFIELDTYPE*/ uint64_t sd_type:5;	/* segment type */
-/*BITFIELDTYPE*/ uint64_t sd_dpl:2;	/* segment descriptor priority level */
-/*BITFIELDTYPE*/ uint64_t sd_p:1;	/* segment descriptor present */
-/*BITFIELDTYPE*/ uint64_t sd_hilimit:4;/* segment extent (msb) */
-/*BITFIELDTYPE*/ uint64_t sd_xx1:3;	/* avl, long and def32 (not used) */
-/*BITFIELDTYPE*/ uint64_t sd_gran:1;	/* limit granularity (byte/page) */
-/*BITFIELDTYPE*/ uint64_t sd_hibase:40;/* segment base address (msb) */
-/*BITFIELDTYPE*/ uint64_t sd_xx2:8;	/* reserved */
-/*BITFIELDTYPE*/ uint64_t sd_zero:5;	/* must be zero */
-/*BITFIELDTYPE*/ uint64_t sd_xx3:19;	/* reserved */
+	uint64_t sd_lolimit:16;	/* segment extent (lsb) */
+	uint64_t sd_lobase:24;	/* segment base address (lsb) */
+	uint64_t sd_type:5;	/* segment type */
+	uint64_t sd_dpl:2;	/* segment descriptor priority level */
+	uint64_t sd_p:1;	/* segment descriptor present */
+	uint64_t sd_hilimit:4;	/* segment extent (msb) */
+	uint64_t sd_xx1:3;	/* avl, long and def32 (not used) */
+	uint64_t sd_gran:1;	/* limit granularity (byte/page) */
+	uint64_t sd_hibase:40;	/* segment base address (msb) */
+	uint64_t sd_xx2:8;	/* reserved */
+	uint64_t sd_zero:5;	/* must be zero */
+	uint64_t sd_xx3:19;	/* reserved */
 } __packed;
 
 /*
- * Below is used for cs, ds, etc.
+ * Memory segment descriptor (8 bytes): used for cs, ds, etc.
  */
 struct mem_segment_descriptor {
-	unsigned sd_lolimit:16;         /* segment extent (lsb) */
-	unsigned sd_lobase:24;          /* segment base address (lsb) */
-	unsigned sd_type:5;             /* segment type */
-	unsigned sd_dpl:2;              /* segment descriptor priority level */
-	unsigned sd_p:1;                /* segment descriptor present */
-	unsigned sd_hilimit:4;          /* segment extent (msb) */
-	unsigned sd_avl:1;		/* available */
-	unsigned sd_long:1;		/* long mode */
-	unsigned sd_def32:1;            /* default 32 vs 16 bit size */
-	unsigned sd_gran:1;             /* limit granularity (byte/page) */
-	unsigned sd_hibase:8;           /* segment base address (msb) */
+	unsigned sd_lolimit:16;	/* segment extent (lsb) */
+	unsigned sd_lobase:24;	/* segment base address (lsb) */
+	unsigned sd_type:5;	/* segment type */
+	unsigned sd_dpl:2;	/* segment descriptor priority level */
+	unsigned sd_p:1;	/* segment descriptor present */
+	unsigned sd_hilimit:4;	/* segment extent (msb) */
+	unsigned sd_avl:1;	/* available */
+	unsigned sd_long:1;	/* long mode */
+	unsigned sd_def32:1;	/* default 32 vs 16 bit size */
+	unsigned sd_gran:1;	/* limit granularity (byte/page) */
+	unsigned sd_hibase:8;	/* segment base address (msb) */
 } __packed;
 
 /*
@@ -192,24 +192,25 @@
 } __packed;
 
 /*
- * Gate descriptors (e.g. indirect descriptors)
+ * Gate descriptors (16 bytes).
  */
 struct gate_descriptor {
-/*BITFIELDTYPE*/ uint64_t gd_looffset:16;/* gate offset (lsb) */
-/*BITFIELDTYPE*/ uint64_t gd_selector:16;/* gate segment selector */
-/*BITFIELDTYPE*/ uint64_t gd_ist:3;	/* IST select */
-/*BITFIELDTYPE*/ uint64_t gd_xx1:5;	/* reserved */
-/*BITFIELDTYPE*/ uint64_t gd_type:5;	/* segment type */
-/*BITFIELDTYPE*/ uint64_t gd_dpl:2;	/* segment descriptor priority level */
-/*BITFIELDTYPE*/ uint64_t gd_p:1;	/* segment descriptor present */
-/*BITFIELDTYPE*/ uint64_t gd_hioffset:48;/* gate offset (msb) */
-/*BITFIELDTYPE*/ uint64_t gd_xx2:8;	/* reserved */
-/*BITFIELDTYPE*/ uint64_t gd_zero:5;	/* must be zero */
-/*BITFIELDTYPE*/ uint64_t gd_xx3:19;	/* reserved */
+	uint64_t gd_looffset:16;/* gate offset (lsb) */
+	uint64_t gd_selector:16;/* gate segment selector */
+	uint64_t gd_ist:3;	/* IST select */
+	uint64_t gd_xx1:5;	/* reserved */
+	uint64_t gd_type:5;	/* segment type */
+	uint64_t gd_dpl:2;	/* segment descriptor priority level */
+	uint64_t gd_p:1;	/* segment descriptor present */
+	uint64_t gd_hioffset:48;/* gate offset (msb) */
+	uint64_t gd_xx2:8;	/* reserved */
+	uint64_t gd_zero:5;	/* must be zero */
+	uint64_t gd_xx3:19;	/* reserved */
 } __packed;
 
 /*
- * Generic descriptor
+ * Generic descriptor (8 bytes). Note: it does not include system segment
+ * descriptors and gate descriptors, since these are 16-byte-long.
  */
 union descriptor {
 	struct mem_segment_descriptor sd;
@@ -218,17 +219,14 @@
 } __packed;
 
 /*
- * region descriptors, used to load gdt/idt tables before segments yet exist.
+ * Region descriptors, used to load gdt/idt tables before segments yet exist.
  */
 struct region_descriptor {
-	uint16_t rd_limit;		/* segment extent */
-	uint64_t rd_base;		/* base address  */
+	uint16_t rd_limit;	/* segment extent */
+	uint64_t rd_base;	/* base address  */
 } __packed;
 
 #ifdef _KERNEL
-#if 0
-extern struct sys_segment_descriptor *ldt;
-#endif
 #ifdef XEN
 extern struct trap_info *idt;
 #else
@@ -241,14 +239,13 @@
 void unsetgate(struct gate_descriptor *);
 void setregion(struct region_descriptor *, void *, uint16_t);
 void set_sys_segment(struct sys_segment_descriptor *, void *, size_t,
-			  int, int, int);
+    int, int, int);
 void set_mem_segment(struct mem_segment_descriptor *, void *, size_t,
-			  int, int, int, int, int);
+    int, int, int, int, int);
 void cpu_init_idt(void);
 void update_descriptor(void *, void *);
 
 #if !defined(XEN)
-void idt_init(void);
 void idt_vec_reserve(int);
 int idt_vec_alloc(int, int);
 void idt_vec_set(int, void (*)(void));
@@ -264,40 +261,40 @@
 #endif /* !_LOCORE */
 
 /* system segments and gate types */
-#define	SDT_SYSNULL	 0	/* system null */
-#define	SDT_SYS286TSS	 1	/* system 286 TSS available */
-#define	SDT_SYSLDT	 2	/* system local descriptor table */
-#define	SDT_SYS286BSY	 3	/* system 286 TSS busy */
-#define	SDT_SYS286CGT	 4	/* system 286 call gate */
-#define	SDT_SYSTASKGT	 5	/* system task gate */
-#define	SDT_SYS286IGT	 6	/* system 286 interrupt gate */
-#define	SDT_SYS286TGT	 7	/* system 286 trap gate */
-#define	SDT_SYSNULL2	 8	/* system null again */
-#define	SDT_SYS386TSS	 9	/* system 386 TSS available */
-#define	SDT_SYSNULL3	10	/* system null again */
-#define	SDT_SYS386BSY	11	/* system 386 TSS busy */
-#define	SDT_SYS386CGT	12	/* system 386 call gate */
-#define	SDT_SYSNULL4	13	/* system null again */
-#define	SDT_SYS386IGT	14	/* system 386 interrupt gate */
-#define	SDT_SYS386TGT	15	/* system 386 trap gate */
+#define SDT_SYSNULL	 0	/* system null */
+#define SDT_SYS286TSS	 1	/* system 286 TSS available */
+#define SDT_SYSLDT	 2	/* system local descriptor table */
+#define SDT_SYS286BSY	 3	/* system 286 TSS busy */
+#define SDT_SYS286CGT	 4	/* system 286 call gate */
+#define SDT_SYSTASKGT	 5	/* system task gate */
+#define SDT_SYS286IGT	 6	/* system 286 interrupt gate */
+#define SDT_SYS286TGT	 7	/* system 286 trap gate */
+#define SDT_SYSNULL2	 8	/* system null again */
+#define SDT_SYS386TSS	 9	/* system 386 TSS available */
+#define SDT_SYSNULL3	10	/* system null again */
+#define SDT_SYS386BSY	11	/* system 386 TSS busy */
+#define SDT_SYS386CGT	12	/* system 386 call gate */
+#define SDT_SYSNULL4	13	/* system null again */
+#define SDT_SYS386IGT	14	/* system 386 interrupt gate */
+#define SDT_SYS386TGT	15	/* system 386 trap gate */
 
 /* memory segment types */
-#define	SDT_MEMRO	16	/* memory read only */
-#define	SDT_MEMROA	17	/* memory read only accessed */
-#define	SDT_MEMRW	18	/* memory read write */
-#define	SDT_MEMRWA	19	/* memory read write accessed */
-#define	SDT_MEMROD	20	/* memory read only expand dwn limit */
-#define	SDT_MEMRODA	21	/* memory read only expand dwn limit accessed */
-#define	SDT_MEMRWD	22	/* memory read write expand dwn limit */
-#define	SDT_MEMRWDA	23	/* memory read write expand dwn limit acessed */
-#define	SDT_MEME	24	/* memory execute only */
-#define	SDT_MEMEA	25	/* memory execute only accessed */
-#define	SDT_MEMER	26	/* memory execute read */
-#define	SDT_MEMERA	27	/* memory execute read accessed */
-#define	SDT_MEMEC	28	/* memory execute only conforming */
-#define	SDT_MEMEAC	29	/* memory execute only accessed conforming */
-#define	SDT_MEMERC	30	/* memory execute read conforming */
-#define	SDT_MEMERAC	31	/* memory execute read accessed conforming */
+#define SDT_MEMRO	16	/* memory read only */
+#define SDT_MEMROA	17	/* memory read only accessed */
+#define SDT_MEMRW	18	/* memory read write */
+#define SDT_MEMRWA	19	/* memory read write accessed */
+#define SDT_MEMROD	20	/* memory read only expand dwn limit */
+#define SDT_MEMRODA	21	/* memory read only expand dwn limit accessed */
+#define SDT_MEMRWD	22	/* memory read write expand dwn limit */
+#define SDT_MEMRWDA	23	/* memory read write expand dwn limit accessed */
+#define SDT_MEME	24	/* memory execute only */
+#define SDT_MEMEA	25	/* memory execute only accessed */
+#define SDT_MEMER	26	/* memory execute read */
+#define SDT_MEMERA	27	/* memory execute read accessed */
+#define SDT_MEMEC	28	/* memory execute only conforming */
+#define SDT_MEMEAC	29	/* memory execute only accessed conforming */
+#define SDT_MEMERC	30	/* memory execute read conforming */
+#define SDT_MEMERAC	31	/* memory execute read accessed conforming */
 
 /* is memory segment descriptor pointer ? */
 #define ISMEMSDP(s)	((s->d_type) >= SDT_MEMRO && \
@@ -323,15 +320,15 @@
 /*
  * Segment Protection Exception code bits
  */
-#define	SEGEX_EXT	0x01	/* recursive or externally induced */
-#define	SEGEX_IDT	0x02	/* interrupt descriptor table */
-#define	SEGEX_TI	0x04	/* local descriptor table */
+#define SEGEX_EXT	0x01	/* recursive or externally induced */
+#define SEGEX_IDT	0x02	/* interrupt descriptor table */
+#define SEGEX_TI	0x04	/* local descriptor table */
 
 /*
  * Entries in the Interrupt Descriptor Table (IDT)
  */
-#define	NIDT	256
-#define	NRSVIDT	32		/* reserved entries for CPU exceptions */
+#define NIDT	256
+#define NCPUIDT	32		/* reserved entries for CPU exceptions */
 
 /*
  * Entries in the Global Descriptor Table (GDT)
@@ -341,16 +338,16 @@
  * Then come the predefined LDT (and possibly TSS) descriptors.
  * There are NGDT_SYS of them.
  */
-#define	GNULL_SEL	0	/* Null descriptor */
-#define	GCODE_SEL	1	/* Kernel code descriptor */
-#define	GDATA_SEL	2	/* Kernel data descriptor */
-#define	GUCODE_SEL	3	/* User code descriptor */
-#define	GUDATA_SEL	4	/* User data descriptor */
-#define	GAPM32CODE_SEL	5
-#define	GAPM16CODE_SEL	6
-#define	GAPMDATA_SEL	7
-#define	GBIOSCODE_SEL	8
-#define	GBIOSDATA_SEL	9
+#define GNULL_SEL	0	/* Null descriptor */
+#define GCODE_SEL	1	/* Kernel code descriptor */
+#define GDATA_SEL	2	/* Kernel data descriptor */
+#define GUCODE_SEL	3	/* User code descriptor */
+#define GUDATA_SEL	4	/* User data descriptor */
+#define GAPM32CODE_SEL	5
+#define GAPM16CODE_SEL	6
+#define GAPMDATA_SEL	7
+#define GBIOSCODE_SEL	8
+#define GBIOSDATA_SEL	9
 #define GPNPBIOSCODE_SEL 10
 #define GPNPBIOSDATA_SEL 11
 #define GPNPBIOSSCRATCH_SEL 12
@@ -359,9 +356,9 @@
 #define GUDATA32_SEL	15
 #define GUFS_SEL	16	/* 32-bit Per-thread %fs */
 #define GUGS_SEL	17	/* 32-bit Per-thread %gs */
-#define NGDT_MEM 18
+#define NGDT_MEM	18
 
-#define	GLDT_SEL	0	/* Default LDT descriptor */
+#define GLDT_SEL	0	/* Default LDT descriptor */
 #define NGDT_SYS	1
 
 #define GDT_ADDR_MEM(s,i)	\
@@ -373,15 +370,15 @@
  * Byte offsets in the Local Descriptor Table (LDT)
  * Strange order because of syscall/sysret insns
  */
-#define	LSYS5CALLS_SEL	0	/* iBCS system call gate */
+#define LSYS5CALLS_SEL	0	/* iBCS system call gate */
 /*			8	   second half */
-#define	LSOL26CALLS_SEL	32	/* Solaris 2.6 system call gate */
+#define LSOL26CALLS_SEL	32	/* Solaris 2.6 system call gate */
 /*			40	   second half */
 #define LUCODE32_SEL	48	/* 32 bit user code descriptor */
-#define	LUDATA_SEL	56	/* User data descriptor */
-#define	LUCODE_SEL	64	/* User code descriptor */
+#define LUDATA_SEL	56	/* User data descriptor */
+#define LUCODE_SEL	64	/* User code descriptor */
 #define LUDATA32_SEL	72	/* 32 bit user data descriptor (needed?)*/
-#define	LBSDICALLS_SEL	128	/* BSDI system call gate */
+#define LBSDICALLS_SEL	128	/* BSDI system call gate */
 /*			136	   second half */
 
 #define LDT_SIZE	144
--- a/sys/arch/amd64/include/vmparam.h	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amd64/include/vmparam.h	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.36 2014/07/24 13:42:28 riastradh Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.36.4.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,6 @@
 
 #ifdef __x86_64__
 
-#include <sys/tree.h>
 #include <sys/mutex.h>
 #ifdef _KERNEL_OPT
 #include "opt_xen.h"
--- a/sys/arch/amiga/amiga/conf.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/amiga/conf.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.73 2011/12/15 14:25:12 phx Exp $	*/
+/*	$NetBSD: conf.c,v 1.73.24.1 2016/10/05 20:55:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.73 2011/12/15 14:25:12 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.73.24.1 2016/10/05 20:55:23 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -42,6 +42,7 @@
 #include "ser.h"
 #include "ite.h"
 #include "amidisplaycc.h"
+#include "mntva.h"
 #include "wsdisplay.h"
 
 /*
@@ -51,6 +52,7 @@
  * known algorithm unless we see a pressing need otherwise.
  */
 cons_decl(ser);
+cons_decl(mntva);
 cons_decl(grf);
 cons_decl(amidisplaycc_);
 cons_decl(ite);
@@ -59,6 +61,9 @@
 #if NSER > 0
 	cons_init(ser),
 #endif
+#if NMNTVA > 0
+	cons_init(mntva),
+#endif
 #if NWSDISPLAY > 0
 	{ dev_init(grf,cnprobe), dev_init(grf,cninit) },
 #endif
--- a/sys/arch/amiga/conf/WSCONS	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/conf/WSCONS	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: WSCONS,v 1.67.6.1 2015/12/27 12:09:28 skrll Exp $
+# $NetBSD: WSCONS,v 1.67.6.2 2016/10/05 20:55:23 skrll Exp $
 
 # GENERIC with wscons(4)
 #
@@ -13,12 +13,12 @@
 
 wskbd0		at kbd0 console ?
 
-ukbd*		at uhidev? reportid ?  
+ukbd*		at uhidev? reportid ?
 wskbd*		at ukbd? console ?
 
 wsmouse*	at ms?
 
-ums*		at uhidev? reportid ? 
+ums*		at uhidev? reportid ?
 wsmouse*	at ums?
 
 amidisplaycc0	at mainbus0		# wscons interface to custom chips
@@ -45,12 +45,15 @@
 no ite6		at grf6
 no ite7		at grf7
 
+mntva*          at zbus?                # MNTMN VA2000
+#options         MNTVA_CONSOLE
+
 # PCI framebuffers
 #genfb*		at pci?			# CyberVisionPPC/BlizzardVisionPPC only
-voodoofb*	at pci?			# 3Dfx Voodoo 3 in G-REX 
+voodoofb*	at pci?			# 3Dfx Voodoo 3 in G-REX
 #radeonfb*	at pci?			# untested
 
-# Console support for CyberVisionPPC, BlizzardVisionPPC and 3Dfx Voodoo 3 in 
+# Console support for CyberVisionPPC, BlizzardVisionPPC and 3Dfx Voodoo 3 in
 # G-REX.
 #options		P5PB_CONSOLE
 
@@ -59,3 +62,4 @@
 
 pseudo-device	wsfont			# wsfont(4) dynamic font loading support
 pseudo-device	wsmux			# mouse & keyboard multiplexor
+
--- a/sys/arch/amiga/conf/files.amiga	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/conf/files.amiga	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amiga,v 1.176.4.1 2015/04/06 15:17:51 skrll Exp $
+#	$NetBSD: files.amiga,v 1.176.4.2 2016/10/05 20:55:23 skrll Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16			# NOTE THAT AMIGA IS SPECIAL!
@@ -20,6 +20,8 @@
 defflag	opt_amigacons.h		CV64CONSOLE CV3DCONSOLE TSENGCONSOLE
 defflag	opt_amigacons.h		SERCONSOLE
 
+defflag opt_mntva.h		MNTVA_CONSOLE
+
 defflag	opt_kfont.h		KFONT_CONS_ISO8859_1
 defflag	opt_kfont.h		KFONT_CONS_ISO8859_2
 
@@ -218,6 +220,11 @@
 file	arch/amiga/dev/grf_cv3d.c	grfcv3d needs-flag
 file	arch/amiga/dev/ite_cv3d.c	grfcv3d & ite
 
+# MNT VA2000
+device	mntva: wsemuldisplaydev, rasops16, rasops32, vcons, videomode
+attach	mntva at zbus
+file	arch/amiga/dev/mntva.c		mntva needs-flag
+
 # device defined in sys/conf/files
 # A2065, Ameristar, Ariadne ethernet cards
 attach	le at zbus with le_zbus: le24
@@ -231,7 +238,7 @@
 # X-Surf
 define	xsurfbus {}
 
-device	xsurf: xsurfbus 
+device	xsurf: xsurfbus
 attach	xsurf at zbus
 file	arch/amiga/dev/xsurf.c		xsurf needs-flag
 
@@ -493,7 +500,7 @@
 attach	wdc at zbus with wdc_buddha
 file	arch/amiga/dev/wdc_buddha.c	wdc_buddha
 
-# FastATA 
+# FastATA
 device  efa: ata, wdc_common, amibus_b1000
 attach  efa at mainbus
 file    arch/amiga/dev/efa.c		efa
@@ -535,19 +542,19 @@
 
 # CyberStorm MKIII scsi
 device	cbiiisc: scsi, siopng
-attach	cbiiisc at p5bus 
+attach	cbiiisc at p5bus
 file	arch/amiga/dev/cbiiisc.c	cbiiisc needs-flag
 
 # Phase5 Blizzard 603e+ SCSI
 device	bppcsc: scsi, asiop
-attach	bppcsc at p5bus 
+attach	bppcsc at p5bus
 file	arch/amiga/dev/bppcsc.c		bppcsc needs-flag
 
 # PCI bus
 file	arch/amiga/pci/pci_machdep.c	pci
 
 device	p5pb: pcibus
-attach	p5pb at p5bus 
+attach	p5pb at p5bus
 file	arch/amiga/pci/p5pb.c		p5pb & pci
 
 device	mppb: pcibus
@@ -588,11 +595,11 @@
 define	acafhbus {}
 
 device	acafh: acafhbus, amibus_b4000
-attach	acafh at mainbus 
-file	arch/amiga/dev/acafh.c		acafh needs-count 
+attach	acafh at mainbus
+file	arch/amiga/dev/acafh.c		acafh needs-count
 
 attach	wdc at acafhbus with wdc_acafh: gayle, amibus_b1000
-file	arch/amiga/dev/wdc_acafh.c	wdc_acafh & acafh 
+file	arch/amiga/dev/wdc_acafh.c	wdc_acafh & acafh
 
 include "arch/amiga/clockport/files.clockport"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/dev/mntva.c	Wed Oct 05 20:55:23 2016 +0000
@@ -0,0 +1,623 @@
+/*	$NetBSD: mntva.c,v 1.1.2.2 2016/10/05 20:55:24 skrll Exp $	*/
+
+/*
+ * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.		
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lukas F. Hartmann.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Radoslaw Kujawa.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *	notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *	notice, this list of conditions and the following disclaimer in the
+ *	documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: mntva.c,v 1.1.2.2 2016/10/05 20:55:24 skrll Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/endian.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/conf.h>
+
+#include <dev/cons.h>
+
+#include <amiga/amiga/device.h>
+#include <amiga/amiga/isr.h>
+
+#include <amiga/dev/zbusvar.h>
+#include <amiga/dev/mntvavar.h>
+#include <amiga/dev/mntvareg.h>
+#include <dev/wsfb/genfbvar.h>
+
+#include "opt_amigacons.h"
+#include "opt_wsemul.h"
+#include "opt_mntva.h"
+#include "opt_wsfb.h"
+
+#include "mntva.h"
+
+/* #define MNTVA_DEBUG 1 */
+
+static int mntva_match(device_t, cfdata_t, void *);
+static void mntva_attach(device_t, device_t, void *);
+
+static uint16_t mntva_reg_read(struct mntva_softc *sc, uint32_t reg);
+static void mntva_reg_write(struct mntva_softc *sc, uint32_t reg, uint32_t val);
+
+static bool mntva_mode_set(struct mntva_softc *sc);
+
+static paddr_t mntva_mmap(void *v, void *vs, off_t offset, int prot);
+static int mntva_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
+    struct lwp *l);
+static void mntva_init_screen(void *cookie, struct vcons_screen *scr,
+    int existing, long *defattr);
+static void mntva_init_palette(struct mntva_softc *sc);
+/* blitter support */
+static void mntva_rectfill(struct mntva_softc *sc, int x, int y, int wi,
+    int he, uint32_t color);
+static void mntva_bitblt(struct mntva_softc *sc, int xs, int ys, int xd, 
+    int yd, int wi, int he);
+
+/* accelerated raster ops */
+static void mntva_eraserows(void *cookie, int row, int nrows, long fillattr);
+static void mntva_copyrows(void *cookie, int srcrow, int dstrow, int nrows);
+static void mntva_copycols(void *cookie, int row, int srccol, int dstcol, 
+    int ncols);
+static void mntva_erasecols(void *cookie, int row, int startcol, int ncols,
+    long fillattr);
+#if 0
+static void mntva_cursor(void *cookie, int on, int row, int col);
+#endif 
+
+/*
+ * XXX: these will be called by console handling code, shouldn't they be 
+ * included from somewhere else? 
+ */
+void mntvacninit(struct consdev *cd);
+void mntvacnprobe(struct consdev *cd);
+void mntvacnputc(dev_t cd, int ch);
+int mntvacngetc(dev_t cd);
+void mntvacnpollc(dev_t cd, int on);
+
+CFATTACH_DECL_NEW(mntva, sizeof(struct mntva_softc),
+    mntva_match, mntva_attach, NULL, NULL);
+
+struct wsdisplay_accessops mntva_accessops = {
+	mntva_ioctl,
+	mntva_mmap,
+	NULL,			// alloc_screen 
+	NULL,			// free_screen 
+	NULL,			// show_screen 
+	NULL,			// load_font 
+	NULL,			// pollc 
+	NULL			// scroll 
+};
+
+static int
+mntva_match(device_t parent, cfdata_t match, void *aux)
+{
+	struct zbus_args *zap = aux;
+
+	if (zap->manid == 0x6d6e && zap->prodid == 1) {
+#ifdef MNTVA_DEBUG
+		/* XXX: this might not work during console init? */
+		aprint_normal("mntva_match... success!\n"); 
+#endif /* MNTVA_DEBUG */
+		return 1;
+	}
+
+	return 0;
+}
+
+static void
+mntva_attach(device_t parent, device_t self, void *aux)
+{
+	struct mntva_softc *sc = device_private(self);
+	struct wsemuldisplaydev_attach_args ws_aa;
+	struct rasops_info *ri;
+	struct zbus_args *zap = aux;
+	long defattr;
+
+	sc->sc_isconsole = false;
+/* this should come from "opt_mntva.h" auto generated by kernel conf system */
+#ifdef MNTVA_CONSOLE
+	sc->sc_isconsole = true;
+#endif /* MNTVA_CONSOLE */
+
+	printf(": MNTMN VA2000");
+
+	if(sc->sc_isconsole)
+		printf(" (console)");
+
+	printf("\n");
+
+	sc->sc_dev = self;
+	sc->sc_memsize = MNTVA_FB_SIZE;
+
+	sc->sc_bst.base = (bus_addr_t) zap->va;
+	sc->sc_bst.absm = &amiga_bus_stride_1;
+	sc->sc_iot = &sc->sc_bst;
+
+	if (bus_space_map(sc->sc_iot, MNTVA_OFF_FB, sc->sc_memsize + 0x1000,
+	    BUS_SPACE_MAP_LINEAR, &sc->sc_fbh)) {
+		aprint_error_dev(sc->sc_dev, "mapping framebuffer failed\n");
+		return;
+	}
+	if (bus_space_map(sc->sc_iot, MNTVA_OFF_REG, MNTVA_REG_SIZE , 0,
+	    &sc->sc_regh)) {
+		aprint_error_dev(sc->sc_dev, "mapping registers failed\n");
+		return;
+	}
+
+	sc->sc_regpa = (bus_addr_t) kvtop((void*) sc->sc_regh);
+	sc->sc_fbpa = (bus_addr_t) kvtop((void*) sc->sc_fbh);
+
+	/* print the physical and virt addresses for registers and fb */
+	aprint_normal_dev(sc->sc_dev, 
+	    "registers at pa/va 0x%08x/0x%08x, fb at pa/va 0x%08x/0x%08x\n",
+	    (uint32_t) sc->sc_regpa,
+	    (uint32_t) bus_space_vaddr(sc->sc_iot, sc->sc_regh), 
+	    (uint32_t) sc->sc_fbpa,
+	    (uint32_t) bus_space_vaddr(sc->sc_iot, sc->sc_fbh));
+
+	sc->sc_width = 1280;
+	sc->sc_height = 720;
+	sc->sc_bpp = 16;
+	sc->sc_linebytes = 4096;
+
+	aprint_normal_dev(sc->sc_dev, "%zu kB framebuffer memory present\n",
+	    sc->sc_memsize / 1024);
+
+	aprint_normal_dev(sc->sc_dev, "setting %dx%d %d bpp resolution\n",
+	    sc->sc_width, sc->sc_height, sc->sc_bpp);
+
+	mntva_mode_set(sc);
+
+	sc->sc_defaultscreen_descr = (struct wsscreen_descr) {
+	    "default", 0, 0, NULL, 8, 16, 
+	    WSSCREEN_WSCOLORS | WSSCREEN_HILIT, NULL };
+	sc->sc_screens[0] = &sc->sc_defaultscreen_descr;
+	sc->sc_screenlist = (struct wsscreen_list) { 1, sc->sc_screens };
+	sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
+
+	vcons_init(&sc->vd, sc, &sc->sc_defaultscreen_descr, &mntva_accessops);
+	sc->vd.init_screen = mntva_init_screen;
+
+	ri = &sc->sc_console_screen.scr_ri;
+
+	mntva_init_palette(sc);
+
+	if (sc->sc_isconsole) {
+		vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
+				&defattr);
+
+		sc->sc_console_screen.scr_flags = VCONS_SCREEN_IS_STATIC;
+		vcons_redraw_screen(&sc->sc_console_screen);
+
+		sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
+		sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
+		sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
+		sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
+
+		wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
+				defattr);
+		vcons_replay_msgbuf(&sc->sc_console_screen);
+	} else {
+		if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+			vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
+					&defattr);
+		} else
+			(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+	}
+
+	ws_aa.console = sc->sc_isconsole;
+	ws_aa.scrdata = &sc->sc_screenlist;
+	ws_aa.accessops = &mntva_accessops;
+	ws_aa.accesscookie = &sc->vd;
+
+	config_found(sc->sc_dev, &ws_aa, wsemuldisplaydevprint);
+}
+
+static void
+mntva_init_palette(struct mntva_softc *sc)
+{
+	int i, j;
+
+	j = 0;
+	for (i=0; i<256; i++) {
+		mntva_reg_write(sc, 0x200+i*2, rasops_cmap[j]);
+		mntva_reg_write(sc, 0x400+i*2, rasops_cmap[j+1]);
+		mntva_reg_write(sc, 0x600+i*2, rasops_cmap[j+2]);
+		j+=3;
+	}
+}
+
+static void
+mntva_init_screen(void *cookie, struct vcons_screen *scr, int existing,
+    long *defattr)
+{
+	struct mntva_softc *sc = cookie;
+	struct rasops_info *ri = &scr->scr_ri;
+
+	wsfont_init();
+
+	ri->ri_depth = sc->sc_bpp;
+	ri->ri_width = sc->sc_width;
+	ri->ri_height = sc->sc_height;
+	ri->ri_stride = sc->sc_linebytes;
+	ri->ri_flg = 0;
+
+	/*ri->ri_flg = RI_BSWAP;*/
+
+	ri->ri_bits = (char *) bus_space_vaddr(sc->sc_iot, sc->sc_fbh);
+#ifdef MNTVA_DEBUG
+	aprint_normal_dev(sc->sc_dev, "ri_bits: %p\n", ri->ri_bits);
+#endif /* MNTVA_DEBUG */
+
+	scr->scr_flags = VCONS_SCREEN_IS_STATIC;
+
+	rasops_init(ri, 0, 0);
+	ri->ri_caps = WSSCREEN_WSCOLORS;
+	rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,
+	    sc->sc_width / ri->ri_font->fontwidth);
+
+	ri->ri_hw = scr;
+
+	ri->ri_ops.eraserows = mntva_eraserows;
+	ri->ri_ops.copyrows = mntva_copyrows;
+	ri->ri_ops.erasecols = mntva_erasecols;
+	ri->ri_ops.copycols = mntva_copycols;
+#if 0
+	ri->ri_ops.cursor = mntva_cursor;
+#endif
+}
+
+static bool
+mntva_mode_set(struct mntva_softc *sc)
+{
+	mntva_reg_write(sc, MNTVA_SCALEMODE, 0);
+	mntva_reg_write(sc, MNTVA_SCREENW, sc->sc_width);
+	mntva_reg_write(sc, MNTVA_SCREENH, sc->sc_height);
+
+	if (sc->sc_bpp == 8)
+		mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE8);
+	else if (sc->sc_bpp == 16)
+		mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE16);
+	else if (sc->sc_bpp == 32)
+		mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE32);
+
+	mntva_reg_write(sc, MNTVA_PANPTRHI, 0);
+	mntva_reg_write(sc, MNTVA_PANPTRLO, 0);
+	mntva_reg_write(sc, MNTVA_BLITTERBASEHI, 0);
+	mntva_reg_write(sc, MNTVA_BLITTERBASELO, 0);
+	
+	/* XXX: should rectfill with bg color taken from wscons? */
+	mntva_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height, 0xffffffff);
+
+	return true;
+}
+
+static uint16_t
+mntva_reg_read(struct mntva_softc *sc, uint32_t reg) 
+{
+	uint32_t rv;
+	rv = bus_space_read_2(sc->sc_iot, sc->sc_regh, reg);
+	return rv;
+}
+
+static void
+mntva_reg_write(struct mntva_softc *sc, uint32_t reg, uint32_t val)
+{
+	bus_space_write_2(sc->sc_iot, sc->sc_regh, reg, val);
+}
+
+static void
+mntva_rectfill(struct mntva_softc *sc, int x, int y, int wi, int he,
+    uint32_t color)
+{
+	mntva_reg_write(sc, MNTVA_BLITTERRGB, (uint16_t) color);
+	mntva_reg_write(sc, MNTVA_BLITTERX1, (uint16_t) x);
+	mntva_reg_write(sc, MNTVA_BLITTERY1, (uint16_t) y);
+	mntva_reg_write(sc, MNTVA_BLITTERX2, (uint16_t) x + wi - 1);
+	mntva_reg_write(sc, MNTVA_BLITTERY2, (uint16_t) y + he - 1);
+	mntva_reg_write(sc, MNTVA_BLITTER_ENABLE, MNTVA_BLITTER_FILL);
+
+	while(mntva_reg_read(sc, MNTVA_BLITTER_ENABLE)) {
+		/* busy wait */
+	}
+}
+
+static void
+mntva_bitblt(struct mntva_softc *sc, int xs, int ys, int xd, int yd, int wi,
+    int he)
+{
+	mntva_reg_write(sc, MNTVA_BLITTERX1, (uint16_t) xd);
+	mntva_reg_write(sc, MNTVA_BLITTERY1, (uint16_t) yd);
+	mntva_reg_write(sc, MNTVA_BLITTERX2, (uint16_t) xd + wi - 1);
+	mntva_reg_write(sc, MNTVA_BLITTERY2, (uint16_t) yd + he - 1);
+	mntva_reg_write(sc, MNTVA_BLITTERX3, (uint16_t) xs);
+	mntva_reg_write(sc, MNTVA_BLITTERY3, (uint16_t) ys);
+	mntva_reg_write(sc, MNTVA_BLITTERX4, (uint16_t) xs + wi - 1);
+	mntva_reg_write(sc, MNTVA_BLITTERY4, (uint16_t) ys + he - 1);
+	mntva_reg_write(sc, MNTVA_BLITTER_ENABLE, MNTVA_BLITTER_COPY);
+	
+	while(mntva_reg_read(sc, MNTVA_BLITTER_ENABLE)) {
+		/* busy wait */
+	}
+}
+
+static void
+mntva_copyrows(void *cookie, int srcrow, int dstrow, int nrows)
+{
+	struct mntva_softc *sc;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	int x, ys, yd, wi, he;
+
+	ri = cookie;
+	scr = ri->ri_hw;
+	sc = scr->scr_cookie;
+
+	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
+		x = ri->ri_xorigin;
+		ys = ri->ri_yorigin + ri->ri_font->fontheight * srcrow;
+		yd = ri->ri_yorigin + ri->ri_font->fontheight * dstrow;
+		wi = ri->ri_emuwidth;
+		he = ri->ri_font->fontheight * nrows;
+		mntva_bitblt(sc, x, ys, x, yd, wi, he);
+	}
+}
+
+static void
+mntva_eraserows(void *cookie, int row, int nrows, long fillattr)
+{
+	struct mntva_softc *sc;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	int x, y, wi, he, fg, bg, ul;
+
+	ri = cookie;
+	scr = ri->ri_hw;
+	sc = scr->scr_cookie;
+
+	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
+		rasops_unpack_attr(fillattr, &fg, &bg, &ul);
+		if ((row == 0) && (nrows == ri->ri_rows)) 
+			mntva_rectfill(sc, 0, 0, ri->ri_width,
+			    ri->ri_height, ri->ri_devcmap[bg]);
+		else {
+			x = ri->ri_xorigin;
+			y = ri->ri_yorigin + ri->ri_font->fontheight * row;
+			wi = ri->ri_emuwidth;
+			he = ri->ri_font->fontheight * nrows;
+			mntva_rectfill(sc, x, y, wi, he, ri->ri_devcmap[bg]);
+		}
+	}
+}
+
+static void
+mntva_copycols(void *cookie, int row, int srccol, int dstcol, int ncols)
+{
+	struct mntva_softc *sc;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	int xs, xd, y, w, h;
+
+	ri = cookie;
+	scr = ri->ri_hw;
+	sc = scr->scr_cookie;
+
+	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
+		xs = ri->ri_xorigin + ri->ri_font->fontwidth * srccol;
+		xd = ri->ri_xorigin + ri->ri_font->fontwidth * dstcol;
+		y = ri->ri_yorigin + ri->ri_font->fontheight * row;
+		w = ri->ri_font->fontwidth * ncols;
+		h = ri->ri_font->fontheight;
+		mntva_bitblt(sc, xs, y, xd, y, w, h);
+	}
+
+}
+
+static void
+mntva_erasecols(void *cookie, int row, int startcol, int ncols, long fillattr)
+{
+	struct mntva_softc *sc;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	int x, y, w, h, fg, bg, ul;
+
+	ri = cookie;
+	scr = ri->ri_hw;
+	sc = scr->scr_cookie;
+
+	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
+		x = ri->ri_xorigin + ri->ri_font->fontwidth * startcol;
+		y = ri->ri_yorigin + ri->ri_font->fontheight * row;
+		w = ri->ri_font->fontwidth * ncols;
+		h = ri->ri_font->fontheight;
+		rasops_unpack_attr(fillattr, &fg, &bg, &ul);
+		mntva_rectfill(sc, x, y, w, h, ri->ri_devcmap[bg & 0xf]);
+	}
+}
+
+static int
+mntva_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
+{
+	struct vcons_data *vd;
+	struct mntva_softc *sc;
+	struct wsdisplay_fbinfo *wsfbi;
+	struct vcons_screen *ms;
+	struct wsdisplayio_bus_id *busid;
+
+	vd = v;
+	sc = vd->cookie;
+	ms = vd->active;
+	
+	switch (cmd) {
+	case WSDISPLAYIO_GTYPE:
+		*(u_int *) data = WSDISPLAY_TYPE_UNKNOWN;
+		return 0;
+
+	case WSDISPLAYIO_GET_BUSID:
+		busid = data;
+		busid->bus_type = WSDISPLAYIO_BUS_SOC;
+		return 0;
+
+	case WSDISPLAYIO_GINFO:
+		if (ms == NULL)
+			return ENODEV;
+
+		wsfbi = (void *) data;
+		wsfbi->height = ms->scr_ri.ri_height;
+		wsfbi->width = ms->scr_ri.ri_width;
+		wsfbi->depth = ms->scr_ri.ri_depth;
+		wsfbi->cmsize = 256;
+		return 0;
+
+	case WSDISPLAYIO_LINEBYTES:
+		*(u_int *) data = sc->sc_linebytes;
+		return 0;
+
+	case WSDISPLAYIO_SMODE:
+		{
+			int new_mode = *(int *) data;
+			if (new_mode != sc->sc_mode) {
+				sc->sc_mode = new_mode;
+				if (new_mode == WSDISPLAYIO_MODE_EMUL)
+					vcons_redraw_screen(ms);
+			}
+			return 0;
+		}
+	case WSDISPLAYIO_GET_FBINFO:
+		{
+			struct wsdisplayio_fbinfo *fbi = data;
+			struct rasops_info *ri;
+			int ret;
+
+			ri = &sc->vd.active->scr_ri;
+			ret = wsdisplayio_get_fbinfo(ri, fbi);
+			return ret;
+		}
+	}
+	
+	return EPASSTHROUGH;
+}
+
+#if 0
+static void
+mntva_cursor(void *cookie, int on, int row, int col)
+{
+	struct mntva_softc *sc;
+	struct rasops_info *ri;
+	struct vcons_screen *scr;
+	int x, y, wi, he;
+
+	ri = cookie;
+	scr = ri->ri_hw;
+	sc = scr->scr_cookie;
+
+	wi = ri->ri_font->fontwidth;
+	he = ri->ri_font->fontheight;
+
+	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
+		x = ri->ri_ccol * wi + ri->ri_xorigin;
+		y = ri->ri_crow * he + ri->ri_yorigin;
+		if (ri->ri_flg & RI_CURSOR) {
+			mntva_bitblt(sc, x, y, x, y, wi, he);
+			ri->ri_flg &= ~RI_CURSOR;
+		}
+		ri->ri_crow = row;
+		ri->ri_ccol = col;
+		if (on) {
+			x = ri->ri_ccol * wi + ri->ri_xorigin;
+			y = ri->ri_crow * he + ri->ri_yorigin;
+			mntva_bitblt(sc, x, y, x, y, wi, he);
+			ri->ri_flg |= RI_CURSOR;
+		}
+	} else {
+		scr->scr_ri.ri_crow = row;
+		scr->scr_ri.ri_ccol = col;
+		scr->scr_ri.ri_flg &= ~RI_CURSOR;
+	}
+}
+#endif 
+
+static paddr_t
+mntva_mmap(void *v, void *vs, off_t offset, int prot)
+{
+	struct vcons_data *vd;
+	struct mntva_softc *sc;
+	paddr_t pa;
+
+	vd = v;
+	sc = vd->cookie;
+
+	if (offset >= 0 && offset < sc->sc_memsize) {
+		pa = bus_space_mmap(sc->sc_iot, sc->sc_fbpa, offset, prot,
+			BUS_SPACE_MAP_LINEAR);
+		return pa;
+	}	
+
+	return -1;
+}
+
+void
+mntvacninit(struct consdev *cd) 
+{
+	/*wsdisplay_preattach(sc->sc_defaultscreen, ri, 0, 0, defattr);*/
+}
+
+void 
+mntvacnprobe(struct consdev *cd)
+{
+	/* 
+	 * This isn't exactly true, but cons.h does not define anything
+	 * that would fit our case exactly.
+	 */
+	cd->cn_pri = CN_INTERNAL;
+
+	cd->cn_dev = NODEV; /* Filled later by wscons. */
+}
+
+/* ARGSUSED */
+void
+mntvacnputc(dev_t cd, int ch)
+{
+}
+
+/* ARGSUSED */
+int
+mntvacngetc(dev_t cd)
+{
+	return(0);
+}
+
+/* ARGSUSED */
+void
+mntvacnpollc(dev_t cd, int on)
+{
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/dev/mntvareg.h	Wed Oct 05 20:55:23 2016 +0000
@@ -0,0 +1,106 @@
+/*	$NetBSD: mntvareg.h,v 1.1.2.2 2016/10/05 20:55:24 skrll Exp $  */
+
+/*
+ * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc. 
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lukas F. Hartmann.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Radoslaw Kujawa.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MNTVA2000REG_H
+#define MNTVA2000REG_H
+
+/* address space */
+#define MNTVA_OFF_REG		0x5f0000	/* memory mapped registers */
+#define MNTVA_REG_SIZE		0xFF
+
+#define MNTVA_OFF_FB		0x000000	/* frame buffer */
+#define MNTVA_FB_SIZE		0x5f0000
+
+/* registers */
+#define MNTVA_SCALEMODE		0x04
+#define MNTVA_SCALEMODE1X		0
+#define MNTVA_SCALEMODE2X		1
+#define MNTVA_SCALEMODE3X		2	
+#define MNTVA_SCALEMODE4X		3	
+
+#define MNTVA_SCREENW		0x06
+#define MNTVA_SCREENH		0x08
+
+#define MNTVA_BLITTERBASEHI	0x1C	/* [23:16] */
+#define MNTVA_BLITTERBASELO	0x1E	/* [15:0] */
+
+#define MNTVA_BLITTERX1		0x20
+#define MNTVA_BLITTERY1		0x22
+#define MNTVA_BLITTERX2		0x24
+#define MNTVA_BLITTERY2		0x26
+#define MNTVA_BLITTERRGB	0x28	/* filling for 16bit and 8bit modes */
+
+#define MNTVA_BLITTER_ENABLE	0x2A
+#define MNTVA_BLITTER_FILL		__BIT(0) /* fill [x1,y1]-[x2,y2] */
+#define MNTVA_BLITTER_COPY		__BIT(1) /* copy [x3,y3]-[x4,y4] to
+						         [x1,y1]-[x2,y2] */
+#define MNTVA_BLITTERX3		0x2C
+#define MNTVA_BLITTERY3		0x2E
+#define MNTVA_BLITTERX4		0x30
+#define MNTVA_BLITTERY4		0x32
+#define MNTVA_BLITTERRGB32HI	0x34	/* filling for 24bit and 32bit modes */
+#define MNTVA_BLITTERRGB32LO	0x36	/* filling for 24bit and 32bit modes */
+
+#define MNTVA_COLORMODE 	0x48
+#define MNTVA_COLORMODE8		0
+#define MNTVA_COLORMODE16		__BIT(0)	
+#define MNTVA_COLORMODE32		__BIT(1)
+
+#define MNTVA_PANPTRHI 0x38 /* [23:16] */
+#define MNTVA_PANPTRLO 0x3A /* [15:0] */
+
+#define MNTVA_BLITTERX1		0x20
+#define MNTVA_BLITTERY1		0x22
+#define MNTVA_BLITTERX2		0x24
+#define MNTVA_BLITTERY2		0x26
+#define MNTVA_BLITTERRGB	0x28	/* filling for 16bit and 8bit modes */
+
+#define MNTVA_BLITTER_ENABLE	0x2A
+#define MNTVA_BLITTER_FILL		__BIT(0) /* fill [x1,y1]-[x2,y2] */
+#define MNTVA_BLITTER_COPY		__BIT(1) /* copy [x3,y3]-[x4,y4] to
+						         [x1,y1]-[x2,y2] */
+#define MNTVA_BLITTERX3		0x2C
+#define MNTVA_BLITTERY3		0x2E
+#define MNTVA_BLITTERX4		0x30
+#define MNTVA_BLITTERY4		0x32
+#define MNTVA_BLITTERRGB32HI	0x34	/* filling for 24bit and 32bit modes */
+#define MNTVA_BLITTERRGB32LO	0x36	/* filling for 24bit and 32bit modes */
+
+#define MNTVA_COLORMODE 	0x48
+#define MNTVA_COLORMODE8		0
+#define MNTVA_COLORMODE16		__BIT(0)	
+#define MNTVA_COLORMODE32		__BIT(1)
+
+#define MNTVA_PANPTRHI 0x38 /* [23:16] */
+#define MNTVA_PANPTRLO 0x3A /* [15:0] */
+
+#endif /* MNTVA2000REG_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/dev/mntvavar.h	Wed Oct 05 20:55:23 2016 +0000
@@ -0,0 +1,76 @@
+/*  $NetBSD: mntvavar.h,v 1.1.2.2 2016/10/05 20:55:24 skrll Exp $ */
+
+/*
+ * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc. 
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lukas F. Hartmann.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Radoslaw Kujawa.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MNTVA2000VAR_H
+#define MNTVA2000VAR_H
+
+#include <dev/wscons/wsdisplayvar.h>
+#include <dev/wscons/wsconsio.h>
+#include <dev/wsfont/wsfont.h>
+#include <dev/rasops/rasops.h>
+#include <dev/wscons/wsdisplay_vconsvar.h>
+
+struct mntva_softc
+{
+	device_t sc_dev;
+
+	/* bus attachment, handles */
+	struct bus_space_tag sc_bst;
+
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_regh;
+	bus_space_handle_t sc_fbh;
+
+	bus_addr_t sc_regpa;
+	bus_addr_t sc_fbpa;
+
+	size_t sc_memsize;
+	int sc_width, sc_height, sc_linebytes, sc_bpp;
+
+	int sc_mode;
+	uint32_t sc_bg;
+
+	struct vcons_screen sc_console_screen;
+	struct vcons_data vd;
+	struct wsscreen_descr sc_defaultscreen_descr;
+	const struct wsscreen_descr *sc_screens[1];
+	struct wsscreen_list sc_screenlist;
+
+	bool sc_isconsole;
+
+	u_char sc_cmap_red[256];
+	u_char sc_cmap_green[256];
+	u_char sc_cmap_blue[256];
+
+};
+
+#endif /* MNTVA2000VAR_H */
--- a/sys/arch/amiga/dev/zbus.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/dev/zbus.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: zbus.c,v 1.73 2012/11/26 22:58:24 rkujawa Exp $ */
+/*	$NetBSD: zbus.c,v 1.73.14.1 2016/10/05 20:55:24 skrll Exp $ */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.73 2012/11/26 22:58:24 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.73.14.1 2016/10/05 20:55:24 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -192,7 +192,9 @@
 	{ "hyper4+",	5001,	6},	/* Hypercom4+ */
 	{ "hyper3+",	5001,	7},	/* Hypercom3+ */
 	/* Matay Grzegorz Kraszewski */
-	{ "mppb",	44359,	1}	/* Prometheus PCI bridge */
+	{ "mppb",	44359,	1},	/* Prometheus PCI bridge */
+	/* MNTMN */
+	{ "mntva",	28014,	1}	/* MNTMN VA2000 */
 };
 static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata);
 
@@ -226,6 +228,7 @@
 	{2167,	3, 0},	/* Domino regs (proto 16M) */
 	{2181,	0, 0},	/* oMniBus mem or regs */
 	{8512,	67, 0}	/* Cybervison 64/3D */		/* grf7 */
+/*	{28014,	1, 0}	// MNTMN VA2000 */
 };
 static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata);
 
--- a/sys/arch/amiga/stand/bootblock/Makefile.booters	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/Makefile.booters	Wed Oct 05 20:55:23 2016 +0000
@@ -1,6 +1,8 @@
-#	$NetBSD: Makefile.booters,v 1.7 2010/07/06 05:59:57 mrg Exp $
+#	$NetBSD: Makefile.booters,v 1.7.36.1 2016/10/05 20:55:24 skrll Exp $
 
-.include <bsd.own.mk>
+NOSSP=	# defined
+NOPIE=	# defined
+.include <bsd.init.mk>
 
 RELOC2BB=	${TOOL_AMIGAELF2BB}
 TXLT=		${TOOL_AMIGATXLT}
--- a/sys/arch/amiga/stand/bootblock/boot/Makefile	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/boot/Makefile	Wed Oct 05 20:55:23 2016 +0000
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.52.4.1 2016/03/19 11:29:55 skrll Exp $
+#	$NetBSD: Makefile,v 1.52.4.2 2016/10/05 20:55:24 skrll Exp $
 
-.include <bsd.own.mk>
+.include <bsd.init.mk>
 .include <bsd.sys.mk>		# for HOST_SH
 
 ### what we need:
@@ -49,8 +49,8 @@
 
 OBJS=	$(SOBJS) $(COBJS)
 
-#XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
-DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
+#XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR
+DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER
 DEFS += -D__INTERNAL_LIBSA_CREAD
 DEFS += -DSERCONSOLE
 SOBJS += cread.o
--- a/sys/arch/amiga/stand/bootblock/elf2bb/Makefile	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/elf2bb/Makefile	Wed Oct 05 20:55:23 2016 +0000
@@ -1,5 +1,8 @@
-#	$NetBSD: Makefile,v 1.3 2005/12/11 12:16:36 christos Exp $
+#	$NetBSD: Makefile,v 1.3.142.1 2016/10/05 20:55:24 skrll Exp $
 #
+
+.include <bsd.init.mk>
+
 CPPFLAGS+= -I.
 PROG=	elf2bb
 MKMAN=	no
--- a/sys/arch/amiga/stand/bootblock/installboot/Makefile	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/installboot/Makefile	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,7 @@
-#	$NetBSD: Makefile,v 1.7 2010/07/06 06:09:57 mrg Exp $
+#	$NetBSD: Makefile,v 1.7.36.1 2016/10/05 20:55:24 skrll Exp $
+
+.include <bsd.init.mk>
+
 PROG=installboot
 SRCS=installboot.c chksum.c
 BINDIR=/usr/mdec
--- a/sys/arch/amiga/stand/bootblock/txlt/Makefile	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/txlt/Makefile	Wed Oct 05 20:55:23 2016 +0000
@@ -1,7 +1,10 @@
-#	$NetBSD: Makefile,v 1.8.142.1 2015/04/06 15:17:51 skrll Exp $
+#	$NetBSD: Makefile,v 1.8.142.2 2016/10/05 20:55:24 skrll Exp $
 #
+
+NOMAN=	# defined
+.include <bsd.init.mk>
+
 PROG=txlt
-NOMAN=	# defined
 CLEANFILES+=	txlt.c
 
 .ifndef HOSTPROG
--- a/sys/arch/arc/arc/bus_space_sparse.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/arc/arc/bus_space_sparse.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space_sparse.c,v 1.18 2011/07/01 19:28:00 dyoung Exp $	*/
+/*	$NetBSD: bus_space_sparse.c,v 1.18.30.1 2016/10/05 20:55:24 skrll Exp $	*/
 /*	NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp 	*/
 
 /*-
@@ -39,42 +39,21 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.18 2011/07/01 19:28:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.18.30.1 2016/10/05 20:55:24 skrll Exp $");
 
 #include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/extent.h>
 #include <sys/malloc.h>
-#include <sys/extent.h>
+#include <sys/systm.h>
 
 #include <uvm/uvm_extern.h>
 
-#include <mips/cpuregs.h>
+#include <mips/locore.h>
 #include <mips/pte.h>
 
-#include <sys/bus.h>
-
 extern paddr_t kvtophys(vaddr_t);	/* XXX */
 
-static void arc_kseg2_make_cacheable(vaddr_t vaddr, vsize_t size);
-
-static void
-arc_kseg2_make_cacheable(vaddr_t vaddr, vsize_t size)
-{
-	vaddr_t start, end;
-	pt_entry_t *pte;
-	uint32_t entry, mask;
-
-	start = mips_trunc_page(vaddr);
-	end = mips_round_page(vaddr + size);
-	mask = ~(CPUISMIPS3 ? MIPS3_PG_UNCACHED : MIPS1_PG_N);
-	for (; start < end; start += PAGE_SIZE) {
-		pte = kvtopte(start);
-		entry = pte->pt_entry & mask;
-		pte->pt_entry &= entry;
-		tlb_update(start, entry);
-	}
-}
-
 void
 arc_sparse_bus_space_init(bus_space_tag_t bst, const char *name, paddr_t paddr,
     bus_addr_t start, bus_size_t size)
@@ -96,7 +75,8 @@
 	 * Since all buses can be linearly mappable, we don't have to check
 	 * BUS_SPACE_MAP_LINEAR and BUS_SPACE_MAP_PREFETCHABLE.
 	 */
-	int cacheable = (flags & BUS_SPACE_MAP_CACHEABLE);
+	const bool cacheable = (flags & BUS_SPACE_MAP_CACHEABLE) != 0;
+	const u_int pmap_flags = cacheable ? PMAP_WRITE_BACK : 0;
 
 	/*
 	 * XXX - `bst->bs_pbase' must be page aligned,
@@ -111,22 +91,20 @@
 		    MIPS_PHYS_TO_KSEG0(start) :
 		    MIPS_PHYS_TO_KSEG1(start));
 	} else {
-		vaddr_t va,
-		    vaddr = uvm_km_alloc(kernel_map, (vsize_t)(end - start), 0,
-		    UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
+		vaddr_t vaddr = uvm_km_alloc(kernel_map, (vsize_t)(end - start),
+		    0, UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 
 		if (vaddr == 0)
 			panic("arc_sparse_bus_space_compose_handle: "
 			      "cannot allocate KVA 0x%llx..0x%llx",
 			      start, end);
-		for (va = vaddr; start < end;
-		     start += PAGE_SIZE, va += PAGE_SIZE)
-			pmap_kenter_pa(va, start,
-			    VM_PROT_READ|VM_PROT_WRITE, 0);
+		for (vaddr_t va = vaddr; start < end;
+		     start += PAGE_SIZE, va += PAGE_SIZE) {
+			pmap_kenter_pa(va, start, VM_PROT_READ|VM_PROT_WRITE,
+			    pmap_flags);
+		}
 		pmap_update(pmap_kernel());
 		vaddr += (offset & PGOFSET);
-		if (cacheable)
-			arc_kseg2_make_cacheable(vaddr, size);
 		*bshp = vaddr;
 	}
 	return 0;
--- a/sys/arch/arc/arc/c_nec_eisa.c	Sun Oct 02 10:39:29 2016 +0000
+++ b/sys/arch/arc/arc/c_nec_eisa.c	Wed Oct 05 20:55:23 2016 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_nec_eisa.c,v 1.16 2011/02/20 07:52:42 matt Exp $	*/
+/*	$NetBSD: c_nec_eisa.c,v 1.16.32.1 2016/10/05 20:55:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2003 Izumi Tsutsui.  All rights reserved.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: c_nec_eisa.c,v 1.16 2011/02/20 07:52:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: c_nec_eisa.c,v 1.16.32.1 2016/10/05 20:55:24 skrll Exp $");
 
 #define __INTR_PRIVATE