Sync with head. ktrace-lwp
authorchristos <christos@NetBSD.org>
Sun, 11 Dec 2005 10:28:12 +0000
branchktrace-lwp
changeset 290474 87a912d0427c
parent 290473 150d150298c5
Sync with head.
sys/arch/acorn26/acorn26/pmap.c
sys/arch/acorn26/conf/FOURMEG
sys/arch/acorn26/conf/GENERIC
sys/arch/acorn26/conf/INSTALL
sys/arch/acorn32/acorn32/hydra.c
sys/arch/acorn32/conf/EB7500ATX
sys/arch/acorn32/conf/GENERIC
sys/arch/acorn32/conf/INSTALL
sys/arch/acorn32/conf/LOWMEM_WSCONS
sys/arch/acorn32/conf/RPC_WSCONS
sys/arch/algor/algor/bus_dma.c
sys/arch/algor/conf/P4032
sys/arch/algor/conf/P5064
sys/arch/algor/conf/P6032
sys/arch/alpha/common/bus_dma.c
sys/arch/alpha/conf/ALPHA
sys/arch/alpha/conf/BASIL
sys/arch/alpha/conf/FRAU-FARBISSINA
sys/arch/alpha/conf/GENERIC
sys/arch/alpha/conf/INSTALL
sys/arch/alpha/conf/RAWHIDE
sys/arch/amd64/amd64/linux_syscall.c
sys/arch/amd64/amd64/syscall.c
sys/arch/amd64/conf/GENERIC
sys/arch/amd64/conf/INSTALL
sys/arch/amd64/conf/Makefile.amd64
sys/arch/amd64/conf/SIMICS
sys/arch/amiga/conf/AMIGA
sys/arch/amiga/conf/DRACO
sys/arch/amiga/conf/GENERIC
sys/arch/amiga/conf/GENERIC.in
sys/arch/amiga/conf/INSTALL
sys/arch/amiga/conf/MDINSTALL
sys/arch/amiga/conf/WSCONS
sys/arch/amiga/dev/sci.c
sys/arch/amigappc/conf/NULL
sys/arch/arc/TODO
sys/arch/arc/arc/arc_trap.c
sys/arch/arc/arc/bus_dma.c
sys/arch/arc/arc/bus_space_sparse.c
sys/arch/arc/arc/c_isa.c
sys/arch/arc/arc/c_nec_eisa.c
sys/arch/arc/arc/machdep.c
sys/arch/arc/arc/p_dti_tyne.c
sys/arch/arc/arc/wired_map.c
sys/arch/arc/conf/ARCTIC
sys/arch/arc/conf/GENERIC
sys/arch/arc/conf/M403
sys/arch/arc/conf/MIMORI
sys/arch/arc/conf/Makefile.arc.inc
sys/arch/arc/conf/PCCONS
sys/arch/arc/conf/PICA
sys/arch/arc/conf/RAMDISK
sys/arch/arc/conf/RPC44
sys/arch/arc/include/cpu.h
sys/arch/arc/isa/isabus.c
sys/arch/arc/jazz/jazzio.c
sys/arch/arc/jazz/pccons_jazzio.c
sys/arch/arc/pci/necpb.c
sys/arch/arm/arm/bcopyinout_xscale.S
sys/arch/arm/arm/undefined.c
sys/arch/arm/arm32/bus_dma.c
sys/arch/arm/arm32/pmap.c
sys/arch/arm/conf/Makefile.arm
sys/arch/arm/ep93xx/ep93xx_intr.c
sys/arch/arm/ep93xx/ep93xx_space.c
sys/arch/arm/ep93xx/ep93xxreg.h
sys/arch/arm/ep93xx/epclk.c
sys/arch/arm/ep93xx/epclkreg.h
sys/arch/arm/ep93xx/epe.c
sys/arch/arm/ep93xx/epgpio.c
sys/arch/arm/ep93xx/epgpioreg.h
sys/arch/arm/ep93xx/epgpiovar.h
sys/arch/arm/ep93xx/epled.c
sys/arch/arm/ep93xx/epledvar.h
sys/arch/arm/ep93xx/eppcic.c
sys/arch/arm/ep93xx/eppcicvar.h
sys/arch/arm/ep93xx/eprtc.c
sys/arch/arm/ep93xx/eprtcreg.h
sys/arch/arm/ep93xx/epsmcreg.h
sys/arch/arm/ep93xx/epsoc.c
sys/arch/arm/ep93xx/epsocvar.h
sys/arch/arm/ep93xx/epwdog.c
sys/arch/arm/ep93xx/epwdogreg.h
sys/arch/arm/ep93xx/epwdogvar.h
sys/arch/arm/ep93xx/files.ep93xx
sys/arch/arm/footbridge/footbridge_io.c
sys/arch/arm/include/arm32/pmap.h
sys/arch/arm/ixp12x0/ixp12x0_io.c
sys/arch/arm/mainbus/mainbus_io.c
sys/arch/arm/s3c2xx0/s3c2800_pci.c
sys/arch/arm/s3c2xx0/s3c2xx0_space.c
sys/arch/arm/sa11x0/sa11x0_io.c
sys/arch/arm/xscale/i80312_space.c
sys/arch/arm/xscale/i80321_space.c
sys/arch/arm/xscale/ixp425_pci_space.c
sys/arch/arm/xscale/ixp425_space.c
sys/arch/arm/xscale/pxa2x0_space.c
sys/arch/atari/atari/bus.c
sys/arch/bebox/bebox/clock.c
sys/arch/bebox/conf/GENERIC
sys/arch/bebox/conf/INSTALL
sys/arch/cats/conf/GENERIC
sys/arch/cats/conf/INSTALL
sys/arch/cats/conf/Makefile.cats.inc
sys/arch/cesfic/conf/GENERIC
sys/arch/cobalt/cobalt/bus.c
sys/arch/cobalt/conf/GENERIC
sys/arch/cobalt/conf/INSTALL
sys/arch/cobalt/stand/boot/boot.c
sys/arch/dreamcast/conf/GENERIC
sys/arch/dreamcast/conf/Makefile.dreamcast.inc
sys/arch/dreamcast/dev/g2/gapspci_dma.c
sys/arch/evbarm/adi_brh/obio_space.c
sys/arch/evbarm/armadillo/TODO
sys/arch/evbarm/armadillo/armadillo9_iic.c
sys/arch/evbarm/armadillo/armadillo9_machdep.c
sys/arch/evbarm/armadillo/armadillo9_pcic.c
sys/arch/evbarm/armadillo/armadillo9_start.S
sys/arch/evbarm/armadillo/armadillo9reg.h
sys/arch/evbarm/conf/ADI_BRH
sys/arch/evbarm/conf/ARMADILLO9
sys/arch/evbarm/conf/INTEGRATOR
sys/arch/evbarm/conf/IQ31244
sys/arch/evbarm/conf/IQ80310
sys/arch/evbarm/conf/IQ80321
sys/arch/evbarm/conf/IXDP425
sys/arch/evbarm/conf/IXM1200
sys/arch/evbarm/conf/LUBBOCK
sys/arch/evbarm/conf/Makefile.evbarm.inc
sys/arch/evbarm/conf/NAPPI
sys/arch/evbarm/conf/SMDK2410
sys/arch/evbarm/conf/SMDK2800
sys/arch/evbarm/conf/TEAMASA_NPWR
sys/arch/evbarm/conf/TEAMASA_NPWR_FC
sys/arch/evbarm/conf/TS7200
sys/arch/evbarm/conf/ZAO425
sys/arch/evbarm/conf/files.armadillo9
sys/arch/evbarm/conf/mk.armadillo9
sys/arch/evbarm/conf/std.armadillo9
sys/arch/evbarm/ifpga/ifpga_io.c
sys/arch/evbarm/iq80310/obio_space.c
sys/arch/evbarm/iq80321/obio_space.c
sys/arch/evbarm/tsarm/tspld.c
sys/arch/evbmips/conf/MALTA
sys/arch/evbmips/conf/Makefile.evbmips.inc
sys/arch/evbmips/conf/PB1000
sys/arch/evbmips/include/intr.h
sys/arch/evbmips/malta/malta_intr.c
sys/arch/evbmips/malta/pci/pchb.c
sys/arch/evbmips/pci/pci_alignstride_bus_io_chipdep.c
sys/arch/evbppc/conf/EV64260
sys/arch/evbppc/conf/EXPLORA451
sys/arch/evbppc/conf/INSTALL_OPENBLOCKS266
sys/arch/evbppc/conf/INSTALL_WALNUT
sys/arch/evbppc/conf/Makefile.ev64260.inc
sys/arch/evbppc/conf/Makefile.explora.inc
sys/arch/evbppc/conf/Makefile.obs200.inc
sys/arch/evbppc/conf/Makefile.obs405.inc
sys/arch/evbppc/conf/Makefile.walnut.inc
sys/arch/evbppc/conf/OPENBLOCKS200
sys/arch/evbppc/conf/OPENBLOCKS266
sys/arch/evbppc/conf/WALNUT
sys/arch/evbppc/ev64260/clock.c
sys/arch/evbppc/evbppc/bus_dma.c
sys/arch/evbsh3/conf/COMPUTEX7750
sys/arch/evbsh3/conf/COMPUTEXEVB
sys/arch/evbsh3/conf/CQREEKSH3
sys/arch/evbsh3/conf/KZSH401
sys/arch/evbsh3/evbsh3/machdep.c
sys/arch/evbsh3/include/intr.h
sys/arch/evbsh5/conf/CAYMAN
sys/arch/evbsh5/conf/SIMULATOR
sys/arch/hp300/conf/GENERIC
sys/arch/hp300/conf/INSTALL
sys/arch/hp300/include/aout_machdep.h
sys/arch/hp300/include/autoconf.h
sys/arch/hp300/include/cdefs.h
sys/arch/hp300/include/db_machdep.h
sys/arch/hp300/include/disklabel.h
sys/arch/hp300/include/elf_machdep.h
sys/arch/hp300/include/hpux_machdep.h
sys/arch/hp300/include/kcore.h
sys/arch/hp300/include/limits.h
sys/arch/hp300/include/param.h
sys/arch/hp300/include/reg.h
sys/arch/hp300/include/types.h
sys/arch/hp700/conf/GENERIC
sys/arch/hp700/hp700/mainbus.c
sys/arch/hp700/include/intr.h
sys/arch/hpcarm/conf/IPAQ
sys/arch/hpcarm/conf/JORNADA720
sys/arch/hpcarm/dev/j720ssp.c
sys/arch/hpcmips/conf/GENERIC
sys/arch/hpcmips/conf/LCARD
sys/arch/hpcmips/conf/LROUTER
sys/arch/hpcmips/conf/MPC303
sys/arch/hpcmips/conf/NULLCONF
sys/arch/hpcmips/conf/TX3912
sys/arch/hpcmips/conf/TX3922
sys/arch/hpcmips/conf/VR41XX
sys/arch/hpcmips/hpcmips/bus_dma.c
sys/arch/hpcmips/stand/pbsdboot/main.c
sys/arch/hpcsh/conf/GENERIC
sys/arch/hpcsh/conf/HPW650PA
sys/arch/i386/acpi/sony_acpi.c
sys/arch/i386/conf/GENERIC
sys/arch/i386/conf/GENERIC.MPACPI
sys/arch/i386/conf/GENERIC_LAPTOP
sys/arch/i386/conf/GENERIC_PS2TINY
sys/arch/i386/conf/GENERIC_TINY
sys/arch/i386/conf/GENERIC_VERIEXEC
sys/arch/i386/conf/INSTALL
sys/arch/i386/conf/INSTALL.local
sys/arch/i386/conf/INSTALL_LAPTOP
sys/arch/i386/conf/INSTALL_SMALL
sys/arch/i386/conf/INSTALL_TINY
sys/arch/i386/conf/INSTALL_XENU
sys/arch/i386/conf/LAMB
sys/arch/i386/conf/NET4501
sys/arch/i386/conf/SWINGER
sys/arch/i386/conf/VIRTUALPC
sys/arch/i386/conf/XEN0
sys/arch/i386/conf/XENU
sys/arch/i386/conf/files.i386
sys/arch/i386/pci/ichlpcib.c
sys/arch/i386/stand/Makefile
sys/arch/i386/stand/bootxx/bootxx_cd9660/Makefile
sys/arch/i386/stand/cdboot/Makefile
sys/arch/i386/stand/lib/comio_direct.c
sys/arch/i386/stand/lib/comio_direct.h
sys/arch/i386/stand/lib/pcio.c
sys/arch/i386/stand/pxeboot/Makefile
sys/arch/i386/stand/pxeboot/main.c
sys/arch/i386/stand/pxeboot/start_pxe.S
sys/arch/i386/stand/pxeboot_com0/Makefile
sys/arch/ibmnws/conf/GENERIC
sys/arch/ibmnws/ibmnws/clock.c
sys/arch/iyonix/conf/GENERIC
sys/arch/iyonix/include/joystick.h
sys/arch/iyonix/iyonix/obio_space.c
sys/arch/luna68k/conf/GENERIC
sys/arch/m68k/m68k/bus_dma.c
sys/arch/mac68k/conf/GENERIC
sys/arch/mac68k/conf/GENERICSBC
sys/arch/mac68k/conf/INSTALL
sys/arch/mac68k/conf/INSTALLSBC
sys/arch/mac68k/conf/SMALLRAM
sys/arch/mac68k/include/intr.h
sys/arch/mac68k/mac68k/bus_space.c
sys/arch/mac68k/mac68k/intr.c
sys/arch/macppc/conf/GENERIC
sys/arch/macppc/conf/INSTALL
sys/arch/macppc/conf/Makefile.macppc
sys/arch/macppc/conf/POWERMAC
sys/arch/macppc/macppc/bus_dma.c
sys/arch/mips/alchemy/au_timer.c
sys/arch/mips/alchemy/dev/if_aumac.c
sys/arch/mips/conf/Makefile.mips
sys/arch/mips/include/pte.h
sys/arch/mips/mips/bus_dma.c
sys/arch/mips/mips/cache.c
sys/arch/mips/mips/cache_r5900.c
sys/arch/mips/mips/kgdb_machdep.c
sys/arch/mips/mips/locore.S
sys/arch/mips/mips/pmap.c
sys/arch/mips/mips/wired_map.c
sys/arch/mips/sibyte/dev/sbobio.c
sys/arch/mipsco/conf/GENERIC
sys/arch/mipsco/conf/INSTALL
sys/arch/mipsco/conf/RC3230
sys/arch/mipsco/mipsco/bus_dma.c
sys/arch/mmeye/conf/GENERIC
sys/arch/mmeye/conf/MMEYE
sys/arch/mmeye/conf/MMTA
sys/arch/mmeye/conf/MMTAICE
sys/arch/mmeye/conf/MMTAROMNEW
sys/arch/mvme68k/conf/GENERIC
sys/arch/mvme68k/conf/RAMDISK
sys/arch/mvme68k/conf/VME147
sys/arch/mvme68k/conf/VME162
sys/arch/mvme68k/conf/VME167
sys/arch/mvme68k/conf/VME172
sys/arch/mvme68k/conf/VME177
sys/arch/mvme68k/mvme68k/bus_dma.c
sys/arch/mvmeppc/conf/MVME1600
sys/arch/mvmeppc/mvmeppc/clock.c
sys/arch/netwinder/conf/GENERIC
sys/arch/netwinder/conf/Makefile.netwinder.inc
sys/arch/news68k/conf/GENERIC
sys/arch/news68k/conf/GENERIC_TINY
sys/arch/news68k/conf/INSTALL
sys/arch/news68k/conf/LIBERO
sys/arch/news68k/conf/NEWS1200
sys/arch/news68k/include/aout_machdep.h
sys/arch/news68k/include/autoconf.h
sys/arch/news68k/include/cdefs.h
sys/arch/news68k/include/db_machdep.h
sys/arch/news68k/include/disklabel.h
sys/arch/news68k/include/elf_machdep.h
sys/arch/news68k/include/kcore.h
sys/arch/news68k/include/limits.h
sys/arch/news68k/include/loadfile_machdep.h
sys/arch/news68k/include/param.h
sys/arch/news68k/include/reg.h
sys/arch/news68k/include/types.h
sys/arch/newsmips/conf/DEJIKO
sys/arch/newsmips/conf/GENERIC
sys/arch/newsmips/conf/INSTALL
sys/arch/newsmips/conf/WAPIKO
sys/arch/newsmips/newsmips/bus.c
sys/arch/next68k/conf/GENERIC
sys/arch/ofppc/conf/BRIQ
sys/arch/ofppc/conf/GENERIC
sys/arch/ofppc/firepower/firepower_intr.c
sys/arch/ofppc/include/intr.h
sys/arch/ofppc/ofppc/clock.c
sys/arch/ofppc/ofppc/machdep.c
sys/arch/ofppc/ofwgen/ofwgen_intr.c
sys/arch/pc532/conf/BULLBOX
sys/arch/pc532/conf/DUMMY
sys/arch/pc532/conf/GENERIC
sys/arch/pc532/conf/INSTALL
sys/arch/pc532/conf/KLONDIKE
sys/arch/pc532/conf/SALMON
sys/arch/pc532/conf/STEELHEAD
sys/arch/pdp10/conf/GENERIC
sys/arch/playstation2/conf/GENERIC
sys/arch/playstation2/conf/config.playstation2
sys/arch/playstation2/playstation2/bus_dma.c
sys/arch/pmax/conf/GENERIC
sys/arch/pmax/conf/INSTALL
sys/arch/pmax/conf/WSCONS
sys/arch/pmax/dev/rcons.c
sys/arch/pmax/pmax/bus_dma.c
sys/arch/pmppc/conf/INSTALL
sys/arch/pmppc/conf/PMPPC
sys/arch/pmppc/conf/std.pmppc
sys/arch/powerpc/conf/Makefile.powerpc
sys/arch/powerpc/ibm4xx/clock.c
sys/arch/powerpc/include/ibm4xx/ibm4xx_intr.h
sys/arch/powerpc/include/spr.h
sys/arch/powerpc/marvell/bus_dma.c
sys/arch/powerpc/marvell/marvell_intr.h
sys/arch/powerpc/oea/pmap.c
sys/arch/powerpc/powerpc/bus_dma.c
sys/arch/prep/conf/GENERIC
sys/arch/prep/conf/INSTALL
sys/arch/prep/conf/NATSUMI
sys/arch/prep/prep/clock.c
sys/arch/sandpoint/conf/GENERIC
sys/arch/sandpoint/conf/GENERIC.sandpoint
sys/arch/sandpoint/sandpoint/clock.c
sys/arch/sbmips/TODO
sys/arch/sbmips/conf/GENERIC
sys/arch/sbmips/conf/Makefile.sbmips.inc
sys/arch/sbmips/conf/files.sbmips
sys/arch/sbmips/include/intr.h
sys/arch/sbmips/include/systemsw.h
sys/arch/sbmips/include/types.h
sys/arch/sbmips/sbmips/sb1250_icu.c
sys/arch/sbmips/sbmips/softintr.c
sys/arch/sbmips/sbmips/systemsw.c
sys/arch/sgimips/conf/GENERIC32_IP2x
sys/arch/sgimips/conf/GENERIC32_IP3x
sys/arch/sgimips/dev/crime.c
sys/arch/sgimips/mace/if_mec.c
sys/arch/sgimips/mace/if_mecreg.h
sys/arch/sgimips/mace/mace.c
sys/arch/sgimips/sgimips/bus.c
sys/arch/sh5/sh5/bus_dma.c
sys/arch/sh5/sh5/pmap.c
sys/arch/shark/conf/GENERIC
sys/arch/shark/conf/INSTALL
sys/arch/shark/conf/Makefile.shark.inc
sys/arch/shark/conf/OFWGENCFG
sys/arch/shark/ofw/ofw.c
sys/arch/sparc/conf/BILL-THE-CAT
sys/arch/sparc/conf/GENERIC
sys/arch/sparc/conf/INSTALL
sys/arch/sparc/conf/KRUPS
sys/arch/sparc/conf/MRCOFFEE
sys/arch/sparc/conf/TADPOLE3GX
sys/arch/sparc/conf/files.sparc
sys/arch/sparc/dev/bwtwo_obio.c
sys/arch/sparc/dev/cgeight.c
sys/arch/sparc/dev/cgfour.c
sys/arch/sparc/dev/cgfourteen.c
sys/arch/sparc/dev/cgfourteenreg.h
sys/arch/sparc/dev/cgfourteenvar.h
sys/arch/sparc/dev/cgsix_obio.c
sys/arch/sparc/dev/cgtwo.c
sys/arch/sparc/dev/com_ebus.c
sys/arch/sparc/dev/com_obio.c
sys/arch/sparc/dev/cons.h
sys/arch/sparc/dev/dma_obio.c
sys/arch/sparc/dev/ebus.c
sys/arch/sparc/dev/esp_obio.c
sys/arch/sparc/dev/fd.c
sys/arch/sparc/dev/if_ie_obio.c
sys/arch/sparc/dev/if_le_obio.c
sys/arch/sparc/dev/kbd_pckbport.c
sys/arch/sparc/dev/kd.c
sys/arch/sparc/dev/ms_pckbport.c
sys/arch/sparc/dev/obio.c
sys/arch/sparc/dev/pckbc_js.c
sys/arch/sparc/dev/power.c
sys/arch/sparc/dev/power.h
sys/arch/sparc/dev/rtc.c
sys/arch/sparc/dev/sbus.c
sys/arch/sparc/dev/sbusreg.h
sys/arch/sparc/dev/sw.c
sys/arch/sparc/dev/tctrl.c
sys/arch/sparc/dev/tctrlvar.h
sys/arch/sparc/dev/ts102.c
sys/arch/sparc/dev/vme_machdep.c
sys/arch/sparc/dev/vmereg.h
sys/arch/sparc/dev/zs.c
sys/arch/sparc/dev/zs_kgdb.c
sys/arch/sparc/fpu/fpu.c
sys/arch/sparc/fpu/fpu_add.c
sys/arch/sparc/fpu/fpu_div.c
sys/arch/sparc/fpu/fpu_explode.c
sys/arch/sparc/fpu/fpu_extern.h
sys/arch/sparc/fpu/fpu_implode.c
sys/arch/sparc/fpu/fpu_mul.c
sys/arch/sparc/fpu/fpu_sqrt.c
sys/arch/sparc/sparc/autoconf.c
sys/arch/sparc/sparc/auxiotwo.c
sys/arch/sparc/sparc/auxiotwo.h
sys/arch/sparc/sparc/auxreg.c
sys/arch/sparc/sparc/auxreg.h
sys/arch/sparc/sparc/cache.c
sys/arch/sparc/sparc/cache.h
sys/arch/sparc/sparc/clkctrl.c
sys/arch/sparc/sparc/clock.c
sys/arch/sparc/sparc/compat_13_machdep.c
sys/arch/sparc/sparc/cpu.c
sys/arch/sparc/sparc/db_disasm.c
sys/arch/sparc/sparc/db_interface.c
sys/arch/sparc/sparc/db_trace.c
sys/arch/sparc/sparc/eeprom.c
sys/arch/sparc/sparc/emul.c
sys/arch/sparc/sparc/in_cksum.c
sys/arch/sparc/sparc/intr.c
sys/arch/sparc/sparc/intreg.h
sys/arch/sparc/sparc/iommu.c
sys/arch/sparc/sparc/iommureg.h
sys/arch/sparc/sparc/kgdb_machdep.c
sys/arch/sparc/sparc/locore.s
sys/arch/sparc/sparc/machdep.c
sys/arch/sparc/sparc/mem.c
sys/arch/sparc/sparc/memecc.c
sys/arch/sparc/sparc/memreg.c
sys/arch/sparc/sparc/memreg.h
sys/arch/sparc/sparc/mkclock.c
sys/arch/sparc/sparc/msiiep.c
sys/arch/sparc/sparc/oclock.c
sys/arch/sparc/sparc/openfirm.c
sys/arch/sparc/sparc/openprom.c
sys/arch/sparc/sparc/pci_machdep.c
sys/arch/sparc/sparc/pmap.c
sys/arch/sparc/sparc/process_machdep.c
sys/arch/sparc/sparc/promlib.c
sys/arch/sparc/sparc/sunos_machdep.c
sys/arch/sparc/sparc/svr4_machdep.c
sys/arch/sparc/sparc/sys_machdep.c
sys/arch/sparc/sparc/timer.c
sys/arch/sparc/sparc/timer_msiiep.c
sys/arch/sparc/sparc/timer_sun4.c
sys/arch/sparc/sparc/timer_sun4m.c
sys/arch/sparc/sparc/timerreg.h
sys/arch/sparc/sparc/timervar.h
sys/arch/sparc/sparc/trap.c
sys/arch/sparc/sparc/vm_machdep.c
sys/arch/sparc64/conf/GENERIC
sys/arch/sparc64/conf/GENERIC32
sys/arch/sparc64/conf/INSTALL
sys/arch/sparc64/conf/NONPLUS
sys/arch/sparc64/conf/POWEROFSEVEN.inc
sys/arch/sparc64/conf/SPLODE
sys/arch/sparc64/dev/iommu.c
sys/arch/sun2/conf/DISKLESS
sys/arch/sun2/conf/FOURMEG
sys/arch/sun2/conf/GENERIC
sys/arch/sun2/conf/INSTALL
sys/arch/sun2/conf/RAMDISK
sys/arch/sun2/conf/VME
sys/arch/sun3/conf/FOUR_TTYS
sys/arch/sun3/conf/GENERIC
sys/arch/sun3/conf/GENERIC3X
sys/arch/sun3/conf/INSTALL
sys/arch/sun3/conf/INSTALL3X
sys/arch/sun3/conf/KGDB
sys/arch/sun3/conf/KGDB3X
sys/arch/sun3/conf/RAMDISK
sys/arch/sun3/conf/RAMDISK3X
sys/arch/sun68k/sun68k/bus.c
sys/arch/vax/conf/GENERIC
sys/arch/vax/conf/INSTALL
sys/arch/vax/include/intr.h
sys/arch/vax/uba/qv.c
sys/arch/vax/vax/bus_dma.c
sys/arch/vax/vax/bus_mem.c
sys/arch/x68k/conf/GENERIC
sys/arch/x68k/conf/INSTALL
sys/arch/x68k/dev/mha.c
sys/arch/x68k/include/intr.h
sys/arch/x68k/x68k/bus.c
sys/arch/x86/include/specialreg.h
sys/arch/x86/pci/pci_machdep.c
sys/arch/x86/x86/bus_dma.c
sys/arch/x86/x86/bus_space.c
sys/arch/xen/conf/files.xen
sys/arch/xen/i386/machdep.c
sys/arch/xen/i386/pmap.c
sys/arch/xen/include/vmparam.h
sys/arch/xen/x86/bus_space.c
sys/compat/common/kern_ipc_10.c
sys/compat/common/sysv_ipc_14.c
sys/compat/common/sysv_msg_14.c
sys/compat/common/sysv_sem_14.c
sys/compat/common/sysv_shm_14.c
sys/compat/common/tty_43.c
sys/compat/freebsd/freebsd_ipc.c
sys/compat/ibcs2/ibcs2_ipc.c
sys/compat/linux/arch/alpha/linux_machdep.h
sys/compat/linux/arch/amd64/linux_machdep.h
sys/compat/linux/arch/amd64/linux_syscall.h
sys/compat/linux/arch/amd64/linux_syscallargs.h
sys/compat/linux/arch/amd64/linux_syscalls.c
sys/compat/linux/arch/amd64/linux_sysent.c
sys/compat/linux/arch/amd64/syscalls.master
sys/compat/linux/arch/m68k/linux_machdep.h
sys/compat/linux/arch/mips/linux_machdep.h
sys/compat/linux/arch/powerpc/linux_machdep.h
sys/compat/linux/common/linux_exec.c
sys/compat/linux/common/linux_futex.c
sys/compat/linux/common/linux_ipc.c
sys/compat/linux/common/linux_ipc.h
sys/compat/linux/common/linux_misc.c
sys/compat/linux/common/linux_misc_notalpha.c
sys/compat/linux/common/linux_sched.c
sys/compat/linux/common/linux_shm.h
sys/compat/linux/common/linux_signal.c
sys/compat/mach/mach_clock.c
sys/compat/netbsd32/netbsd32_compat_10.c
sys/compat/netbsd32/netbsd32_compat_14.c
sys/compat/netbsd32/netbsd32_time.c
sys/compat/ossaudio/ossaudio.c
sys/compat/pecoff/pecoff_syscall.h
sys/compat/pecoff/pecoff_syscallargs.h
sys/compat/pecoff/pecoff_syscalls.c
sys/compat/pecoff/pecoff_sysent.c
sys/compat/pecoff/syscalls.master
sys/compat/sys/ipc.h
sys/compat/sys/msg.h
sys/compat/sys/sem.h
sys/compat/sys/shm.h
sys/conf/Makefile.kern.inc
sys/conf/files
sys/ddb/db_command.c
sys/ddb/db_command.h
sys/ddb/db_interface.h
sys/ddb/db_lex.c
sys/ddb/db_lex.h
sys/ddb/db_variables.c
sys/ddb/db_xxx.c
sys/ddb/files.ddb
sys/dev/DEVNAMES
sys/dev/acpi/acpidevs
sys/dev/acpi/acpidevs_data.h
sys/dev/clockctl.c
sys/dev/hpc/biconsdev.c
sys/dev/hpc/hpf1275a_tty.c
sys/dev/i2o/dpti.c
sys/dev/ic/aac.c
sys/dev/ic/aic79xx.c
sys/dev/ic/aic79xx_osm.c
sys/dev/ic/aic79xxvar.h
sys/dev/ic/aic7xxx.c
sys/dev/ic/aic7xxx_inline.h
sys/dev/ic/aic7xxx_osm.c
sys/dev/ic/aic7xxxvar.h
sys/dev/ic/ath.c
sys/dev/ic/ath_netbsd.c
sys/dev/ic/athioctl.h
sys/dev/ic/athrate-amrr.c
sys/dev/ic/athrate-onoe.c
sys/dev/ic/athrate-sample.c
sys/dev/ic/athvar.h
sys/dev/ic/atw.c
sys/dev/ic/esiop.c
sys/dev/ic/esiopvar.h
sys/dev/ic/ral.c
sys/dev/ic/rtl81x9.c
sys/dev/ic/rtw.c
sys/dev/ic/rtwreg.h
sys/dev/ic/rtwvar.h
sys/dev/ic/siop.c
sys/dev/ic/siop_common.c
sys/dev/ic/siopvar.h
sys/dev/ic/siopvar_common.h
sys/dev/ic/wdc.c
sys/dev/ic/wi.c
sys/dev/ic/wivar.h
sys/dev/ieee1394/fw_port.h
sys/dev/ir/irframe_tty.c
sys/dev/microcode/siop/esiop.out
sys/dev/microcode/siop/esiop.ss
sys/dev/microcode/siop/siop.out
sys/dev/microcode/siop/siop.ss
sys/dev/mii/brgphy.c
sys/dev/mii/ciphy.c
sys/dev/mii/miidevs
sys/dev/mii/miidevs.h
sys/dev/mii/miidevs_data.h
sys/dev/pci/Makefile
sys/dev/pci/amdpm.c
sys/dev/pci/auich.c
sys/dev/pci/auichreg.h
sys/dev/pci/auvia.c
sys/dev/pci/bktr/bktr_audio.c
sys/dev/pci/bktr/bktr_card.c
sys/dev/pci/bktr/bktr_card.h
sys/dev/pci/ehci_pci.c
sys/dev/pci/files.pci
sys/dev/pci/hifn7751.c
sys/dev/pci/if_bge.c
sys/dev/pci/if_bgereg.h
sys/dev/pci/if_de.c
sys/dev/pci/if_iwi.c
sys/dev/pci/if_iwireg.h
sys/dev/pci/if_iwivar.h
sys/dev/pci/if_lmc.c
sys/dev/pci/if_lmc.h
sys/dev/pci/if_lmc_common.c
sys/dev/pci/if_lmc_media.c
sys/dev/pci/if_lmc_nbsd.c
sys/dev/pci/if_lmc_types.h
sys/dev/pci/if_lmcioctl.h
sys/dev/pci/if_lmcvar.h
sys/dev/pci/if_re_pci.c
sys/dev/pci/if_rtw_pci.c
sys/dev/pci/if_sk.c
sys/dev/pci/if_tlp_pci.c
sys/dev/pci/if_vge.c
sys/dev/pci/pcidevs
sys/dev/pci/pcidevs.h
sys/dev/pci/pcidevs_data.h
sys/dev/pci/pdcsata.c
sys/dev/pci/ubsec.c
sys/dev/sbus/p9100.c
sys/dev/sbus/p9100reg.h
sys/dev/sbus/stp4020.c
sys/dev/scsipi/cd.c
sys/dev/scsipi/scsiconf.c
sys/dev/scsipi/sd.c
sys/dev/sun/sunkbd.c
sys/dev/sun/sunms.c
sys/dev/tc/bba.c
sys/dev/tc/px.c
sys/dev/usb/ehci.c
sys/dev/usb/ehcireg.h
sys/dev/usb/ehcivar.h
sys/dev/usb/if_atu.c
sys/dev/usb/if_aue.c
sys/dev/usb/if_axe.c
sys/dev/usb/if_cdce.c
sys/dev/usb/if_cue.c
sys/dev/usb/if_kue.c
sys/dev/usb/if_udav.c
sys/dev/usb/if_upl.c
sys/dev/usb/if_ural.c
sys/dev/usb/if_url.c
sys/dev/usb/ohci.c
sys/dev/usb/ohcivar.h
sys/dev/usb/ugen.c
sys/dev/usb/uhid.c
sys/dev/usb/uhidev.c
sys/dev/usb/uhidev.h
sys/dev/usb/ulpt.c
sys/dev/usb/ums.c
sys/dev/usb/usb_quirks.c
sys/dev/usb/usb_subr.c
sys/dev/usb/usbdevs
sys/dev/usb/usbdevs.h
sys/dev/usb/usbdevs_data.h
sys/dev/usb/usbdi.h
sys/dev/verified_exec.c
sys/dev/wscons/wsconsio.h
sys/dev/wscons/wsdisplay.c
sys/dev/wscons/wsdisplay_compat_usl.c
sys/dev/wscons/wskbd.c
sys/dev/wscons/wsmouse.c
sys/dev/wscons/wsmousevar.h
sys/dev/wscons/wsmux.c
sys/fs/adosfs/adosfs.h
sys/fs/adosfs/advnops.c
sys/fs/cd9660/cd9660_extern.h
sys/fs/cd9660/cd9660_mount.h
sys/fs/cd9660/cd9660_node.h
sys/fs/cd9660/cd9660_rrip.h
sys/fs/cd9660/cd9660_vnops.c
sys/fs/cd9660/iso.h
sys/fs/cd9660/iso_rrip.h
sys/fs/filecorefs/filecore.h
sys/fs/filecorefs/filecore_extern.h
sys/fs/filecorefs/filecore_mount.h
sys/fs/filecorefs/filecore_node.h
sys/fs/filecorefs/filecore_vnops.c
sys/fs/msdosfs/bootsect.h
sys/fs/msdosfs/bpb.h
sys/fs/msdosfs/denode.h
sys/fs/msdosfs/direntry.h
sys/fs/msdosfs/fat.h
sys/fs/msdosfs/msdosfs_vnops.c
sys/fs/msdosfs/msdosfsmount.h
sys/fs/ntfs/ntfs.h
sys/fs/ntfs/ntfs_compr.h
sys/fs/ntfs/ntfs_ihash.h
sys/fs/ntfs/ntfs_inode.h
sys/fs/ntfs/ntfs_subr.h
sys/fs/ntfs/ntfs_vfsops.h
sys/fs/ntfs/ntfsmount.h
sys/fs/ptyfs/ptyfs.h
sys/fs/smbfs/smbfs.h
sys/fs/smbfs/smbfs_node.h
sys/fs/tmpfs/tmpfs.h
sys/fs/tmpfs/tmpfs_fifoops.h
sys/fs/tmpfs/tmpfs_pool.h
sys/fs/tmpfs/tmpfs_specops.h
sys/fs/tmpfs/tmpfs_subr.c
sys/fs/tmpfs/tmpfs_vnops.c
sys/fs/tmpfs/tmpfs_vnops.h
sys/fs/union/union.h
sys/kern/core_elf32.c
sys/kern/core_netbsd.c
sys/kern/exec_macho.c
sys/kern/init_main.c
sys/kern/init_sysctl.c
sys/kern/init_sysent.c
sys/kern/kern_descrip.c
sys/kern/kern_lkm.c
sys/kern/kern_lwp.c
sys/kern/kern_physio.c
sys/kern/kern_proc.c
sys/kern/kern_ras.c
sys/kern/kern_sig.c
sys/kern/kern_sysctl.c
sys/kern/kern_systrace.c
sys/kern/kern_time.c
sys/kern/kern_verifiedexec.c
sys/kern/kgdb_stub.c
sys/kern/makesyscalls.sh
sys/kern/subr_pool.c
sys/kern/sys_pipe.c
sys/kern/sys_process.c
sys/kern/sys_socket.c
sys/kern/syscalls.c
sys/kern/syscalls.master
sys/kern/sysv_ipc.c
sys/kern/sysv_msg.c
sys/kern/sysv_sem.c
sys/kern/sysv_shm.c
sys/kern/tty.c
sys/kern/tty_conf.c
sys/kern/tty_ptm.c
sys/kern/tty_subr.c
sys/kern/tty_tb.c
sys/kern/tty_tty.c
sys/kern/uipc_domain.c
sys/kern/uipc_mbuf.c
sys/kern/uipc_mbuf2.c
sys/kern/uipc_socket.c
sys/kern/uipc_usrreq.c
sys/kern/vfs_subr.c
sys/kern/vfs_vnops.c
sys/kern/vnode_if.c
sys/kern/vnode_if.sh
sys/miscfs/genfs/genfs_vnops.c
sys/miscfs/kernfs/kernfs_vnops.c
sys/net/agr/ieee8023_slowprotocols.h
sys/net/agr/ieee8023_tlv.h
sys/net/agr/ieee8023ad.h
sys/net/agr/ieee8023ad_impl.h
sys/net/agr/ieee8023ad_lacp.h
sys/net/agr/ieee8023ad_lacp_debug.h
sys/net/agr/ieee8023ad_lacp_impl.h
sys/net/agr/ieee8023ad_lacp_sm.h
sys/net/agr/ieee8023ad_marker.h
sys/net/agr/if_agrethervar.h
sys/net/agr/if_agrioctl.h
sys/net/agr/if_agrsoftc.c
sys/net/agr/if_agrsubr.h
sys/net/agr/if_agrvar.h
sys/net/agr/if_agrvar_impl.h
sys/net/bpf.h
sys/net/bpf_filter.c
sys/net/bpfdesc.h
sys/net/dlt.h
sys/net/ethertypes.h
sys/net/if.h
sys/net/if_arc.h
sys/net/if_arp.h
sys/net/if_atm.h
sys/net/if_bridgevar.h
sys/net/if_dl.h
sys/net/if_eco.h
sys/net/if_ether.h
sys/net/if_faith.h
sys/net/if_fddi.h
sys/net/if_gif.h
sys/net/if_gre.h
sys/net/if_ieee1394.h
sys/net/if_llc.h
sys/net/if_media.h
sys/net/if_ppp.c
sys/net/if_ppp.h
sys/net/if_pppoe.h
sys/net/if_pppvar.h
sys/net/if_sl.c
sys/net/if_slvar.h
sys/net/if_sppp.h
sys/net/if_spppvar.h
sys/net/if_stf.h
sys/net/if_strip.c
sys/net/if_stripvar.h
sys/net/if_tap.h
sys/net/if_types.h
sys/net/net_osdep.h
sys/net/netisr.h
sys/net/netisr_dispatch.h
sys/net/pfil.h
sys/net/pfkeyv2.h
sys/net/ppp-comp.h
sys/net/ppp_defs.h
sys/net/ppp_tty.c
sys/net/radix.h
sys/net/raw_cb.h
sys/net/route.h
sys/net/slcompress.h
sys/net/slip.h
sys/net/zlib.h
sys/net80211/CHANGES
sys/net80211/_ieee80211.h
sys/net80211/files.net80211
sys/net80211/ieee80211.c
sys/net80211/ieee80211.h
sys/net80211/ieee80211_acl.c
sys/net80211/ieee80211_crypto.c
sys/net80211/ieee80211_crypto.h
sys/net80211/ieee80211_crypto_ccmp.c
sys/net80211/ieee80211_crypto_tkip.c
sys/net80211/ieee80211_crypto_wep.c
sys/net80211/ieee80211_input.c
sys/net80211/ieee80211_ioctl.c
sys/net80211/ieee80211_ioctl.h
sys/net80211/ieee80211_netbsd.c
sys/net80211/ieee80211_netbsd.h
sys/net80211/ieee80211_node.c
sys/net80211/ieee80211_node.h
sys/net80211/ieee80211_output.c
sys/net80211/ieee80211_proto.c
sys/net80211/ieee80211_proto.h
sys/net80211/ieee80211_radiotap.h
sys/net80211/ieee80211_rssadapt.h
sys/net80211/ieee80211_sysctl.h
sys/net80211/ieee80211_var.h
sys/netatalk/aarp.h
sys/netatalk/at.h
sys/netatalk/at_extern.h
sys/netatalk/at_var.h
sys/netatalk/ddp.h
sys/netatalk/ddp_var.h
sys/netatalk/phase2.h
sys/netccitt/dll.h
sys/netccitt/hd_var.h
sys/netccitt/hdlc.h
sys/netccitt/llc_var.h
sys/netccitt/pk.h
sys/netccitt/pk_extern.h
sys/netccitt/pk_var.h
sys/netccitt/x25.h
sys/netccitt/x25acct.h
sys/netccitt/x25err.h
sys/netccitt/x25isr.h
sys/netinet/icmp6.h
sys/netinet/icmp_var.h
sys/netinet/if_atm.h
sys/netinet/if_ether.h
sys/netinet/if_inarp.h
sys/netinet/igmp.h
sys/netinet/igmp_var.h
sys/netinet/in_gif.h
sys/netinet/in_offload.h
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/in_pcb_hdr.h
sys/netinet/in_proto.h
sys/netinet/in_systm.h
sys/netinet/in_var.h
sys/netinet/ip.h
sys/netinet/ip6.h
sys/netinet/ip_ecn.h
sys/netinet/ip_encap.h
sys/netinet/ip_gre.h
sys/netinet/ip_icmp.c
sys/netinet/ip_icmp.h
sys/netinet/ip_mroute.h
sys/netinet/ip_var.h
sys/netinet/pim.h
sys/netinet/pim_var.h
sys/netinet/tcp.h
sys/netinet/tcp_debug.h
sys/netinet/tcp_fsm.h
sys/netinet/tcp_input.c
sys/netinet/tcp_seq.h
sys/netinet/tcp_timer.h
sys/netinet/tcp_usrreq.c
sys/netinet/tcp_var.h
sys/netinet/tcpip.h
sys/netinet/udp.h
sys/netinet/udp_usrreq.c
sys/netinet/udp_var.h
sys/netinet6/ah.h
sys/netinet6/ah_aesxcbcmac.h
sys/netinet6/esp.h
sys/netinet6/esp_aesctr.h
sys/netinet6/esp_rijndael.h
sys/netinet6/in6.h
sys/netinet6/in6_gif.h
sys/netinet6/in6_ifattach.h
sys/netinet6/in6_pcb.c
sys/netinet6/in6_pcb.h
sys/netinet6/in6_var.h
sys/netinet6/ipcomp.h
sys/netinet6/ipsec.h
sys/netinet6/mld6_var.h
sys/netinet6/nd6.h
sys/netinet6/pim6.h
sys/netinet6/pim6_var.h
sys/netinet6/raw_ip6.h
sys/netinet6/udp6.h
sys/netinet6/udp6_usrreq.c
sys/netinet6/udp6_var.h
sys/netipsec/ah.h
sys/netipsec/ah_var.h
sys/netipsec/esp.h
sys/netipsec/esp_var.h
sys/netipsec/ipcomp.h
sys/netipsec/ipcomp_var.h
sys/netipsec/ipip_var.h
sys/netipsec/ipsec.h
sys/netipsec/ipsec6.h
sys/netipsec/ipsec_osdep.h
sys/netipsec/ipsec_var.h
sys/netipsec/key.h
sys/netipsec/key_debug.h
sys/netipsec/key_var.h
sys/netipsec/keydb.h
sys/netipsec/keysock.h
sys/netipsec/xform.h
sys/netisdn/i4b_capi.h
sys/netisdn/i4b_capi_msgs.h
sys/netisdn/i4b_cause.h
sys/netisdn/i4b_debug.h
sys/netisdn/i4b_global.h
sys/netisdn/i4b_ioctl.h
sys/netisdn/i4b_isdnq931.h
sys/netisdn/i4b_isppp.h
sys/netisdn/i4b_l1l2.h
sys/netisdn/i4b_l2.h
sys/netisdn/i4b_l2fsm.h
sys/netisdn/i4b_l3.h
sys/netisdn/i4b_l3fsm.h
sys/netisdn/i4b_l3l4.h
sys/netisdn/i4b_l4.h
sys/netisdn/i4b_mbuf.h
sys/netisdn/i4b_q931.h
sys/netisdn/i4b_q932fac.h
sys/netisdn/i4b_rbch_ioctl.h
sys/netisdn/i4b_tel_ioctl.h
sys/netisdn/i4b_trace.h
sys/netiso/argo_debug.h
sys/netiso/clnl.h
sys/netiso/clnp.h
sys/netiso/clnp_stat.h
sys/netiso/cltp_usrreq.c
sys/netiso/cltp_var.h
sys/netiso/cons.h
sys/netiso/cons_pcb.h
sys/netiso/eonvar.h
sys/netiso/esis.h
sys/netiso/idrp_var.h
sys/netiso/iso.h
sys/netiso/iso_errno.h
sys/netiso/iso_pcb.c
sys/netiso/iso_pcb.h
sys/netiso/iso_snpac.h
sys/netiso/iso_var.h
sys/netiso/tp_clnp.h
sys/netiso/tp_events.h
sys/netiso/tp_ip.h
sys/netiso/tp_meas.h
sys/netiso/tp_param.h
sys/netiso/tp_pcb.h
sys/netiso/tp_seq.h
sys/netiso/tp_stat.h
sys/netiso/tp_states.h
sys/netiso/tp_subr2.c
sys/netiso/tp_timer.h
sys/netiso/tp_tpdu.h
sys/netiso/tp_trace.h
sys/netiso/tp_user.h
sys/netiso/tp_var.h
sys/netkey/key.h
sys/netkey/key_debug.h
sys/netkey/key_var.h
sys/netkey/keydb.h
sys/netkey/keysock.h
sys/netnatm/natm.h
sys/netns/idp.h
sys/netns/idp_var.h
sys/netns/ns.h
sys/netns/ns_error.h
sys/netns/ns_if.h
sys/netns/ns_pcb.h
sys/netns/ns_var.h
sys/netns/sp.h
sys/netns/spidp.h
sys/netns/spp_debug.h
sys/netns/spp_timer.h
sys/netns/spp_var.h
sys/netsmb/iconv.h
sys/netsmb/mchain.h
sys/netsmb/netbios.h
sys/netsmb/smb.h
sys/netsmb/smb_conn.h
sys/netsmb/smb_dev.h
sys/netsmb/smb_rq.h
sys/netsmb/smb_subr.h
sys/netsmb/smb_tran.h
sys/netsmb/smb_trantcp.h
sys/nfs/nfs_bio.c
sys/nfs/nfs_export.c
sys/nfs/nfs_socket.c
sys/nfs/nfs_subs.c
sys/nfs/nfs_syscalls.c
sys/nfs/nfs_var.h
sys/nfs/nfsmount.h
sys/opencrypto/crypto.c
sys/opencrypto/cryptodev.c
sys/opencrypto/cryptodev.h
sys/opencrypto/cryptosoft.c
sys/opencrypto/cryptosoft.h
sys/opencrypto/cryptosoft_xform.c
sys/opencrypto/files.opencrypto
sys/opencrypto/xform.c
sys/opencrypto/xform.h
sys/sys/cc_microtime.h
sys/sys/conf.h
sys/sys/cpu_data.h
sys/sys/disklabel_gpt.h
sys/sys/drvctlio.h
sys/sys/dvdio.h
sys/sys/fcntl.h
sys/sys/file.h
sys/sys/ieee754.h
sys/sys/ioctl_compat.h
sys/sys/ipc.h
sys/sys/joystick.h
sys/sys/lkm.h
sys/sys/localedef.h
sys/sys/lwp.h
sys/sys/mbuf.h
sys/sys/msg.h
sys/sys/null.h
sys/sys/once.h
sys/sys/param.h
sys/sys/pool.h
sys/sys/proc.h
sys/sys/queue.h
sys/sys/sa.h
sys/sys/savar.h
sys/sys/shm.h
sys/sys/socket.h
sys/sys/syscall.h
sys/sys/syscallargs.h
sys/sys/systrace.h
sys/sys/time.h
sys/sys/timex.h
sys/sys/tprintf.h
sys/sys/tty.h
sys/sys/types.h
sys/sys/verified_exec.h
sys/sys/vnode.h
sys/sys/vnode_if.h
sys/sys/workqueue.h
sys/ufs/ext2fs/ext2fs_inode.c
sys/ufs/ext2fs/ext2fs_readwrite.c
sys/ufs/ffs/ffs_alloc.c
sys/ufs/ffs/ffs_inode.c
sys/ufs/lfs/lfs_inode.c
sys/ufs/ufs/ufs_readwrite.c
sys/ufs/ufs/ufs_vnops.c
sys/uvm/files.uvm
sys/uvm/uvm.h
sys/uvm/uvm_aobj.c
sys/uvm/uvm_bio.c
sys/uvm/uvm_extern.h
sys/uvm/uvm_io.c
sys/uvm/uvm_page.h
sys/uvm/uvm_pager.c
sys/uvm/uvm_pdaemon.c
sys/uvm/uvm_readahead.c
sys/uvm/uvm_readahead.h
sys/uvm/uvm_stat.c
sys/uvm/uvm_vnode.c
--- a/sys/arch/acorn26/acorn26/pmap.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn26/acorn26/pmap.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.9.2.3 2004/09/21 13:11:20 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.9.2.4 2005/12/11 10:28:12 christos Exp $ */
 /*-
  * Copyright (c) 1997, 1998, 2000 Ben Harris
  * All rights reserved.
@@ -102,7 +102,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.9.2.3 2004/09/21 13:11:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.9.2.4 2005/12/11 10:28:12 christos Exp $");
 
 #include <sys/kernel.h> /* for cold */
 #include <sys/malloc.h>
@@ -783,11 +783,11 @@
 	UVMHIST_FUNC("pmap_is_modified");
 
 	UVMHIST_CALLED(pmaphist);
-	ppn = atop(page->phys_addr);
+	ppn = atop(VM_PAGE_TO_PHYS(page));
 	rv = (pv_table[ppn].pv_pflags & PV_MODIFIED) != 0;
 #ifdef PMAP_DEBUG_MODIFIED
 	if (!rv) {
-		pmap_md4_page(digest, page->phys_addr);
+		pmap_md4_page(digest, VM_PAGE_TO_PHYS(page));
 		if (memcmp(digest, pv_table[ppn].pv_md4sum, 16) != 0) {
 			int i;
 
@@ -813,7 +813,7 @@
 	UVMHIST_FUNC("pmap_is_referenced");
 
 	UVMHIST_CALLED(pmaphist);
-	ppn = atop(page->phys_addr);
+	ppn = atop(VM_PAGE_TO_PHYS(page));
 	return (pv_table[ppn].pv_pflags & PV_REFERENCED) != 0;
 }
 
@@ -845,7 +845,7 @@
 	UVMHIST_FUNC("pmap_clear_modify");
 
 	UVMHIST_CALLED(pmaphist);
-	ppn = atop(page->phys_addr);
+	ppn = atop(VM_PAGE_TO_PHYS(page));
 	rv = pmap_is_modified(page);
 #ifdef PMAP_DEBUG_MODIFIED
 	pmap_md4_page(pv_table[ppn].pv_md4sum, ptoa(ppn));
@@ -869,7 +869,7 @@
 	UVMHIST_FUNC("pmap_clear_reference");
 
 	UVMHIST_CALLED(pmaphist);
-	ppn = atop(page->phys_addr);
+	ppn = atop(VM_PAGE_TO_PHYS(page));
 	rv = pmap_is_referenced(page);
 	if (rv) {
 		pv_table[ppn].pv_pflags &= ~PV_REFERENCED;
@@ -946,7 +946,7 @@
 	UVMHIST_FUNC("pmap_page_protect");
 
 	UVMHIST_CALLED(pmaphist);
-	ppn = atop(page->phys_addr);
+	ppn = atop(VM_PAGE_TO_PHYS(page));
 	if (prot == VM_PROT_NONE) {
 		UVMHIST_LOG(pmaphist, "removing ppn %d\n", ppn, 0, 0, 0);
 		npv = pv = &pv_table[ppn];
--- a/sys/arch/acorn26/conf/FOURMEG	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn26/conf/FOURMEG	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: FOURMEG,v 1.10.6.8 2005/11/10 13:48:20 skrll Exp $
+# $NetBSD: FOURMEG,v 1.10.6.9 2005/12/11 10:28:12 christos Exp $
 
 # FOURMEG arm26 configuration -- something small
 
@@ -54,7 +54,7 @@
 options 	FFS_EI		# FFS endianness-independence support
 #options 	SOFTDEP		# FFS soft updates support.
 options 	NFS_V2_ONLY	# Make a smaller NFS
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Executable format options
 options 	EXEC_ELF32
@@ -111,7 +111,6 @@
 #options 	INSECURE
 
 # Reduce kernel size a little
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
 options 	MALLOC_NOINLINE		# Not inlining MALLOC saves memory
 
 # NFS boot options
--- a/sys/arch/acorn26/conf/GENERIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn26/conf/GENERIC	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.13.2.8 2005/11/10 13:48:20 skrll Exp $
+# $NetBSD: GENERIC,v 1.13.2.9 2005/12/11 10:28:12 christos Exp $
 #
 # GENERIC machine description file
 # 
@@ -69,7 +69,7 @@
 options 	FFS_EI		# FFS endianness-independence support
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Executable format options
 options 	EXEC_ELF32
@@ -264,3 +264,20 @@
 pseudo-device	ksyms			# /dev/ksyms
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if
+
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
--- a/sys/arch/acorn26/conf/INSTALL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn26/conf/INSTALL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.4.6.8 2005/11/10 13:48:20 skrll Exp $
+# $NetBSD: INSTALL,v 1.4.6.9 2005/12/11 10:28:12 christos Exp $
 
 # INSTALL configuration, used to generate installation media
 
@@ -52,7 +52,7 @@
 options 	FFS_EI		# FFS endianness-independence support
 #options 	SOFTDEP		# FFS soft updates support.
 options 	NFS_V2_ONLY	# Make a smaller NFS
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Executable format options
 options 	EXEC_ELF32
@@ -107,7 +107,6 @@
 #options 	INSECURE
 
 # Reduce kernel size a little
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
 options 	MALLOC_NOINLINE		# Not inlining MALLOC saves memory
 
 # NFS boot options
--- a/sys/arch/acorn32/acorn32/hydra.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn32/acorn32/hydra.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: hydra.c,v 1.16.2.2 2005/11/10 13:48:20 skrll Exp $	*/
+/*	$NetBSD: hydra.c,v 1.16.2.3 2005/12/11 10:28:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 Ben Harris
@@ -31,7 +31,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: hydra.c,v 1.16.2.2 2005/11/10 13:48:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hydra.c,v 1.16.2.3 2005/12/11 10:28:12 christos Exp $");
 
 #include <sys/device.h>
 #include <sys/systm.h>
@@ -174,7 +174,7 @@
 		return;
 	}
 	KASSERT(!TAILQ_EMPTY(&bootpglist));
-	sc->sc_bootpage_pa = TAILQ_FIRST(&bootpglist)->phys_addr;
+	sc->sc_bootpage_pa = VM_PAGE_TO_PHYS(TAILQ_FIRST(&bootpglist));
 	sc->sc_bootpage_va = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
 	    UVM_KMF_VAONLY);
 	if (sc->sc_bootpage_va == 0) {
--- a/sys/arch/acorn32/conf/EB7500ATX	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn32/conf/EB7500ATX	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: EB7500ATX,v 1.6.2.12 2005/11/10 13:48:20 skrll Exp $
+#	$NetBSD: EB7500ATX,v 1.6.2.13 2005/12/11 10:28:12 christos Exp $
 #
 #	EB7500ATX --- NetBSD/acorn32 complete configuration
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"EB7500ATX-$Revision: 1.6.2.12 $"
+#ident		"EB7500ATX-$Revision: 1.6.2.13 $"
 
 # estimated number of users
 maxusers	32
@@ -66,7 +66,7 @@
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 
--- a/sys/arch/acorn32/conf/GENERIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn32/conf/GENERIC	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# 	$NetBSD: GENERIC,v 1.26.2.10 2005/11/10 13:48:20 skrll Exp $
+# 	$NetBSD: GENERIC,v 1.26.2.11 2005/12/11 10:28:12 christos Exp $
 #
 #	GENERIC --- NetBSD/acorn32 complete configuration
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.26.2.10 $"
+#ident		"GENERIC-$Revision: 1.26.2.11 $"
 
 # estimated number of users
 maxusers	32
@@ -73,7 +73,7 @@
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 
@@ -378,3 +378,20 @@
 pseudo-device	ksyms			# /dev/ksyms
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if
+
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
--- a/sys/arch/acorn32/conf/INSTALL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn32/conf/INSTALL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.13.8.10 2005/11/10 13:48:20 skrll Exp $
+#	$NetBSD: INSTALL,v 1.13.8.11 2005/12/11 10:28:12 christos Exp $
 #
 #	INSTALL -- NetBSD/acorn32 install configuration
 #
@@ -22,7 +22,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"INSTALL-$Revision: 1.13.8.10 $"
+#ident		"INSTALL-$Revision: 1.13.8.11 $"
 
 # estimated number of users
 maxusers	32
@@ -71,9 +71,7 @@
 #options 	FFS_EI		# FFS Endian Independant support
 #options 	SOFTDEP		# FFS soft updates support.
 #options 	NFSSERVER
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
-
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 
--- a/sys/arch/acorn32/conf/LOWMEM_WSCONS	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn32/conf/LOWMEM_WSCONS	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: LOWMEM_WSCONS,v 1.15.8.8 2005/11/10 13:48:20 skrll Exp $
+#	$NetBSD: LOWMEM_WSCONS,v 1.15.8.9 2005/12/11 10:28:12 christos Exp $
 #
 #	LOWMEM_WSCONS -- RiscPC config with wscons for SMALL machines
 #
@@ -56,7 +56,7 @@
 # File system options
 #options 	QUOTA		# UFS quotas
 #options 	NFSSERVER
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 
--- a/sys/arch/acorn32/conf/RPC_WSCONS	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/acorn32/conf/RPC_WSCONS	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: RPC_WSCONS,v 1.17.8.10 2005/11/10 13:48:21 skrll Exp $
+#	$NetBSD: RPC_WSCONS,v 1.17.8.11 2005/12/11 10:28:12 christos Exp $
 #
 #	RPC_WSCONS -- Full RiscPC config with wscons
 #
@@ -22,7 +22,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.17.8.10 $"
+#ident		"GENERIC-$Revision: 1.17.8.11 $"
 
 # estimated number of users
 maxusers	32
@@ -71,7 +71,7 @@
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 
--- a/sys/arch/algor/algor/bus_dma.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/algor/algor/bus_dma.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.9.2.6 2005/04/01 14:26:49 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.9.2.7 2005/12/11 10:28:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.9.2.6 2005/04/01 14:26:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.9.2.7 2005/12/11 10:28:12 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -652,6 +652,8 @@
 	vaddr_t va;
 	bus_addr_t addr;
 	int curseg;
+	const uvm_flag_t kmflags =
+	    (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use K0SEG, to avoid
@@ -667,7 +669,7 @@
 
 	size = round_page(size);
 
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY);
+	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
 
 	if (va == 0)
 		return (ENOMEM);
--- a/sys/arch/algor/conf/P4032	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/algor/conf/P4032	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: P4032,v 1.14.2.9 2005/11/10 13:48:21 skrll Exp $
+#	$NetBSD: P4032,v 1.14.2.10 2005/12/11 10:28:12 christos Exp $
 #
 # Algorithmics P-4032 kernel.
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P4032-$Revision: 1.14.2.9 $"
+#ident 		"P4032-$Revision: 1.14.2.10 $"
 
 maxusers 32
 
@@ -47,7 +47,7 @@
 options 	NFSSERVER	# Sun NFS-compatible file system server
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
-options 	FFS_NO_SNAPSHOT	# No FFS snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/algor/conf/P5064	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/algor/conf/P5064	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: P5064,v 1.19.2.10 2005/11/10 13:48:21 skrll Exp $
+#	$NetBSD: P5064,v 1.19.2.11 2005/12/11 10:28:12 christos Exp $
 #
 # Algorithmics P-5064 kernel.
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P5064-$Revision: 1.19.2.10 $"
+#ident 		"P5064-$Revision: 1.19.2.11 $"
 
 maxusers 32
 
@@ -42,7 +42,7 @@
 options 	NFSSERVER	# Sun NFS-compatible file system server
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
-options 	FFS_NO_SNAPSHOT	# No FFS snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/algor/conf/P6032	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/algor/conf/P6032	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: P6032,v 1.13.2.10 2005/11/10 13:48:21 skrll Exp $
+#	$NetBSD: P6032,v 1.13.2.11 2005/12/11 10:28:12 christos Exp $
 #
 # Algorithmics P-6032 kernel.
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P6032-$Revision: 1.13.2.10 $"
+#ident 		"P6032-$Revision: 1.13.2.11 $"
 
 maxusers 32
 
@@ -42,7 +42,7 @@
 options 	NFSSERVER	# Sun NFS-compatible file system server
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
-options 	FFS_NO_SNAPSHOT	# No FFS snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/alpha/common/bus_dma.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/common/bus_dma.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.55.2.5 2005/11/10 13:48:21 skrll Exp $ */
+/* $NetBSD: bus_dma.c,v 1.55.2.6 2005/12/11 10:28:13 christos Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.55.2.5 2005/11/10 13:48:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.55.2.6 2005/12/11 10:28:13 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -574,6 +574,8 @@
 	vaddr_t va;
 	bus_addr_t addr;
 	int curseg;
+	const uvm_flag_t kmflags =
+	    (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use K0SEG, to avoid
@@ -586,7 +588,7 @@
 
 	size = round_page(size);
 
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY);
+	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
 
 	if (va == 0)
 		return (ENOMEM);
--- a/sys/arch/alpha/conf/ALPHA	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/conf/ALPHA	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALPHA,v 1.183.2.10 2005/11/10 13:48:22 skrll Exp $
+# $NetBSD: ALPHA,v 1.183.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # Alpha kernel with all the options you'd want, and more.
 
@@ -6,7 +6,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident		"ALPHA-$Revision: 1.183.2.10 $"
+ident		"ALPHA-$Revision: 1.183.2.11 $"
 
 maxusers 32
 
@@ -81,7 +81,7 @@
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER	# Sun NFS-compatible file system server
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/alpha/conf/BASIL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/conf/BASIL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: BASIL,v 1.18.2.11 2005/11/10 13:48:22 skrll Exp $
+# $NetBSD: BASIL,v 1.18.2.12 2005/12/11 10:28:13 christos Exp $
 #
 # basil.shagadelic.org -- thorpej's API UP1000
 
@@ -6,7 +6,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"BASIL-$Revision: 1.18.2.11 $"
+#ident 		"BASIL-$Revision: 1.18.2.12 $"
 
 maxusers 64
 
@@ -56,7 +56,7 @@
 options 	NFSSERVER	# Sun NFS-compatible file system server
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/alpha/conf/FRAU-FARBISSINA	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/conf/FRAU-FARBISSINA	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: FRAU-FARBISSINA,v 1.23.2.11 2005/11/10 13:48:22 skrll Exp $
+# $NetBSD: FRAU-FARBISSINA,v 1.23.2.12 2005/12/11 10:28:13 christos Exp $
 #
 # frau-farbissina.shagadelic.org -- thorpej's AlphaServer 1200 MP hacking
 # box
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"FRAU-FARBISSINA-$Revision: 1.23.2.11 $"
+#ident 		"FRAU-FARBISSINA-$Revision: 1.23.2.12 $"
 
 maxusers 64
 
@@ -56,7 +56,7 @@
 options 	NFSSERVER	# Sun NFS-compatible file system server
 #options 	FFS_EI		# FFS Endian Independant support
 options 	SOFTDEP		# FFS soft updates support.
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/alpha/conf/GENERIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/conf/GENERIC	Sun Dec 11 10:28:12 2005 +0000
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.230.2.13 $"
+#ident 		"GENERIC-$Revision: 1.230.2.14 $"
 
 maxusers 32
 
@@ -87,7 +87,7 @@
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Sun NFS-compatible file system server
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# packet forwarding
@@ -611,7 +611,8 @@
 wskbd*		at	pckbd?
 wsmouse*	at	pms?
 
-pseudo-device 	crypto			# opencrypto framework
+pseudo-device 	crypto			# /dev/crypto device
+pseudo-device	swcrypto		# software crypto implementation
 
 pseudo-device	bpfilter	16
 pseudo-device	ccd		4
@@ -652,3 +653,20 @@
 pseudo-device	ksyms			# /dev/ksyms
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if
+
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
--- a/sys/arch/alpha/conf/INSTALL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/conf/INSTALL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.72.2.9 2005/11/10 13:48:22 skrll Exp $
+# $NetBSD: INSTALL,v 1.72.2.10 2005/12/11 10:28:13 christos Exp $
 #
 # Alpha INSTALL kernel.
 
@@ -48,8 +48,7 @@
 
 # Filesystem options
 #options 	NFS_V2_ONLY	# Exclude NFS3 and NQNFS code to save space
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocol suite
--- a/sys/arch/alpha/conf/RAWHIDE	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/alpha/conf/RAWHIDE	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: RAWHIDE,v 1.18.2.8 2005/11/10 13:48:22 skrll Exp $
+# $NetBSD: RAWHIDE,v 1.18.2.9 2005/12/11 10:28:13 christos Exp $
 #
 # Alpha 4100 stripped for action server kernel.
 #
@@ -30,7 +30,7 @@
 file-system	UNION		# union file system
 file-system	PTYFS		# /dev/pts/N support
 
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 options 	INET
 options 	GATEWAY
--- a/sys/arch/amd64/amd64/linux_syscall.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amd64/amd64/linux_syscall.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_syscall.c,v 1.3.2.2 2005/11/10 13:50:24 skrll Exp $ */
+/*	$NetBSD: linux_syscall.c,v 1.3.2.3 2005/12/11 10:28:13 christos Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.3.2.2 2005/11/10 13:50:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.3.2.3 2005/12/11 10:28:13 christos Exp $");
 
 #include "opt_syscall_debug.h"
 #include "opt_ktrace.h"
@@ -77,7 +77,9 @@
 
 void linux_syscall_intern(struct proc *);
 static void linux_syscall_plain(struct trapframe *);
+#if defined(KTRACE) || defined(SYSTRACE)
 static void linux_syscall_fancy(struct trapframe *);
+#endif
 
 void
 linux_syscall_intern(struct proc *p)
@@ -193,6 +195,7 @@
 	userret(l);
 }
 
+#if defined(KTRACE) || defined(SYSTRACE)
 static void
 linux_syscall_fancy(struct trapframe *frame)
 {
@@ -281,3 +284,4 @@
 
 	userret(l);
 }
+#endif
--- a/sys/arch/amd64/amd64/syscall.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amd64/amd64/syscall.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.1.2.5 2005/11/10 13:50:24 skrll Exp $	*/
+/*	$NetBSD: syscall.c,v 1.1.2.6 2005/12/11 10:28:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.1.2.5 2005/11/10 13:50:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.1.2.6 2005/12/11 10:28:13 christos Exp $");
 
 #include "opt_syscall_debug.h"
 #include "opt_ktrace.h"
@@ -66,7 +66,9 @@
 
 void syscall_intern(struct proc *);
 static void syscall_plain(struct trapframe *);
+#if defined(KTRACE) || defined(SYSTRACE)
 static void syscall_fancy(struct trapframe *);
+#endif
 
 void
 child_return(void *arg)
@@ -194,7 +196,9 @@
 	switch (error) {
 	case 0:
 		frame->tf_rax = rval[0];
+#ifndef COMPAT_LINUX
 		frame->tf_rdx = rval[1];
+#endif
 		frame->tf_rflags &= ~PSL_C;	/* carry bit */
 		break;
 	case ERESTART:
@@ -221,6 +225,7 @@
 	userret(l);
 }
 
+#if defined(KTRACE) || defined(SYSTRACE)
 static void
 syscall_fancy(struct trapframe *frame)
 {
@@ -299,7 +304,9 @@
 	switch (error) {
 	case 0:
 		frame->tf_rax = rval[0];
+#ifndef COMPAT_LINUX
 		frame->tf_rdx = rval[1];
+#endif
 		frame->tf_rflags &= ~PSL_C;	/* carry bit */
 		break;
 	case ERESTART:
@@ -324,3 +331,4 @@
 
 	userret(l);
 }
+#endif
--- a/sys/arch/amd64/conf/GENERIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amd64/conf/GENERIC	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.5.2.13 2005/11/10 13:50:24 skrll Exp $
+# $NetBSD: GENERIC,v 1.5.2.14 2005/12/11 10:28:13 christos Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.5.2.13 $"
+#ident 		"GENERIC-$Revision: 1.5.2.14 $"
 
 maxusers	32		# estimated number of users
 
@@ -132,7 +132,7 @@
 options 	NFSSERVER	# Network File System server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# packet forwarding
@@ -805,7 +805,8 @@
 
 # Pseudo-Devices
 
-pseudo-device 	crypto			# opencrypto framework
+pseudo-device 	crypto			# /dev/crypto device
+pseudo-device	swcrypto		# software crypto implementation
 
 # disk/mass storage pseudo-devices
 pseudo-device	ccd		4	# concatenated/striped disk devices
@@ -863,3 +864,20 @@
 # wscons pseudo-devices
 pseudo-device	wsmux			# mouse & keyboard multiplexor
 pseudo-device	wsfont
+
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
--- a/sys/arch/amd64/conf/INSTALL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amd64/conf/INSTALL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.3.2.12 2005/11/10 13:50:24 skrll Exp $
+# $NetBSD: INSTALL,v 1.3.2.13 2005/12/11 10:28:13 christos Exp $
 #
 # GENERIC machine description file
 # 
@@ -20,13 +20,13 @@
 
 include	"arch/amd64/conf/std.amd64"
 
-#ident 		"INSTALL-$Revision: 1.3.2.12 $"
+#ident 		"INSTALL-$Revision: 1.3.2.13 $"
 
 maxusers	32		# estimated number of users
 
 # Standard system options
 
-makeoptions 	COPTS="-Os"
+makeoptions 	COPTS="-Os -fno-asynchronous-unwind-tables"
 
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT     # force root on memory disk
@@ -95,7 +95,7 @@
 #options 	NFSSERVER	# Network File System server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# packet forwarding
@@ -286,7 +286,7 @@
 bha*	at pci? dev ? function ?	# BusLogic 9xx SCSI
 dpt*	at pci? dev ? function ?	# DPT SmartCache/SmartRAID
 iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
-# isp*	at pci? dev ? function ?	# Qlogic ISP [12]0x0 SCSI/FibreChannel
+isp*	at pci? dev ? function ?	# Qlogic ISP [12]0x0 SCSI/FibreChannel
 mly*	at pci? dev ? function ?	# Mylex AcceleRAID and eXtremeRAID
 mpt*	at pci? dev ? function ?	# LSILogic 9x9 and 53c1030
 pcscp*	at pci? dev ? function ?	# AMD 53c974 PCscsi-PCI SCSI
@@ -411,17 +411,17 @@
 en*	at pci? dev ? function ?	# ENI/Adaptec ATM
 ep*	at pci? dev ? function ?	# 3Com 3c59x
 epic*	at pci? dev ? function ?	# SMC EPIC/100 Ethernet
-esh*	at pci? dev ? function ?	# Essential HIPPI card
+#esh*	at pci? dev ? function ?	# Essential HIPPI card
 ex*	at pci? dev ? function ?	# 3Com 90x[BC]
 fpa*	at pci? dev ? function ?	# DEC DEFPA FDDI
 fxp*	at pci? dev ? function ?	# Intel EtherExpress PRO 10+/100B
 gsip*	at pci? dev ? function ?	# NS83820 Gigabit Ethernet
 #hme*	at pci? dev ? function ?	# Sun Microelectronics STP2002-STQ
-le*	at pci? dev ? function ?	# PCnet-PCI Ethernet
-lmc*	at pci? dev ? function ?	# Lan Media Corp SSI/HSSI/DS3
+#le*	at pci? dev ? function ?	# PCnet-PCI Ethernet
+#lmc*	at pci? dev ? function ?	# Lan Media Corp SSI/HSSI/DS3
 mtd*	at pci? dev ? function ?	# Myson MTD803 3-in-1 Ethernet
 ne*	at pci? dev ? function ?	# NE2000-compatible Ethernet
-ntwoc*	at pci? dev ? function ?	# Riscom/N2 PCI Sync Serial
+#ntwoc*	at pci? dev ? function ?	# Riscom/N2 PCI Sync Serial
 pcn*	at pci? dev ? function ?	# AMD PCnet-PCI Ethernet
 re*	at pci? dev ? function ?	# Realtek 8139C+/8169/8169S/8110S
 rtk*	at pci? dev ? function ?	# Realtek 8129/8139
--- a/sys/arch/amd64/conf/Makefile.amd64	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amd64/conf/Makefile.amd64	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.4.2.4 2005/11/10 13:50:24 skrll Exp $
+#	$NetBSD: Makefile.amd64,v 1.4.2.5 2005/12/11 10:28:13 christos Exp $
 
 # Makefile for NetBSD
 #
@@ -115,8 +115,15 @@
 		${UUDECODE} -p $> \> ${.TARGET}; \
 		rm -f ${.TARGET}; \
 		${UUDECODE} -p $> > ${.TARGET}
+
 athhal-x86_64-elf.hal.o: athhal-x86_64-elf.hal.o.uue
 	${ATH_UUDEC}
+.if defined(COPTS) && !empty(COPTS:M-fno-asynchronous-unwind-tables)
+	${_MKSHECHO}\
+	${OBJCOPY} -R .eh_frame $@
+	${OBJCOPY} -R .eh_frame $@
+.endif
+
 all depend:	opt_ah.h
 opt_ah.h:	athhal-x86_64-elf.opt_ah.h
 	ln -s ${.ALLSRC} ${.TARGET}
--- a/sys/arch/amd64/conf/SIMICS	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amd64/conf/SIMICS	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: SIMICS,v 1.2.2.10 2005/11/10 13:50:24 skrll Exp $
+#	$NetBSD: SIMICS,v 1.2.2.11 2005/12/11 10:28:13 christos Exp $
 #
 #	INSTALL_TINY - Tiny Installation kernel, suitable for 4M machines.
 #
@@ -107,10 +107,9 @@
 #options 	QUOTA		# UFS quotas
 #options 	NFSSERVER	# Network File System server
 #options 	NFS_V2_ONLY	# Exclude NFS3 and NQNFS code to save space
-#options 	VNODE_OP_NOINLINE # Save space by not inlining vnode op calls
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# packet forwarding
--- a/sys/arch/amiga/conf/AMIGA	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/AMIGA	Sun Dec 11 10:28:12 2005 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: AMIGA,v 1.61.2.10 2005/11/10 13:51:36 skrll Exp $
+# $NetBSD: AMIGA,v 1.61.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.45 2005/11/03 16:48:29 chs Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.48 2005/12/10 14:53:10 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -28,7 +28,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.61.2.10 $"
+#ident 		"GENERIC-$Revision: 1.61.2.11 $"
 
 
 maxusers	8
@@ -130,7 +130,7 @@
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Network File System server side code
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
@@ -501,4 +501,21 @@
 pseudo-device	ksyms			# /dev/ksyms (kernel symbols)
 pseudo-device	nsmb			# experimental - SMB requester
 
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
+
 config	netbsd root on ? type ?
--- a/sys/arch/amiga/conf/DRACO	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/DRACO	Sun Dec 11 10:28:12 2005 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: DRACO,v 1.77.2.10 2005/11/10 13:51:36 skrll Exp $
+# $NetBSD: DRACO,v 1.77.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.45 2005/11/03 16:48:29 chs Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.48 2005/12/10 14:53:10 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -28,7 +28,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.77.2.10 $"
+#ident 		"GENERIC-$Revision: 1.77.2.11 $"
 
 
 maxusers	8
@@ -119,7 +119,7 @@
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Network File System server side code
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
@@ -372,4 +372,21 @@
 pseudo-device	ksyms			# /dev/ksyms (kernel symbols)
 pseudo-device	nsmb			# experimental - SMB requester
 
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
+
 config	netbsd root on ? type ?
--- a/sys/arch/amiga/conf/GENERIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/GENERIC	Sun Dec 11 10:28:12 2005 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: GENERIC,v 1.195.2.10 2005/11/10 13:51:36 skrll Exp $
+# $NetBSD: GENERIC,v 1.195.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.45 2005/11/03 16:48:29 chs Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.48 2005/12/10 14:53:10 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -28,7 +28,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.195.2.10 $"
+#ident 		"GENERIC-$Revision: 1.195.2.11 $"
 
 
 maxusers	8
@@ -131,7 +131,7 @@
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Network File System server side code
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
@@ -509,4 +509,21 @@
 pseudo-device	ksyms			# /dev/ksyms (kernel symbols)
 pseudo-device	nsmb			# experimental - SMB requester
 
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
+
 config	netbsd root on ? type ?
--- a/sys/arch/amiga/conf/GENERIC.in	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/GENERIC.in	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.12.2.10 2005/11/10 13:51:36 skrll Exp $
+# $NetBSD: GENERIC.in,v 1.12.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # GENERIC machine description file
 #
@@ -56,7 +56,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.12.2.10 $"
+#ident 		"GENERIC-$Revision: 1.12.2.11 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION', `m4_dnl
 makeoptions	COPTS="-Os"
@@ -170,14 +170,12 @@
 
 #options 	FFS_EI		# FFS Endian Independant support
 
-m4_ifdef(`INSTALL_CONFIGURATION', `
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
-', `m4_dnl
+m4_ifdef(`INSTALL_CONFIGURATION', `', `m4_dnl
 options 	QUOTA		# User and group quotas in FFS
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Network File System server side code
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 ')m4_dnl
 
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
@@ -633,4 +631,21 @@
 pseudo-device	nsmb			# experimental - SMB requester
 ')m4_dnl
 
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
+
 config	netbsd root on ? type ?
--- a/sys/arch/amiga/conf/INSTALL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/INSTALL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: INSTALL,v 1.38.2.10 2005/11/10 13:51:36 skrll Exp $
+# $NetBSD: INSTALL,v 1.38.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.45 2005/11/03 16:48:29 chs Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.48 2005/12/10 14:53:10 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -28,7 +28,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.38.2.10 $"
+#ident 		"GENERIC-$Revision: 1.38.2.11 $"
 
 makeoptions	COPTS="-Os"
 
@@ -109,8 +109,6 @@
 #options 	FFS_EI		# FFS Endian Independant support
 
 
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
-
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
 
@@ -447,4 +445,21 @@
 #options 	RND_COM			# use "com" randomness as well (BROKEN)
 
 
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
+
 config	netbsd root on ? type ?
--- a/sys/arch/amiga/conf/MDINSTALL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/MDINSTALL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: MDINSTALL,v 1.16.2.8 2005/11/10 13:51:36 skrll Exp $
+#	$NetBSD: MDINSTALL,v 1.16.2.9 2005/12/11 10:28:13 christos Exp $
 
 #
 # INSTALL kernel for ramdisk installation
@@ -49,8 +49,7 @@
 file-system 	KERNFS		# kernel data-structure filesystem
 file-system	PTYFS		# /dev/pts/N support
 
-options 	VNODE_OP_NOINLINE	# Not inlining vnode op calls saves mem
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 #
 # Support for various kernel options
--- a/sys/arch/amiga/conf/WSCONS	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/conf/WSCONS	Sun Dec 11 10:28:12 2005 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: WSCONS,v 1.15.2.10 2005/11/10 13:51:36 skrll Exp $
+# $NetBSD: WSCONS,v 1.15.2.11 2005/12/11 10:28:13 christos Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.45 2005/11/03 16:48:29 chs Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.48 2005/12/10 14:53:10 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -28,7 +28,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.15.2.10 $"
+#ident 		"GENERIC-$Revision: 1.15.2.11 $"
 
 
 maxusers	8
@@ -131,7 +131,7 @@
 options 	SOFTDEP		# FFS soft updates support.
 #options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Network File System server side code
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
@@ -481,4 +481,21 @@
 pseudo-device	ksyms			# /dev/ksyms (kernel symbols)
 pseudo-device	nsmb			# experimental - SMB requester
 
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
+
 config	netbsd root on ? type ?
--- a/sys/arch/amiga/dev/sci.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amiga/dev/sci.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: sci.c,v 1.28.2.4 2005/11/10 13:51:36 skrll Exp $ */
+/*	$NetBSD: sci.c,v 1.28.2.5 2005/12/11 10:28:13 christos Exp $ */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.28.2.4 2005/11/10 13:51:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.28.2.5 2005/12/11 10:28:13 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -246,7 +246,7 @@
 		switch(stat) {
 		case SCSI_CHECK:
 			xs->resid = 0;
-			/* FALLTHOUGH */
+			/* FALLTHROUGH */
 		case SCSI_BUSY:
 			xs->error = XS_BUSY;
 			break;
--- a/sys/arch/amigappc/conf/NULL	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/amigappc/conf/NULL	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NULL,v 1.13.2.8 2005/11/10 13:55:00 skrll Exp $
+# $NetBSD: NULL,v 1.13.2.9 2005/12/11 10:28:14 christos Exp $
 #
 # This file was automatically created. Changes will be
 # lost when running make in this directory.
@@ -79,7 +79,7 @@
 #options 	NFSSERVER	# Network File System server side code
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 #Compatibility options for various existing systems
 
--- a/sys/arch/arc/TODO	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/TODO	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: TODO,v 1.19.2.1 2005/11/10 13:55:00 skrll Exp $
+$NetBSD: TODO,v 1.19.2.2 2005/12/11 10:28:14 christos Exp $
 
 To do list (in some particular order)
 XXX some entries might be obsolete.
@@ -96,27 +96,16 @@
 		   due to above SR_INT_IE problem.
 	    s/MIPS_INT_MASK/MIPS3_INT_MASK/ makes this work, although tricky.
 
-	-   if (ipending & INT_MASK_REAL_DEV) == 0,
-	    softnet() and softclock() are handled with all interrupt disabled.
-		-> overblocking, possibly causes missing hardclock()
-
-	-   `netisr' handling in netintr() implies potential race condition.
-	    The access to `netisr' should be protected by splnet().
-	    Currently this is not real problem due to above overblocking.
-
-	-   INT_MASK_REAL_DEV should be removed
-
 	-   make CLKF_INTR() work.
 
-    o	it is better to always disable MIPS_INT_MASK_CLOCK.
+    o	it is better to always disable the MIPS3 internal timer interrupts
+	(i.e. MIPS_INT_MASK_5) if it is not needed for the system.
 	those are the points which should be fixed:
 	mips_idle: li t0, (MIPS_INT_MASK | MIPS_SR_INT_IE)
 	machdep.c: curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE;
 	spl0()
 	splnone()
 
-	-   MIPS_INT_MASK_CLOCK should be removed in someway
-
     o	XXX at least 2000/06/07 version is already quite unstable
 	on PICA and NEC Image RISCstation. (but almost OK on Magnum)
 	Userland commands dumps	core randomly.
--- a/sys/arch/arc/arc/arc_trap.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/arc_trap.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc_trap.c,v 1.25.2.4 2005/01/24 08:33:58 skrll Exp $	*/
+/*	$NetBSD: arc_trap.c,v 1.25.2.5 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: trap.c,v 1.22 1999/05/24 23:08:59 jason Exp $	*/
 
 /*
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arc_trap.c,v 1.25.2.4 2005/01/24 08:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arc_trap.c,v 1.25.2.5 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,7 +129,7 @@
 	/*
 	 *  Reenable all non served hardware levels.
 	 */
-	return (status & ~cause & MIPS3_HARD_INT_MASK) | MIPS_SR_INT_IE;
+	return cause;
 }
 
 /*
@@ -162,8 +162,9 @@
 void
 cpu_intr(uint32_t status, uint32_t cause, uint32_t pc, uint32_t ipending)
 {
+	uint32_t handled;
 
-	if (ipending & MIPS_INT_MASK_CLOCK) {
+	if (ipending & MIPS_INT_MASK_5) {
 		/*
 		 *  Writing a value to the Compare register,
 		 *  as a side effect, clears the timer interrupt request.
@@ -172,10 +173,12 @@
 	}
 
 	uvmexp.intrs++;
+	handled = cause;
 	/* real device interrupt */
-	if (ipending & INT_MASK_REAL_DEV) {
-		_splset(arc_hardware_intr(status, cause, pc, ipending));
+	if (ipending & MIPS3_HARD_INT_MASK) {
+		handled = arc_hardware_intr(status, cause, pc, ipending);
 	}
+	_splset((status & ~handled & MIPS3_HARD_INT_MASK) | MIPS_SR_INT_IE);
 
 	/* software interrupts */
 	ipending &= (MIPS_SOFT_INT_MASK_1|MIPS_SOFT_INT_MASK_0);
--- a/sys/arch/arc/arc/bus_dma.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/bus_dma.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.16.2.8 2005/04/01 14:26:50 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.16.2.9 2005/12/11 10:28:14 christos Exp $	*/
 /*	NetBSD: bus_dma.c,v 1.20 2000/01/10 03:24:36 simonb Exp 	*/
 
 /*-
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.16.2.8 2005/04/01 14:26:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.16.2.9 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -668,6 +668,8 @@
 	vaddr_t va;
 	bus_addr_t addr;
 	int curseg;
+	const uvm_flag_t kmflags =
+	    (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -683,7 +685,7 @@
 
 	size = round_page(size);
 
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY);
+	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
 
 	if (va == 0)
 		return ENOMEM;
--- a/sys/arch/arc/arc/bus_space_sparse.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/bus_space_sparse.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space_sparse.c,v 1.8.2.5 2005/04/01 14:26:50 skrll Exp $	*/
+/*	$NetBSD: bus_space_sparse.c,v 1.8.2.6 2005/12/11 10:28:14 christos Exp $	*/
 /*	NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp 	*/
 
 /*-
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.8.2.5 2005/04/01 14:26:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space_sparse.c,v 1.8.2.6 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -120,7 +120,7 @@
 	} else {
 		vaddr_t va,
 		    vaddr = uvm_km_alloc(kernel_map, (vsize_t)(end - start), 0,
-		    UVM_KMF_VAONLY);
+		    UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 
 		if (vaddr == 0)
 			panic("arc_sparse_bus_space_compose_handle: "
--- a/sys/arch/arc/arc/c_isa.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/c_isa.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_isa.c,v 1.5.2.4 2005/01/24 08:33:58 skrll Exp $	*/
+/*	$NetBSD: c_isa.c,v 1.5.2.5 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $	*/
 
 /*-
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: c_isa.c,v 1.5.2.4 2005/01/24 08:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: c_isa.c,v 1.5.2.5 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -155,7 +155,7 @@
 #include "pckbc.h"
 #if NPCKBC > 0
 #include <dev/ic/pckbcvar.h>
-#include <machine/kbdreg.h>
+#include <dev/ic/i8042reg.h>
 #endif
 
 #include "com.h"
--- a/sys/arch/arc/arc/c_nec_eisa.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/c_nec_eisa.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_nec_eisa.c,v 1.6.2.5 2005/11/10 13:55:00 skrll Exp $	*/
+/*	$NetBSD: c_nec_eisa.c,v 1.6.2.6 2005/12/11 10:28:14 christos Exp $	*/
 
 /*-
  * Copyright (C) 2003 Izumi Tsutsui.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: c_nec_eisa.c,v 1.6.2.5 2005/11/10 13:55:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: c_nec_eisa.c,v 1.6.2.6 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -174,7 +174,8 @@
 	    RD94_S_LOCAL_IO_BASE);
 
 	arc_wired_enter_page(RD94_V_EISA_IO, RD94_P_EISA_IO, RD94_S_EISA_IO);
-	arc_wired_enter_page(RD94_V_EISA_MEM, RD94_P_EISA_MEM, RD94_S_EISA_MEM);
+	arc_wired_enter_page(RD94_V_EISA_MEM, RD94_P_EISA_MEM,
+	    MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_16M));
 
 	/*
 	 * Initialize interrupt priority
--- a/sys/arch/arc/arc/machdep.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/machdep.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.78.2.5 2005/11/10 13:55:00 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.78.2.6 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -78,7 +78,7 @@
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.78.2.5 2005/11/10 13:55:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.78.2.6 2005/12/11 10:28:14 christos Exp $");
 
 #include "fs_mfs.h"
 #include "opt_ddb.h"
@@ -568,6 +568,8 @@
 #endif
 	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
 	printf("avail memory = %s\n", pbuf);
+
+	arc_bus_space_malloc_set_safe();
 }
 
 int	waittime = -1;
--- a/sys/arch/arc/arc/p_dti_tyne.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/arc/p_dti_tyne.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: p_dti_tyne.c,v 1.4.2.6 2005/11/10 13:55:00 skrll Exp $	*/
+/*	$NetBSD: p_dti_tyne.c,v 1.4.2.7 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: p_dti_tyne.c,v 1.4.2.6 2005/11/10 13:55:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p_dti_tyne.c,v 1.4.2.7 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -276,7 +276,8 @@
 	/*
 	 * Initialize wired TLB for I/O space which is used on early stage
 	 */
-	arc_wired_enter_page(TYNE_V_BOUNCE, TYNE_P_BOUNCE, TYNE_S_BOUNCE);
+	arc_wired_enter_page(TYNE_V_BOUNCE, TYNE_P_BOUNCE,
+	    MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_256K));
 
 	arc_wired_enter_page(TYNE_V_ISA_IO, TYNE_P_ISA_IO, TYNE_S_ISA_IO);
 	arc_wired_enter_page(TYNE_V_ISA_MEM, TYNE_P_ISA_MEM, TYNE_S_ISA_MEM);
--- a/sys/arch/arc/arc/wired_map.c	Sat Nov 12 17:04:03 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +0,0 @@
-/*	$NetBSD: wired_map.c,v 1.6.14.5 2005/11/10 13:55:00 skrll Exp $	*/
-
-/*-
- * Copyright (C) 2000 Shuichiro URATA.  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.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * 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: wired_map.c,v 1.6.14.5 2005/11/10 13:55:00 skrll Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <uvm/uvm_extern.h>
-#include <machine/cpu.h>
-#include <mips/locore.h>
-#include <mips/pte.h>
-#include <arc/arc/wired_map.h>
-
-#define VA_FREE_START	0xe0000000	/* XXX */
-
-#define ARC_TLB_WIRED_ENTRIES	8	/* upper limit */
-#define ARC_WIRED_PG_MASK	MIPS3_PG_SIZE_16M
-#define ARC_WIRED_PAGE_SIZE	MIPS3_PG_SIZE_MASK_TO_SIZE(ARC_WIRED_PG_MASK)
-#define ARC_WIRED_ENTRY_SIZE	(ARC_WIRED_PAGE_SIZE * 2)
-#define ARC_WIRED_ENTRY_OFFMASK	(ARC_WIRED_ENTRY_SIZE - 1)
-
-static struct wired_map_entry {
-	paddr_t	pa0;
-	paddr_t	pa1;
-	vsize_t	size;
-	vaddr_t	va;
-} wired_map[ARC_TLB_WIRED_ENTRIES];
-
-boolean_t arc_wired_map_paddr_entry(paddr_t pa, vaddr_t *vap, vsize_t *sizep);
-boolean_t arc_wired_map_vaddr_entry(vaddr_t va, paddr_t *pap, vsize_t *sizep);
-
-static int	nwired;
-static vaddr_t	va_free;
-
-void
-arc_init_wired_map(void)
-{
-
-	nwired = 0;
-	va_free = VA_FREE_START;
-}
-
-void
-arc_enter_wired(vaddr_t va, paddr_t pa0, paddr_t pa1, uint32_t pg_size)
-{
-	struct tlb tlb;
-
-	if (nwired >= ARC_TLB_WIRED_ENTRIES)
-		panic("arc_enter_wired: wired entry exausted");
-
-	wired_map[nwired].va = va;
-	wired_map[nwired].pa0 = pa0;
-	wired_map[nwired].pa1 = pa1;
-	wired_map[nwired].size = MIPS3_PG_SIZE_MASK_TO_SIZE(pg_size);
-
-	/* Allocate new wired entry */
-	mips3_cp0_wired_write(MIPS3_TLB_WIRED_UPAGES + nwired + 1);
-
-	/* Map to it */
-	tlb.tlb_mask = pg_size;
-	tlb.tlb_hi = mips3_vad_to_vpn(va);
-	if (pa0 == 0)
-		tlb.tlb_lo0 = MIPS3_PG_G;
-	else
-		tlb.tlb_lo0 = mips3_paddr_to_tlbpfn(pa0) | \
-		    MIPS3_PG_IOPAGE(PMAP_CCA_FOR_PA(pa0));
-	if (pa1 == 0)
-		tlb.tlb_lo1 = MIPS3_PG_G;
-	else
-		tlb.tlb_lo1 = mips3_paddr_to_tlbpfn(pa1) | \
-		    MIPS3_PG_IOPAGE(PMAP_CCA_FOR_PA(pa1));
-	mips3_TLBWriteIndexedVPS(MIPS3_TLB_WIRED_UPAGES + nwired, &tlb);
-
-	if (va_free < va + wired_map[nwired].size * 2) {
-		va_free = va + wired_map[nwired].size * 2;
-	}
-
-	nwired++;
-}
-
-boolean_t
-arc_wired_map_paddr_entry(paddr_t pa, vaddr_t *vap, vsize_t *sizep)
-{
-	int n = nwired;
-	struct wired_map_entry *entry = wired_map;
-
-	for (; --n >= 0; entry++) {
-		if (entry->pa0 != 0 &&
-		    pa >= entry->pa0 && pa < entry->pa0 + entry->size) {
-			*vap = entry->va;
-			*sizep = entry->size;
-			return 1;
-		}
-		if (entry->pa1 != 0 &&
-		    pa >= entry->pa1 && pa < entry->pa1 + entry->size) {
-			*vap = entry->va + entry->size;
-			*sizep = entry->size;
-			return 1;
-		}
-	}
-	return 0;
-}
-
-/* XXX: Using tlbp makes this easier... */
-boolean_t
-arc_wired_map_vaddr_entry(vaddr_t va, paddr_t *pap, vsize_t *sizep)
-{
-	int n = nwired;
-	struct wired_map_entry *entry = wired_map;
-
-	for (; --n >= 0; entry++) {
-		if (va >= entry->va && va < entry->va + entry->size * 2) {
-			paddr_t pa = (va < entry->va + entry->size)
-				? entry->pa0 : entry->pa1;
-
-			if (pa != 0) {
-				*pap = pa;
-				*sizep = entry->size;
-				return 1;
-			}
-		}
-	}
-	return 0;
-}
-
-vaddr_t
-arc_contiguously_wired_mapped(paddr_t pa, int size)
-{
-	paddr_t p;
-	vaddr_t rva, va;
-	vsize_t vsize, offset;
-
-	if (!arc_wired_map_paddr_entry(pa, &rva, &vsize))
-		return (0); /* not wired mapped */
-	/* XXX: same physical address may be wired mapped more than once */
-	offset = (vsize_t)pa & (vsize - 1);
-	pa -= offset;
-	size += offset;
-	va = rva;
-	for (;;) {
-		pa += vsize;
-		va += vsize;
-		size -= vsize;
-		if (size <= 0)
-			break;
-		if (!arc_wired_map_vaddr_entry(va, &p, &vsize) || p != pa)
-			return 0; /* not contiguously wired mapped */
-	}
-	return rva + offset;
-}
-
-/* Allocate new wired entries */
-vaddr_t
-arc_map_wired(paddr_t pa, int size)
-{
-	vaddr_t va, rva;
-	vsize_t off;
-
-	/* XXX: may be already partially wired mapped */
-
-	off = pa & ARC_WIRED_ENTRY_OFFMASK;
-	rva = (va_free + ARC_WIRED_ENTRY_OFFMASK) & ~ARC_WIRED_ENTRY_OFFMASK;
-	pa &= ~(paddr_t)ARC_WIRED_ENTRY_OFFMASK;
-	va = rva;
-	size += off;
-
-	if ((size + ARC_WIRED_ENTRY_SIZE - 1) / ARC_WIRED_ENTRY_SIZE >
-	    ARC_TLB_WIRED_ENTRIES - nwired) {
-#ifdef DIAGNOSTIC
-		printf("arc_map_wired(0x%llx, 0x%lx): %d is not enough\n",
-		       pa + off, size - off, ARC_TLB_WIRED_ENTRIES - nwired);
-#endif
-		return 0; /* free wired TLB is not enough */
-	}
-
-	while (size > 0) {
-		arc_enter_wired(va, pa, pa + ARC_WIRED_PAGE_SIZE,
-		    ARC_WIRED_PG_MASK);
-		pa += ARC_WIRED_ENTRY_SIZE;
-		va += ARC_WIRED_ENTRY_SIZE;
-		size -= ARC_WIRED_ENTRY_SIZE;
-	}
-
-	return rva + off;
-}
-
-boolean_t
-arc_wired_map_extract(vaddr_t va, paddr_t *pap)
-{
-	paddr_t pa;
-	vsize_t size;
-
-	if (arc_wired_map_vaddr_entry(va, &pa, &size)) {
-		*pap = pa + (va & (size - 1));
-		return 1;
-	} else {
-		return 0;
-	}
-}
--- a/sys/arch/arc/conf/ARCTIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/ARCTIC	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: ARCTIC,v 1.23.2.9 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: ARCTIC,v 1.23.2.10 2005/12/11 10:28:14 christos Exp $
 #	$OpenBSD: ARCTIC,v 1.12 1999/08/29 12:14:03 niklas Exp $
 #
 #	configuration file for DeskStation
@@ -92,7 +92,7 @@
 options 	NFSSERVER	# Network File System server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# IP packet forwarding
--- a/sys/arch/arc/conf/GENERIC	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/GENERIC	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.90.2.10 2005/11/10 13:55:00 skrll Exp $
+# $NetBSD: GENERIC,v 1.90.2.11 2005/12/11 10:28:14 christos Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.90.2.10 $"
+#ident		"GENERIC-$Revision: 1.90.2.11 $"
 
 maxusers	32		# estimated number of users
 
@@ -127,7 +127,7 @@
 options 	NFSSERVER	# Network File System server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# IP packet forwarding
@@ -399,7 +399,8 @@
 
 #### Pseudo devices
 
-pseudo-device 	crypto			# opencrypto framework
+pseudo-device 	crypto			# /dev/crypto device
+pseudo-device	swcrypto		# software crypto implementation
 
 # disk/mass storage pseudo-devices
 pseudo-device	ccd		4	# concatenated/striped disk devices
@@ -453,3 +454,20 @@
 pseudo-device	ksyms			# /dev/ksyms
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if
+
+# Veriexec
+#options VERIFIED_EXEC
+#
+# a pseudo device needed for veriexec
+#pseudo-device	veriexec		1
+#
+# Uncomment the fingerprint methods below that are desired. Note that
+# removing fingerprint methods will have almost no impact on the kernel
+# code size.
+#
+#options VERIFIED_EXEC_FP_RMD160
+#options VERIFIED_EXEC_FP_SHA256
+#options VERIFIED_EXEC_FP_SHA384
+#options VERIFIED_EXEC_FP_SHA512
+#options VERIFIED_EXEC_FP_SHA1
+#options VERIFIED_EXEC_FP_MD5
--- a/sys/arch/arc/conf/M403	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/M403	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: M403,v 1.22.6.8 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: M403,v 1.22.6.9 2005/12/11 10:28:14 christos Exp $
 #
 #	configuration file for MIPS Magnum 4000 system
 #
@@ -83,7 +83,7 @@
 #options 	FFS_EI		# FFS Endian Independent support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER	# Network File System server
-#options 	FFS_NO_SNAPSHOT	# No FFS snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
 
--- a/sys/arch/arc/conf/MIMORI	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/MIMORI	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: MIMORI,v 1.20.2.10 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: MIMORI,v 1.20.2.11 2005/12/11 10:28:14 christos Exp $
 #	NetBSD: GENERIC,v 1.31 2000/06/09 05:33:02 soda Exp
 #
 #	MIMORI -- My NEC RISCstation 2250 (ur)
@@ -87,7 +87,7 @@
 options 	NFSSERVER	# Network File System server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 #options 	GATEWAY		# IP packet forwarding
--- a/sys/arch/arc/conf/Makefile.arc.inc	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/Makefile.arc.inc	Sun Dec 11 10:28:12 2005 +0000
@@ -1,8 +1,4 @@
-#	$NetBSD: Makefile.arc.inc,v 1.10.2.5 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: Makefile.arc.inc,v 1.10.2.6 2005/12/11 10:28:14 christos Exp $
 
 CFLAGS+=	-mips2
 AFLAGS+=	-mips2
-
-SYSTEM_LD_TAIL_EXTRA=; \
-	echo "${DBSYM} $@ || true"; \
-	${DBSYM} $@ || true
--- a/sys/arch/arc/conf/PCCONS	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/PCCONS	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: PCCONS,v 1.28.2.10 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: PCCONS,v 1.28.2.11 2005/12/11 10:28:14 christos Exp $
 #	$OpenBSD: GENERIC,v 1.29 1999/08/29 12:14:03 niklas Exp $
 #
 #	PCCONS -- generic but pccons rather than wscons
@@ -94,7 +94,7 @@
 #options 	FFS_EI		# FFS Endian Independent support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER	# Network File System server
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
 
--- a/sys/arch/arc/conf/PICA	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/PICA	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: PICA,v 1.37.2.9 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: PICA,v 1.37.2.10 2005/12/11 10:28:14 christos Exp $
 #
 #	configuration file for ACER PICA system
 #
@@ -84,7 +84,7 @@
 #options 	FFS_EI		# FFS Endian Independent support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER	# Network File System server
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
 
--- a/sys/arch/arc/conf/RAMDISK	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/RAMDISK	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: RAMDISK,v 1.40.2.10 2005/11/10 13:55:00 skrll Exp $
+#	$NetBSD: RAMDISK,v 1.40.2.11 2005/12/11 10:28:14 christos Exp $
 #
 #	memory disk based configuration file for MIPS R4x00 ARC Systems
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.40.2.10 $"
+#ident		"GENERIC-$Revision: 1.40.2.11 $"
 
 maxusers	32		# estimated number of users
 
@@ -107,7 +107,7 @@
 #options 	FFS_EI		# FFS Endian Independent support
 #options 	SOFTDEP		# FFS soft updates support.
 #options 	NFSSERVER	# Network File System server
-options 	FFS_NO_SNAPSHOT	# ffs snapshots
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
 
--- a/sys/arch/arc/conf/RPC44	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/conf/RPC44	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: RPC44,v 1.3.2.9 2005/11/10 13:55:00 skrll Exp $
+# $NetBSD: RPC44,v 1.3.2.10 2005/12/11 10:28:14 christos Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.3.2.9 $"
+#ident		"GENERIC-$Revision: 1.3.2.10 $"
 
 maxusers	32		# estimated number of users
 
@@ -111,7 +111,7 @@
 #options 	FFS_EI		# FFS Endian Independent support
 options 	SOFTDEP		# FFS soft updates support.
 options 	NFSSERVER	# Network File System server
-#options 	FFS_NO_SNAPSHOT	# ffs snapshots
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 				# immutable) behave as system flags.
 
--- a/sys/arch/arc/include/cpu.h	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/include/cpu.h	Sun Dec 11 10:28:12 2005 +0000
@@ -1,23 +1,10 @@
-/*	$NetBSD: cpu.h,v 1.17.22.2 2005/11/10 13:55:09 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.17.22.3 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: cpu.h,v 1.9 1998/01/28 13:46:10 pefo Exp $ */
 
 #ifndef _ARC_CPU_H_
 #define _ARC_CPU_H_
 
-/*
- *  Internal timer causes hard interrupt 5.
- */
-#define MIPS_INT_MASK_CLOCK	MIPS_INT_MASK_5
-
 #include <mips/cpu.h>
 #include <mips/cpuregs.h>
 
-/*
- * definitions of cpu-dependent requirements
- * referenced in generic code
- */
-#define	COPY_SIGCODE		/* copy sigcode above user stack in exec */
-
-#define	INT_MASK_REAL_DEV	MIPS3_HARD_INT_MASK	/* XXX */
-
 #endif /* _ARC_CPU_H_ */
--- a/sys/arch/arc/isa/isabus.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/isa/isabus.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: isabus.c,v 1.23.2.6 2005/11/10 13:55:09 skrll Exp $	*/
+/*	$NetBSD: isabus.c,v 1.23.2.7 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $	*/
 /*	NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp 	*/
 
@@ -120,7 +120,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.23.2.6 2005/11/10 13:55:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.23.2.7 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -448,7 +448,7 @@
 	isa_outb(IO_ICU1 + 1, imen);
 	isa_outb(IO_ICU2 + 1, imen >> 8);
 
-	return ~0;  /* Dont reenable */
+	return ~MIPS_INT_MASK_2;
 }
 
 
--- a/sys/arch/arc/jazz/jazzio.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/jazz/jazzio.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: jazzio.c,v 1.10.2.4 2005/01/24 08:34:05 skrll Exp $	*/
+/*	$NetBSD: jazzio.c,v 1.10.2.5 2005/12/11 10:28:14 christos Exp $	*/
 /*	$OpenBSD: picabus.c,v 1.11 1999/01/11 05:11:10 millert Exp $	*/
 /*	NetBSD: tc.c,v 1.2 1995/03/08 00:39:05 cgd Exp 	*/
 
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: jazzio.c,v 1.10.2.4 2005/01/24 08:34:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jazzio.c,v 1.10.2.5 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -226,7 +226,7 @@
 		(*jirp->ih_func)(jirp->ih_arg);
 		jirp->ih_evcnt.ev_count++;
 	}
-	return ~0;  /* Don't reenable */
+	return ~MIPS_INT_MASK_1;
 }
 
 void
--- a/sys/arch/arc/jazz/pccons_jazzio.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/jazz/pccons_jazzio.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pccons_jazzio.c,v 1.3.6.5 2005/11/10 13:55:09 skrll Exp $ */
+/* $NetBSD: pccons_jazzio.c,v 1.3.6.6 2005/12/11 10:28:14 christos Exp $ */
 /* NetBSD: vga_isa.c,v 1.4 2000/08/14 20:14:51 thorpej Exp  */
 
 /*
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccons_jazzio.c,v 1.3.6.5 2005/11/10 13:55:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccons_jazzio.c,v 1.3.6.6 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -75,10 +75,10 @@
 	/* nothing to do */
 }
 
-int	pccons_jazzio_init_tag(char*, bus_space_tag_t*,bus_space_tag_t*);
+int	pccons_jazzio_init_tag(const char *, bus_space_tag_t*,bus_space_tag_t*);
 
 int
-pccons_jazzio_init_tag(char *name, bus_space_tag_t *iotp,
+pccons_jazzio_init_tag(const char *name, bus_space_tag_t *iotp,
     bus_space_tag_t *memtp)
 {
 	static int initialized = 0;
--- a/sys/arch/arc/pci/necpb.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arc/pci/necpb.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: necpb.c,v 1.15.2.5 2005/01/24 08:34:05 skrll Exp $	*/
+/*	$NetBSD: necpb.c,v 1.15.2.6 2005/12/11 10:28:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.15.2.5 2005/01/24 08:34:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.15.2.6 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -467,5 +467,5 @@
 #endif
 	}
 
-	return ~0;
+	return ~MIPS_INT_MASK_2;
 }
--- a/sys/arch/arm/arm/bcopyinout_xscale.S	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/arm/bcopyinout_xscale.S	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcopyinout_xscale.S,v 1.3.4.4 2004/09/21 13:13:08 skrll Exp $	*/
+/*	$NetBSD: bcopyinout_xscale.S,v 1.3.4.5 2005/12/11 10:28:14 christos Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-RCSID("$NetBSD: bcopyinout_xscale.S,v 1.3.4.4 2004/09/21 13:13:08 skrll Exp $")	
+RCSID("$NetBSD: bcopyinout_xscale.S,v 1.3.4.5 2005/12/11 10:28:14 christos Exp $")	
 
 	.text
 	.align	0
@@ -982,6 +982,7 @@
 	sub	r2, r2, ip
 	rsbs	ip, ip, #0x03
 	addne	pc, pc, ip, lsl #3
+	nop
 	ldrb	ip, [r0], #0x01
 	strb	ip, [r1], #0x01
 	ldrb	ip, [r0], #0x01
--- a/sys/arch/arm/arm/undefined.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/arm/undefined.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: undefined.c,v 1.17.2.6 2004/11/02 07:50:22 skrll Exp $	*/
+/*	$NetBSD: undefined.c,v 1.17.2.7 2005/12/11 10:28:14 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris.
@@ -54,7 +54,7 @@
 #include <sys/kgdb.h>
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.17.2.6 2004/11/02 07:50:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.17.2.7 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/malloc.h>
 #include <sys/queue.h>
@@ -169,6 +169,9 @@
 }
 
 static struct undefined_handler gdb_uh;
+#ifdef THUMB_CODE
+static struct undefined_handler gdb_uh_thumb;
+#endif
 
 void
 undefined_init()
@@ -183,7 +186,8 @@
 	gdb_uh.uh_handler = gdb_trapper;
 	install_coproc_handler_static(CORE_UNKNOWN_HANDLER, &gdb_uh);
 #ifdef THUMB_CODE
-	install_coproc_handler_static(THUMB_UNKNOWN_HANDLER, &gdb_uh);
+	gdb_uh_thumb.uh_handler = gdb_trapper;
+	install_coproc_handler_static(THUMB_UNKNOWN_HANDLER, &gdb_uh_thumb);
 #endif
 }
 
--- a/sys/arch/arm/arm32/bus_dma.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.32.2.9 2005/04/01 14:26:50 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.32.2.10 2005/12/11 10:28:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.32.2.9 2005/04/01 14:26:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.32.2.10 2005/12/11 10:28:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -826,6 +826,8 @@
 	bus_addr_t addr;
 	int curseg;
 	pt_entry_t *ptep/*, pte*/;
+	const uvm_flag_t kmflags =
+	    (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 #ifdef DEBUG_DMA
 	printf("dmamem_map: t=%p segs=%p nsegs=%x size=%lx flags=%x\n", t,
@@ -833,7 +835,7 @@
 #endif	/* DEBUG_DMA */
 
 	size = round_page(size);
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY);
+	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
 
 	if (va == 0)
 		return (ENOMEM);
--- a/sys/arch/arm/arm32/pmap.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/arm32/pmap.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.137.2.6 2005/11/10 13:55:16 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.137.2.7 2005/12/11 10:28:14 christos Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include <machine/param.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.137.2.6 2005/11/10 13:55:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.137.2.7 2005/12/11 10:28:14 christos Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -489,7 +489,7 @@
 static void		pmap_enter_pv(struct vm_page *, struct pv_entry *,
 			    pmap_t, vaddr_t, u_int);
 static struct pv_entry *pmap_find_pv(struct vm_page *, pmap_t, vaddr_t);
-static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vaddr_t);
+static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vaddr_t, int);
 static u_int		pmap_modify_pv(struct vm_page *, pmap_t, vaddr_t,
 			    u_int, u_int);
 
@@ -755,7 +755,7 @@
  * => we return the removed pve
  */
 static struct pv_entry *
-pmap_remove_pv(struct vm_page *pg, pmap_t pm, vaddr_t va)
+pmap_remove_pv(struct vm_page *pg, pmap_t pm, vaddr_t va, int skip_wired)
 {
 	struct pv_entry *pve, **prevptr;
 
@@ -767,11 +767,14 @@
 
 	while (pve) {
 		if (pve->pv_pmap == pm && pve->pv_va == va) {	/* match? */
-			NPDEBUG(PDB_PVDUMP,
-			    printf("pmap_remove_pv: pm %p, pg %p, flags 0x%x\n", pm, pg, pve->pv_flags));
+			NPDEBUG(PDB_PVDUMP, printf("pmap_remove_pv: pm %p, pg "
+			    "%p, flags 0x%x\n", pm, pg, pve->pv_flags));
+			if (pve->pv_flags & PVF_WIRED) {
+				if (skip_wired)
+					return (NULL);
+				--pm->pm_stats.wired_count;
+			}
 			*prevptr = pve->pv_next;		/* remove it! */
-			if (pve->pv_flags & PVF_WIRED)
-			    --pm->pm_stats.wired_count;
 			if (pm == pmap_kernel()) {
 				if (pve->pv_flags & PVF_WRITE)
 					pg->mdpage.krw_mappings--;
@@ -1540,7 +1543,7 @@
 
 	NPDEBUG(PDB_BITS,
 	    printf("pmap_clearbit: pg %p (0x%08lx) mask 0x%x\n",
-	    pg, pg->phys_addr, maskbits));
+	    pg, VM_PAGE_TO_PHYS(pg), maskbits));
 
 	PMAP_HEAD_TO_MAP_LOCK();
 	simple_lock(&pg->mdpage.pvh_slock);
@@ -1804,7 +1807,8 @@
 	u_int flags;
 
 	NPDEBUG(PDB_FOLLOW,
-	    printf("pmap_page_remove: pg %p (0x%08lx)\n", pg, pg->phys_addr));
+	    printf("pmap_page_remove: pg %p (0x%08lx)\n", pg,
+	    VM_PAGE_TO_PHYS(pg)));
 
 	PMAP_HEAD_TO_MAP_LOCK();
 	simple_lock(&pg->mdpage.pvh_slock);
@@ -2068,7 +2072,7 @@
 				 * must remove it from the PV list
 				 */
 				simple_lock(&opg->mdpage.pvh_slock);
-				pve = pmap_remove_pv(opg, pm, va);
+				pve = pmap_remove_pv(opg, pm, va, 0);
 				pmap_vac_me_harder(opg, pm, 0);
 				simple_unlock(&opg->mdpage.pvh_slock);
 				oflags = pve->pv_flags;
@@ -2129,7 +2133,7 @@
 			 * at this address.
 			 */
 			simple_lock(&opg->mdpage.pvh_slock);
-			pve = pmap_remove_pv(opg, pm, va);
+			pve = pmap_remove_pv(opg, pm, va, 0);
 			pmap_vac_me_harder(opg, pm, 0);
 			simple_unlock(&opg->mdpage.pvh_slock);
 			oflags = pve->pv_flags;
@@ -2243,7 +2247,7 @@
 #define	PMAP_REMOVE_CLEAN_LIST_SIZE	3
 
 void
-pmap_remove(pmap_t pm, vaddr_t sva, vaddr_t eva)
+pmap_do_remove(pmap_t pm, vaddr_t sva, vaddr_t eva, int skip_wired)
 {
 	struct l2_bucket *l2b;
 	vaddr_t next_bucket;
@@ -2255,8 +2259,8 @@
 	} cleanlist[PMAP_REMOVE_CLEAN_LIST_SIZE];
 	u_int mappings, is_exec, is_refd;
 
-	NPDEBUG(PDB_REMOVE, printf("pmap_remove: pmap=%p sva=%08lx eva=%08lx\n",
-	    pm, sva, eva));
+	NPDEBUG(PDB_REMOVE, printf("pmap_do_remove: pmap=%p sva=%08lx "
+	    "eva=%08lx\n", pm, sva, eva));
 
 	/*
 	 * we lock in the pmap => pv_head direction
@@ -2288,9 +2292,8 @@
 		}
 
 		ptep = &l2b->l2b_kva[l2pte_index(sva)];
-		mappings = 0;
-
-		while (sva < next_bucket) {
+
+		for (mappings = 0; sva < next_bucket; sva += PAGE_SIZE, ptep++){
 			struct vm_page *pg;
 			pt_entry_t pte;
 			paddr_t pa;
@@ -2298,15 +2301,10 @@
 			pte = *ptep;
 
 			if (pte == 0) {
-				/*
-				 * Nothing here, move along
-				 */
-				sva += PAGE_SIZE;
-				ptep++;
+				/* Nothing here, move along */
 				continue;
 			}
 
-			pm->pm_stats.resident_count--;
 			pa = l2pte_pa(pte);
 			is_exec = 0;
 			is_refd = 1;
@@ -2319,7 +2317,7 @@
 			if ((pg = PHYS_TO_VM_PAGE(pa)) != NULL) {
 				struct pv_entry *pve;
 				simple_lock(&pg->mdpage.pvh_slock);
-				pve = pmap_remove_pv(pg, pm, sva);
+				pve = pmap_remove_pv(pg, pm, sva, skip_wired);
 				pmap_vac_me_harder(pg, pm, 0);
 				simple_unlock(&pg->mdpage.pvh_slock);
 				if (pve != NULL) {
@@ -2330,15 +2328,27 @@
 						   PV_BEEN_REFD(pve->pv_flags);
 					}
 					pool_put(&pmap_pv_pool, pve);
+				} else
+				if (skip_wired) {
+					/* The mapping is wired. Skip it */
+					continue;
 				}
+			} else
+			if (skip_wired) {
+				/* Unmanaged pages are always wired. */
+				continue;
 			}
 
+			mappings++;
+
 			if (!l2pte_valid(pte)) {
+				/*
+				 * Ref/Mod emulation is still active for this
+				 * mapping, therefore it is has not yet been
+				 * accessed. No need to frob the cache/tlb.
+				 */
 				*ptep = 0;
 				PTE_SYNC_CURRENT(pm, ptep);
-				sva += PAGE_SIZE;
-				ptep++;
-				mappings++;
 				continue;
 			}
 
@@ -2377,10 +2387,6 @@
 						pmap_tlb_flushD_SE(pm, sva);
 				}
 			}
-
-			sva += PAGE_SIZE;
-			ptep++;
-			mappings++;
 		}
 
 		/*
@@ -2422,6 +2428,7 @@
 		}
 
 		pmap_free_l2_bucket(pm, l2b, mappings);
+		pm->pm_stats.resident_count -= mappings;
 	}
 
 	pmap_release_pmap_lock(pm);
@@ -2672,7 +2679,7 @@
 
 	NPDEBUG(PDB_PROTECT,
 	    printf("pmap_page_protect: pg %p (0x%08lx), prot 0x%x\n",
-	    pg, pg->phys_addr, prot));
+	    pg, VM_PAGE_TO_PHYS(pg), prot));
 
 	switch(prot) {
 	case VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE:
@@ -2827,7 +2834,7 @@
 
 		NPDEBUG(PDB_FOLLOW,
 		    printf("pmap_fault_fixup: mod emul. pm %p, va 0x%08lx, pa 0x%08lx\n",
-		    pm, va, pg->phys_addr));
+		    pm, va, VM_PAGE_TO_PHYS(pg)));
 
 		pg->mdpage.pvh_attrs |= PVF_REF | PVF_MOD;
 		pv->pv_flags |= PVF_REF | PVF_MOD;
@@ -2871,7 +2878,7 @@
 
 		NPDEBUG(PDB_FOLLOW,
 		    printf("pmap_fault_fixup: ref emul. pm %p, va 0x%08lx, pa 0x%08lx\n",
-		    pm, va, pg->phys_addr));
+		    pm, va, VM_PAGE_TO_PHYS(pg)));
 
 		*ptep = (pte & ~L2_TYPE_MASK) | L2_S_PROTO;
 		PTE_SYNC(ptep);
@@ -2981,10 +2988,11 @@
 void
 pmap_collect(pmap_t pm)
 {
-	/*
-	 * Nothing to do.
-	 * We don't even need to free-up the process' L1.
-	 */
+
+	pmap_idcache_wbinv_all(pm);
+	pm->pm_remove_all = TRUE;
+	pmap_do_remove(pm, VM_MIN_ADDRESS, VM_MAX_ADDRESS, 1);
+	pmap_update(pm);
 }
 
 /*
@@ -5104,7 +5112,7 @@
 			continue;
 
 		printf(" pa 0x%08lx: krw %d kro %d urw %d uro %d\n",
-		    pg->phys_addr,
+		    VM_PAGE_TO_PHYS(pg),
 		    pg->mdpage.krw_mappings, pg->mdpage.kro_mappings,
 		    pg->mdpage.urw_mappings, pg->mdpage.uro_mappings);
 
--- a/sys/arch/arm/conf/Makefile.arm	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/conf/Makefile.arm	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.arm,v 1.18.2.6 2005/11/10 13:55:16 skrll Exp $
+#	$NetBSD: Makefile.arm,v 1.18.2.7 2005/12/11 10:28:14 christos Exp $
 
 # Makefile for NetBSD
 #
@@ -62,8 +62,15 @@
 LOADADDRESS?=	0xF0000000
 LINKFLAGS_NORMAL=	-X
 # Strip ARM mapping symbols from the kernel image, as they interfere
-# with ddb, but don't strip them in the .gdb
+# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
+.if !defined(DEBUG) || empty(DEBUG:M-g*)
+SYSTEM_LD_TAIL?=	@${OBJCOPY} --strip-symbol='$$a'	 \
+				    --strip-symbol='$$t'	 \
+				    --strip-symbol='$$d' $@	;\
+			${SIZE} $@; chmod 755 $@
+.else
 STRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d'
+.endif
 
 ##
 ## (6) port specific target dependencies
--- a/sys/arch/arm/ep93xx/ep93xx_intr.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/ep93xx/ep93xx_intr.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ep93xx_intr.c,v 1.3.4.3 2005/11/10 13:55:16 skrll Exp $ */
+/* $NetBSD: ep93xx_intr.c,v 1.3.4.4 2005/12/11 10:28:15 christos Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.3.4.3 2005/11/10 13:55:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.3.4.4 2005/12/11 10:28:15 christos Exp $");
 
 /*
  * Interrupt support for the Cirrus Logic EP93XX
--- a/sys/arch/arm/ep93xx/ep93xx_space.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/ep93xx/ep93xx_space.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ep93xx_space.c,v 1.1.4.3 2005/04/01 14:26:51 skrll Exp $ */
+/*	$NetBSD: ep93xx_space.c,v 1.1.4.4 2005/12/11 10:28:15 christos Exp $ */
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ep93xx_space.c,v 1.1.4.3 2005/04/01 14:26:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ep93xx_space.c,v 1.1.4.4 2005/12/11 10:28:15 christos Exp $");
 
 /*
  * bus_space I/O functions for ep93xx
@@ -156,7 +156,8 @@
 	startpa = trunc_page(bpa);
 
 	/* Get some VM.  */
-	va = uvm_km_alloc(kernel_map, endpa - startpa, 0, UVM_KMF_VAONLY);
+	va = uvm_km_alloc(kernel_map, endpa - startpa, 0,
+	    UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 	if (va == 0)
 		return ENOMEM;
 
--- a/sys/arch/arm/ep93xx/ep93xxreg.h	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/ep93xx/ep93xxreg.h	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ep93xxreg.h,v 1.2.4.4 2005/11/10 13:55:16 skrll Exp $ */
+/*	$NetBSD: ep93xxreg.h,v 1.2.4.5 2005/12/11 10:28:15 christos Exp $ */
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -72,7 +72,17 @@
  *            External SMC CS#6 ROM/SRAM
  * 6000 0000 ---------------------------
  *            Device 4
- *            Reserved
+ *            PCMCIA/CompactFlash
+ *              5000 0000 - 5fff ffff
+ *                  Reserved
+ *              4c00 0000 - 4fff ffff
+ *                  Slot0 Memory space
+ *              4800 0000 - 4bff ffff
+ *                  Slot0 Attribute space
+ *              4400 0000 - 47ff ffff
+ *                  Reserved
+ *              4000 0000 - 43ff ffff
+ *                  Slot0 I/O space
  * 4000 0000 ---------------------------
  *            Device 3
  *            External SMC CS#3 ROM/SRAM
@@ -106,6 +116,8 @@
  * F010 0000 ---------------------------
  *            AHB bus (1Mbyte)
  * F000 0000 ---------------------------
+ *            PCMCIA slot0 space
+ * E000 0000 ---------------------------
  *            Kernel text and data
  * C000 0000 ---------------------------
  * 0000 0000 ---------------------------
@@ -135,20 +147,13 @@
 #define   EP93XX_VIC_VectAddr0	0x00000100UL
 #define   EP93XX_VIC_VectCntl0	0x00000200UL
 #define   EP93XX_VIC_PeriphID0	0x00000fe0UL
+#define  EP93XX_AHB_SMC		0x00080000UL
 
 #define	EP93XX_APB_VBASE	0xf0100000UL
 #define	EP93XX_APB_HWBASE	0x80800000UL
 #define	EP93XX_APB_SIZE		0x00200000UL	/* 2Mbyte */
 #define  EP93XX_APB_GPIO	0x00040000UL
 #define  EP93XX_APB_GPIO_SIZE	0x000000d0UL
-#define   EP93XX_GPIO_PADR	0x00000000UL
-#define   EP93XX_GPIO_PBDR	0x00000004UL
-#define   EP93XX_GPIO_PADDR	0x00000010UL
-#define   EP93XX_GPIO_PBDDR	0x00000014UL
-#define   EP93XX_GPIO_PFDR	0x00000030UL
-#define   EP93XX_GPIO_PFDDR	0x00000034UL
-#define   EP93XX_GPIO_PHDR	0x00000040UL
-#define   EP93XX_GPIO_PHDDR	0x00000044UL
 #define  EP93XX_APB_SSP		0x000a0000UL
 #define  EP93XX_APB_SSP_SIZE	0x00000018UL
 #define   EP93XX_SSP_SSPCR0	0x00000000UL
@@ -168,14 +173,26 @@
 #define   EP93XX_SYSCON_ClkSet2	0x00000024UL
 #define   EP93XX_SYSCON_ChipID	0x00000094UL
 #define  EP93XX_APB_TIMERS	0x00010000UL
-#define   EP93XX_TIMERS_Timer4Enable	0x00000064UL
-#define   EP93XX_TIMERS_Timer4ValueHigh	0x00000064UL
-#define   EP93XX_TIMERS_Timer4ValueLow	0x00000060UL
 #define  EP93XX_APB_UART1	0x000c0000UL
 #define  EP93XX_APB_UART2	0x000d0000UL
 #define  EP93XX_APB_UART_SIZE	0x00000220UL
 #define   EP93XX_UART_Flag	0x00000018UL
 #define   EP93XX_UART_Data	0x00000000UL
+#define  EP93XX_APB_RTC		0x00120000UL
+#define  EP93XX_APB_RTC_SIZE	0x00000112UL
+#define  EP93XX_APB_WDOG	0x00140000UL
+#define  EP93XX_APB_WDOG_SIZE	0x00000008UL
+
+/* EP93xx PCMCIA space */
+#define	EP93XX_PCMCIA0_VBASE	0xe0000000UL
+#define	EP93XX_PCMCIA0_HWBASE	0x40000000UL
+#define	EP93XX_PCMCIA_SIZE	0x10000000UL
+#define  EP93XX_PCMCIA_IO	0x00000000UL
+#define  EP93XX_PCMCIA_IO_SIZE	0x04000000UL
+#define  EP93XX_PCMCIA_ATTRIBUTE	0x08000000UL
+#define  EP93XX_PCMCIA_ATTRIBUTE_SIZE	0x04000000UL
+#define  EP93XX_PCMCIA_COMMON	0x0c000000UL
+#define  EP93XX_PCMCIA_COMMON_SIZE	0x04000000UL
 
 #define NIRQ			64
 #define VIC_NIRQ		32
--- a/sys/arch/arm/ep93xx/epclk.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/ep93xx/epclk.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: epclk.c,v 1.3.4.4 2005/11/10 13:55:16 skrll Exp $	*/
+/*	$NetBSD: epclk.c,v 1.3.4.5 2005/12/11 10:28:15 christos Exp $	*/
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epclk.c,v 1.3.4.4 2005/11/10 13:55:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epclk.c,v 1.3.4.5 2005/12/11 10:28:15 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -63,9 +63,12 @@
 
 #include <arm/ep93xx/epsocvar.h> 
 #include <arm/ep93xx/epclkreg.h> 
+#include <arm/ep93xx/ep93xxreg.h> 
 #include <arm/ep93xx/ep93xxvar.h>
 #include <dev/clock_subr.h>
 
+#include "opt_hz.h"
+
 static int	epclk_match(struct device *, struct cfdata *, void *);
 static void	epclk_attach(struct device *, struct device *, void *);
 
@@ -79,7 +82,9 @@
 	bus_addr_t		sc_baseaddr;
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
+#if defined(HZ) && (HZ == 64)
 	bus_space_handle_t	sc_teoi_ioh;
+#endif
 	int			sc_intr;
 };
 
@@ -146,9 +151,11 @@
 	if (bus_space_map(sa->sa_iot, sa->sa_addr, sa->sa_size, 
 		0, &sc->sc_ioh))
 		panic("%s: Cannot map registers", self->dv_xname);
+#if defined(HZ) && (HZ == 64)
 	if (bus_space_map(sa->sa_iot, EP93XX_APB_HWBASE + EP93XX_APB_SYSCON + 
 		EP93XX_SYSCON_TEOI, 4, 0, &sc->sc_teoi_ioh))
 		panic("%s: Cannot map registers", self->dv_xname);
+#endif
 
 	/* clear and start the debug timer (Timer4) */
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, EP93XX_TIMERS_Timer4Enable, 0);
@@ -168,7 +175,11 @@
 	tmark = TIMER4VAL();
 	sc = epclk_sc;
 
+#if defined(HZ) && (HZ == 64)
 	bus_space_write_4(sc->sc_iot, sc->sc_teoi_ioh, 0, 1);
+#else
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, EP93XX_TIMERS_Timer1Clear, 1);
+#endif
 	hardclock((struct clockframe*) arg);
 	return (1);
 }
@@ -202,10 +213,27 @@
 	sc = epclk_sc;
 	stathz = profhz = 0;
 
+#if defined(HZ) && (HZ == 64)
 	if (hz != 64) panic("HZ must be 64!");
 
 	/* clear 64Hz interrupt status */
 	bus_space_write_4(sc->sc_iot, sc->sc_teoi_ioh, 0, 1);
+#else
+#define	CLOCK_SOURCE_RATE	14745600UL
+#define	CLOCK_TICK_DIV		29
+#define	CLOCK_TICK_RATE \
+	(((CLOCK_SOURCE_RATE+(CLOCK_TICK_DIV*hz-1))/(CLOCK_TICK_DIV*hz))*hz)
+#define	LATCH	((CLOCK_TICK_RATE + hz/2) / hz)
+	/* setup and start the 16bit timer (Timer1) */
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh,
+			  EP93XX_TIMERS_Timer1Control,
+			  (TimerControl_MODE)|(TimerControl_CLKSEL));
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh,
+			  EP93XX_TIMERS_Timer1Load, LATCH-1);
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh,
+			  EP93XX_TIMERS_Timer1Control,
+			  (TimerControl_ENABLE)|(TimerControl_MODE)|(TimerControl_CLKSEL));
+#endif
 
 	ep93xx_intr_establish(sc->sc_intr, IPL_CLOCK, epclk_intr, NULL);
 }
--- a/sys/arch/arm/ep93xx/epclkreg.h	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/ep93xx/epclkreg.h	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: epclkreg.h,v 1.1.4.2 2005/01/17 19:29:12 skrll Exp $ */
+/*	$NetBSD: epclkreg.h,v 1.1.4.3 2005/12/11 10:28:15 christos Exp $ */
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -35,6 +35,32 @@
 #ifndef _EPCLKREG_H_
 #define _EPCLKREG_H_
 
-#include <arm/ep93xx/ep93xxreg.h>
+/* Timer1 16-bit timer (Free running/Load based) */
+#define	EP93XX_TIMERS_Timer1Load	0x00000000UL
+#define	 TimerLoad_MASK			0x0000ffffUL
+#define	EP93XX_TIMERS_Timer1Value	0x00000004UL
+#define	 TimerValue_MASK		0x0000ffffUL
+#define	EP93XX_TIMERS_Timer1Control	0x00000008UL
+#define	 TimerControl_ENABLE		(1<<7)
+#define	 TimerControl_MODE		(1<<6)
+#define	 TimerControl_CLKSEL		(1<<3)
+#define	EP93XX_TIMERS_Timer1Clear	0x0000000cUL
+
+/* Timer2 16-bit timer (Free running/Load based) */
+#define	EP93XX_TIMERS_Timer2Load	0x00000020UL
+#define	EP93XX_TIMERS_Timer2Value	0x00000024UL
+#define	EP93XX_TIMERS_Timer2Control	0x00000028UL
+#define	EP93XX_TIMERS_Timer2Clear	0x0000002cUL
+
+/* Timer3 32-bit timer (Free running/Load based) */
+#define	EP93XX_TIMERS_Timer3Load	0x00000080UL
+#define	EP93XX_TIMERS_Timer3Value	0x00000084UL
+#define	EP93XX_TIMERS_Timer3Control	0x00000088UL
+#define	EP93XX_TIMERS_Timer3Clear	0x0000008cUL
+
+/* Timer4 40-bit timer (Free running) */
+#define	EP93XX_TIMERS_Timer4Enable	0x00000064UL
+#define	EP93XX_TIMERS_Timer4ValueHigh	0x00000064UL
+#define	EP93XX_TIMERS_Timer4ValueLow	0x00000060UL
 
 #endif /* _EPCLKREG_H_ */
--- a/sys/arch/arm/ep93xx/epe.c	Sat Nov 12 17:04:03 2005 +0000
+++ b/sys/arch/arm/ep93xx/epe.c	Sun Dec 11 10:28:12 2005 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: epe.c,v 1.2.2.3 2005/11/10 13:55:16 skrll Exp $	*/
+/*	$NetBSD: epe.c,v 1.2.2.4 2005/12/11 10:28:15 christos Exp $	*/
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.2.2.3 2005/11/10 13:55:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.2.2.4 2005/12/11 10:28:15 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -93,6 +93,8 @@
 #include <arm/ep93xx/epereg.h> 
 #include <arm/ep93xx/epevar.h> 
 
+#define DEFAULT_MDCDIV	32
+
 #ifndef EPE_FAST
 #define EPE_FAST
 #endif
@@ -156,6 +158,14 @@
 		0, &sc->sc_ioh))
 		panic("%s: Cannot map registers", self->dv_xname);
 
+	/* Fetch the Ethernet address from property if set. */
+	if (prop_get(dev_propdb, 0, "mac-addr", sc->sc_enaddr,
+		       ETHER_ADDR_LEN, NULL) == ETHER_ADDR_LEN) {
+		bus_space_write_4(sc->sc_iot, sc->sc_ioh, EPE_AFP, 0);
+		bus_space_write_region_1(sc->sc_iot, sc->sc_ioh, EPE_IndAd,
+					 sc->sc_enaddr, ETHER_ADDR_LEN);
+	}
+
         ep93xx_intr_establish(sc->sc_intr, IPL_NET, epe_intr, sc);
 	epe_init(sc);
 }
@@ -299,6 +309,7 @@
 	caddr_t addr;
 	int rsegs, err, i;
 	struct ifnet * ifp = &sc->sc_ec.ec_if;
+	int mdcdiv = DEFAULT_MDCDIV;
 
 	callout_init(&sc->epe_tick_ch);
 
@@ -406,7 +417,9 @@
 	}
 
 	/* Divide HCLK by 32 for MDC clock */
-	EPE_WRITE(SelfCtl, (SelfCtl_MDCDIV(32)|SelfCtl_PSPRS));
+	if (sc->sc_dev.dv_cfdata->cf_flags)
+		mdcdiv = sc->sc_dev.dv_cfdata->cf_flags;
+	EPE_WRITE(SelfCtl, (SelfCtl_MDCDIV(mdcdiv)|SelfCtl_PSPRS));
 
 	sc->sc_mii.mii_ifp = ifp;
 	sc->sc_mii.mii_readreg = epe_mii_readreg;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/ep93xx/epgpio.c	Sun Dec 11 10:28:12 2005 +0000
@@ -0,0 +1,612 @@
+/*	$NetBSD: epgpio.c,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $	*/
+
+/*
+ * Copyright (c) 2005 HAMAJIMA Katsuomi. 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: epgpio.c,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <machine/intr.h>
+#include <dev/gpio/gpiovar.h>
+#include <arm/ep93xx/ep93xxvar.h> 
+#include <arm/ep93xx/epsocvar.h> 
+#include <arm/ep93xx/epgpioreg.h>
+#include <arm/ep93xx/epgpiovar.h>
+#include "gpio.h"
+#if NGPIO > 0
+#include <sys/gpio.h>
+#endif
+#include "locators.h"
+
+#ifdef EPGPIO_DEBUG
+int epgpio_debug = EPGPIO_DEBUG;
+#define DPRINTFN(n,x)	if (epgpio_debug>(n)) printf x;
+#else
+#define DPRINTFN(n,x)
+#endif
+
+#define	EPGPIO_NPORTS	8
+#define	EPGPIO_NPINS	8
+
+struct port_info {
+	struct epgpio_softc	*sc;
+	int			unit;
+#if NGPIO > 0
+	struct gpio_chipset_tag	gpio_chipset;
+	gpio_pin_t		pins[EPGPIO_NPINS];
+#endif
+	bus_size_t		pxdr;
+	bus_size_t		pxddr;
+	bus_size_t		xinten;
+	bus_size_t		xinttype1;
+	bus_size_t		xinttype2;
+	bus_size_t		xeoi;
+	bus_size_t		xdb;
+};
+
+struct intr_req {
+	int		irq;
+	int		(*ih_func)(void *);
+	int		(*ireq_func)(void *);
+	void		*ireq_arg;
+	void		*cookie;
+};
+
+struct epgpio_softc {
+	struct device		sc_dev;
+	bus_space_tag_t		sc_iot;
+	bus_space_handle_t	sc_ioh;
+	struct port_info	sc_port[EPGPIO_NPORTS];
+	struct intr_req		sc_ireq_combine;
+	struct intr_req		sc_ireq_f[EPGPIO_NPINS];
+};
+
+static int epgpio_match(struct device *, struct cfdata *, void *);
+static void epgpio_attach(struct device *, struct device *, void *);
+
+#if NGPIO > 0
+static int epgpiobus_print(void *, const char *);
+static int epgpio_pin_read(void *, int);
+static void epgpio_pin_write(void *, int, int);
+static void epgpio_pin_ctl(void *, int, int);
+#endif
+
+static int epgpio_search(struct device *, struct cfdata *, const int *, void *);
+static int epgpio_print(void *, const char *);
+
+static int epgpio_intr_combine(void* arg);
+static int epgpio_intr_f(void* arg, int);
+static int epgpio_intr_0(void* arg);
+static int epgpio_intr_1(void* arg);
+static int epgpio_intr_2(void* arg);
+static int epgpio_intr_3(void* arg);
+static int epgpio_intr_4(void* arg);
+static int epgpio_intr_5(void* arg);
+static int epgpio_intr_6(void* arg);
+static int epgpio_intr_7(void* arg);
+
+static void epgpio_bit_set(struct epgpio_softc *, bus_size_t, int);
+static void epgpio_bit_clear(struct epgpio_softc *, bus_size_t, int);
+
+CFATTACH_DECL(epgpio, sizeof(struct epgpio_softc),
+	      epgpio_match, epgpio_attach, NULL, NULL);
+
+static int
+epgpio_match(struct device *parent, struct cfdata *match, void *aux)
+{
+	return 2;
+}
+
+static void
+epgpio_attach(struct device *parent, struct device *self, void *aux)
+{
+	struct epgpio_softc *sc = (struct epgpio_softc*)self;
+	struct epsoc_attach_args *sa = aux;
+	struct port_info *pi;
+#if NGPIO > 0
+	struct gpiobus_attach_args gba;
+	int dir, val;
+	int i, j;
+#endif
+
+	printf("\n");
+	sc->sc_iot = sa->sa_iot;
+
+	if (bus_space_map(sa->sa_iot, sa->sa_addr,
+			  sa->sa_size, 0, &sc->sc_ioh)){
+		printf("%s: Cannot map registers", self->dv_xname);
+		return;
+	}
+
+	/* PORT A */
+	pi = &sc->sc_port[0];
+	pi->unit = 0;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PADR;
+	pi->pxddr = EP93XX_GPIO_PADDR;
+	pi->xinten = EP93XX_GPIO_AIntEn;
+	pi->xinttype1 = EP93XX_GPIO_AIntType1;
+	pi->xinttype2 = EP93XX_GPIO_AIntType2;
+	pi->xeoi = EP93XX_GPIO_AEOI;
+	pi->xdb = EP93XX_GPIO_ADB;
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, pi->xinten, 0);
+	/* PORT B */
+	pi = &sc->sc_port[1];
+	pi->unit = 1;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PBDR;
+	pi->pxddr = EP93XX_GPIO_PBDDR;
+	pi->xinten = EP93XX_GPIO_BIntEn;
+	pi->xinttype1 = EP93XX_GPIO_BIntType1;
+	pi->xinttype2 = EP93XX_GPIO_BIntType2;
+	pi->xeoi = EP93XX_GPIO_BEOI;
+	pi->xdb = EP93XX_GPIO_BDB;
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, pi->xinten, 0);
+	/* PORT C */
+	pi = &sc->sc_port[2];
+	pi->unit = 2;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PCDR;
+	pi->pxddr = EP93XX_GPIO_PCDDR;
+	pi->xinten = pi->xinttype1 = pi->xinttype2 = pi->xeoi = pi->xdb = -1;
+	/* PORT D */
+	pi = &sc->sc_port[3];
+	pi->unit = 3;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PDDR;
+	pi->pxddr = EP93XX_GPIO_PDDDR;
+	pi->xinten = pi->xinttype1 = pi->xinttype2 = pi->xeoi = pi->xdb = -1;
+	/* PORT E */
+	pi = &sc->sc_port[4];
+	pi->unit = 4;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PEDR;
+	pi->pxddr = EP93XX_GPIO_PEDDR;
+	pi->xinten = pi->xinttype1 = pi->xinttype2 = pi->xeoi = pi->xdb = -1;
+	/* PORT F */
+	pi = &sc->sc_port[5];
+	pi->unit = 5;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PFDR;
+	pi->pxddr = EP93XX_GPIO_PFDDR;
+	pi->xinten = EP93XX_GPIO_FIntEn;
+	pi->xinttype1 = EP93XX_GPIO_FIntType1;
+	pi->xinttype2 = EP93XX_GPIO_FIntType2;
+	pi->xeoi = EP93XX_GPIO_FEOI;
+	pi->xdb = EP93XX_GPIO_FDB;
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, pi->xinten, 0);
+	/* PORT G */
+	pi = &sc->sc_port[6];
+	pi->unit = 6;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PGDR;
+	pi->pxddr = EP93XX_GPIO_PGDDR;
+	pi->xinten = pi->xinttype1 = pi->xinttype2 = pi->xeoi = pi->xdb = -1;
+	/* PORT H */
+	pi = &sc->sc_port[7];
+	pi->unit = 7;
+	pi->sc = sc;
+	pi->pxdr = EP93XX_GPIO_PHDR;
+	pi->pxddr = EP93XX_GPIO_PHDDR;
+	pi->xinten = pi->xinttype1 = pi->xinttype2 = pi->xeoi = pi->xdb = -1;
+
+	/* PORT A & B */
+	sc->sc_ireq_combine.irq = EP93XX_GPIO_INTR;
+	sc->sc_ireq_combine.ih_func = epgpio_intr_combine;
+	/* PORT F */
+	sc->sc_ireq_f[0].irq = EP93XX_GPIO0_INTR;
+	sc->sc_ireq_f[0].ih_func = epgpio_intr_0;
+	sc->sc_ireq_f[1].irq = EP93XX_GPIO1_INTR;
+	sc->sc_ireq_f[1].ih_func = epgpio_intr_1;
+	sc->sc_ireq_f[2].irq = EP93XX_GPIO2_INTR;
+	sc->sc_ireq_f[2].ih_func = epgpio_intr_2;
+	sc->sc_ireq_f[3].irq = EP93XX_GPIO3_INTR;
+	sc->sc_ireq_f[3].ih_func = epgpio_intr_3;
+	sc->sc_ireq_f[4].irq = EP93XX_GPIO4_INTR;
+	sc->sc_ireq_f[4].ih_func = epgpio_intr_4;
+	sc->sc_ireq_f[5].irq = EP93XX_GPIO5_INTR;
+	sc->sc_ireq_f[5].ih_func = epgpio_intr_5;
+	sc->sc_ireq_f[6].irq = EP93XX_GPIO6_INTR;
+	sc->sc_ireq_f[6].ih_func = epgpio_intr_6;
+	sc->sc_ireq_f[7].irq = EP93XX_GPIO7_INTR;
+	sc->sc_ireq_f[7].ih_func = epgpio_intr_7;
+
+#if NGPIO > 0
+	/* initialize and attach gpio(4) */
+	for (i = 0; i < EPGPIO_NPORTS; i++) {
+		pi = &sc->sc_port[i];
+		dir = bus_space_read_4(sc->sc_iot, sc->sc_ioh, pi->pxddr) & 0xff;
+		val = bus_space_read_4(sc->sc_iot, sc->sc_ioh, pi->pxdr) & 0xff;
+		for (j = 0; j < EPGPIO_NPINS; j++) {
+			pi->pins[j].pin_num = j;
+			pi->pins[j].pin_caps = (GPIO_PIN_INPUT
+						| GPIO_PIN_OUTPUT);
+			if((dir >> j) & 0x01)
+				pi->pins[j].pin_flags = GPIO_PIN_OUTPUT;
+			else
+				pi->pins[j].pin_flags = GPIO_PIN_INPUT;
+			if((val >> j) & 0x01)
+				pi->pins[j].pin_state = GPIO_PIN_HIGH;
+			else
+				pi->pins[j].pin_state = GPIO_PIN_LOW;
+		}
+		pi->gpio_chipset.gp_cookie = pi;
+		pi->gpio_chipset.gp_pin_read = epgpio_pin_read;
+		pi->gpio_chipset.gp_pin_write = epgpio_pin_write;
+		pi->gpio_chipset.gp_pin_ctl = epgpio_pin_ctl;
+		gba.gba_gc = &pi->gpio_chipset;
+		gba.gba_pins = pi->pins;
+		gba.gba_npins = EPGPIO_NPINS;
+		config_found_ia(self, "gpiobus", &gba, epgpiobus_print);
+	}
+#endif
+
+	/* attach device */
+	config_search_ia(epgpio_search, self, "epgpio", epgpio_print);
+}
+
+#if NGPIO > 0
+static int
+epgpiobus_print(void *aux, const char *name)
+{
+	struct gpiobus_attach_args *gba = aux;
+	struct port_info *pi = (struct port_info *)gba->gba_gc->gp_cookie;
+
+	gpiobus_print(aux, name);
+	aprint_normal(": port %c", pi->unit+'A');
+
+	return (UNCONF);
+}
+#endif
+
+
+static int
+epgpio_search(struct device *parent, struct cfdata *cf,
+	      const int *ldesc, void *aux)
+{
+	struct epgpio_softc *sc = (struct epgpio_softc*)parent;
+	struct epgpio_attach_args ga;
+
+	ga.ga_gc = sc;
+	ga.ga_iot = sc->sc_iot;
+	ga.ga_port = cf->cf_loc[EPGPIOCF_PORT];
+	ga.ga_bit1 = cf->cf_loc[EPGPIOCF_BIT1];
+	ga.ga_bit2 = cf->cf_loc[EPGPIOCF_BIT2];
+
+	if (config_match(parent, cf, &ga) > 0)
+		config_attach(parent, cf, &ga, epgpio_print);
+
+	return 0;
+}
+
+static int
+epgpio_print(void *aux, const char *name)
+{
+	struct epgpio_attach_args *ga = (struct epgpio_attach_args*)aux;
+	struct epgpio_softc *sc = (struct epgpio_softc*)ga->ga_gc;
+
+	aprint_normal(":");
+	if (ga->ga_port > -1)
+		aprint_normal(" port %c", sc->sc_port[ga->ga_port].unit+'A');
+	if (ga->ga_bit1 > -1)
+		aprint_normal(" bit1 %d", ga->ga_bit1);
+	if (ga->ga_bit2 > -1)
+		aprint_normal(" bit2 %d", ga->ga_bit2);
+
+	return (UNCONF);
+}
+
+int
+epgpio_read(struct epgpio_softc *sc, epgpio_port port, int bit)
+{
+	struct port_info *pi = &sc->sc_port[port];
+
+#if NGPIO > 0
+	pi->pins[bit].pin_caps = 0;
+#endif
+	return (bus_space_read_4(sc->sc_iot, sc->sc_ioh, pi->pxdr) >> bit) & 1;
+}
+
+void
+epgpio_set(struct epgpio_softc *sc, epgpio_port port, int bit)
+{
+	struct port_info *pi = &sc->sc_port[port];
+
+#if NGPIO > 0
+	pi->pins[bit].pin_caps = 0;
+#endif
+	epgpio_bit_set(sc, pi->pxdr, bit);
+}
+
+void
+epgpio_clear(struct epgpio_softc *sc, epgpio_port port, int bit)
+{
+	struct port_info *pi = &sc->sc_port[port];
+
+#if NGPIO > 0
+	pi->pins[bit].pin_caps = 0;
+#endif
+	epgpio_bit_clear(sc, pi->pxdr, bit);
+}
+
+void
+epgpio_in(struct epgpio_softc *sc, epgpio_port port, int bit)
+{
+	struct port_info *pi = &sc->sc_port[port];
+
+#if NGPIO > 0
+	pi->pins[bit].pin_caps = 0;
+#endif
+	epgpio_bit_clear(sc, pi->pxddr, bit);
+}
+
+void
+epgpio_out(struct epgpio_softc *sc, epgpio_port port, int bit)
+{
+	struct port_info *pi = &sc->sc_port[port];
+
+#if NGPIO > 0
+	pi->pins[bit].pin_caps = 0;
+#endif
+	epgpio_bit_set(sc, pi->pxddr, bit);
+}
+
+void *
+epgpio_intr_establish(struct epgpio_softc *sc, epgpio_port port, int bit,
+		      int flag, int ipl, int (*ireq_func)(void *), void *arg) {
+	struct port_info *pi;
+	struct intr_req *intq;
+
+	DPRINTFN(1, ("epgpio_intr_establish: port=%d, bit=%d, flag=%#x\n",port,bit,flag));
+
+	if (bit < 0 || bit >= EPGPIO_NPINS)
+		return 0;
+
+	switch (port) {
+	case PORT_A:
+	case PORT_B:
+		intq = &sc->sc_ireq_combine;
+		break;
+	case PORT_F:
+		intq = &sc->sc_ireq_f[bit];
+		break;
+	default:
+		return 0;
+	};
+
+	if (intq->ireq_func)
+		return 0;	/* already used */
+
+	intq->ireq_func = ireq_func;
+	intq->ireq_arg = arg;
+
+	pi = &sc->sc_port[port];
+	epgpio_bit_clear(sc, pi->xinten, bit);
+	epgpio_in(sc, port, bit);
+#if NGPIO > 0
+	pi->pins[bit].pin_caps = 0;
+#endif
+
+	if (flag & EDGE_TRIGGER)
+		epgpio_bit_set(sc, pi->xinttype1, bit);
+	else	/* LEVEL_SENSE */
+		epgpio_bit_clear(sc, pi->xinttype1, bit);
+	if (flag & RISING_EDGE)	/* or HIGH_LEVEL */
+		epgpio_bit_set(sc, pi->xinttype2, bit);
+	else	/* FALLING_EDGE or LOW_LEVEL */
+		epgpio_bit_clear(sc, pi->xinttype2, bit);
+	if (flag & DEBOUNCE)
+		epgpio_bit_set(sc, pi->xdb, bit);
+	else
+		epgpio_bit_clear(sc, pi->xdb, bit);
+
+	if (!intq->cookie)
+		intq->cookie = ep93xx_intr_establish(intq->irq, ipl,
+						     intq->ih_func, pi);
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, pi->xeoi, 1 << bit);
+	epgpio_bit_set(sc, pi->xinten, bit);
+	return intq->cookie;
+}
+
+void
+epgpio_intr_disestablish(struct epgpio_softc *sc, epgpio_port port, int bit)
+{
+	struct port_info *pi;
+	struct intr_req *intq;
+
+	DPRINTFN(1, ("epgpio_intr_disestablish: port=%d, bit=%d\n",port,bit));
+
+	if (bit < 0 || bit >= EPGPIO_NPINS)
+		return;
+
+	switch (port) {
+	case PORT_A:
+	case PORT_B:
+		intq = &sc->sc_ireq_combine;
+		break;
+	case PORT_F:
+		intq = &sc->sc_ireq_f[bit];
+		break;
+	default:
+		return;
+	};
+
+	if (!intq->ireq_func)
+		return;
+
+	pi = &sc->sc_port[port];
+	epgpio_bit_clear(sc, pi->xinten, bit);
+	intq->ireq_func = 0;
+	intq->ireq_arg = 0;
+	ep93xx_intr_disestablish(intq->cookie);
+	intq->cookie = 0;
+}
+
+static int
+epgpio_intr_combine(void *arg)
+{
+	struct port_info *pi = arg;
+	struct epgpio_softc *sc = pi->sc;
+	struct intr_req *intq = &sc->sc_ireq_combine;
+	int err = 0;
+
+	DPRINTFN(1, ("epgpio_intr_combine\n"));
+
+	if (intq->ireq_func)
+		err = (*intq->ireq_func)(intq->ireq_arg);
+	epgpio_bit_set(sc, pi->xeoi, 0xff);
+	return err;
+}
+
+static int
+epgpio_intr_f(void *arg, int bit)
+{
+	struct port_info *pi = arg;
+	struct epgpio_softc *sc = pi->sc;
+	struct intr_req *intq = &sc->sc_ireq_f[bit];
+	int err = 0;
+
+	DPRINTFN(1, ("epgpio_intr_%d\n", bit));
+
+	if (intq->ireq_func)
+		err = (*intq->ireq_func)(intq->ireq_arg);
+	epgpio_bit_set(sc, pi->xeoi, bit);
+	return err;
+}
+
+static int
+epgpio_intr_0(void *arg)
+{
+	return epgpio_intr_f(arg, 0);
+}
+
+static int
+epgpio_intr_1(void *arg)
+{
+	return epgpio_intr_f(arg, 1);
+}
+
+static int
+epgpio_intr_2(void *arg)
+{
+	return epgpio_intr_f(arg, 2);
+}
+
+static int
+epgpio_intr_3(void *arg)
+{
+	return epgpio_intr_f(arg, 3);
+}
+
+static int
+epgpio_intr_4(void *arg)
+{
+	return epgpio_intr_f(arg, 4);
+}
+
+static int
+epgpio_intr_5(void *arg)
+{
+	return epgpio_intr_f(arg, 5);
+}
+
+static int
+epgpio_intr_6(void *arg)
+{
+	return epgpio_intr_f(arg, 6);
+}
+
+static int
+epgpio_intr_7(void *arg)
+{
+	return epgpio_intr_f(arg, 7);
+}
+
+#if NGPIO > 0
+static int
+epgpio_pin_read(void *arg, int pin)
+{
+	struct port_info *pi = arg;
+	struct epgpio_softc *sc = pi->sc;
+
+	pin %= EPGPIO_NPINS;
+	if (!pi->pins[pin].pin_caps)
+		return 0; /* EBUSY? */
+
+	return (bus_space_read_4(sc->sc_iot, sc->sc_ioh,
+				 pi->pxdr) >> pin) & 1;
+}
+
+static void
+epgpio_pin_write(void *arg, int pin, int val)
+{
+	struct port_info *pi = arg;
+	struct epgpio_softc *sc = pi->sc;
+
+	pin %= EPGPIO_NPINS;
+	if (!pi->pins[pin].pin_caps)
+		return;
+
+	if (val)
+		epgpio_bit_set(sc, pi->pxdr, pin);
+	else
+		epgpio_bit_clear(sc, pi->pxdr, pin);
+}
+
+static void
+epgpio_pin_ctl(void *arg, int pin, int flags)
+{
+	struct port_info *pi = arg;
+	struct epgpio_softc *sc = pi->sc;
+
+	pin %= EPGPIO_NPINS;
+	if (!pi->pins[pin].pin_caps)
+		return;
+
+	if (flags & GPIO_PIN_INPUT)
+		epgpio_bit_clear(sc, pi->pxddr, pin);
+	else if (flags & GPIO_PIN_OUTPUT)
+		epgpio_bit_set(sc, pi->pxddr, pin);
+}
+#endif
+
+static void
+epgpio_bit_set(struct epgpio_softc *sc, bus_size_t reg, int bit)
+{
+	int t = bus_space_read_4(sc->sc_iot, sc->sc_ioh, reg) & 0xff;
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, reg, t | (1 << bit));
+}
+
+static void
+epgpio_bit_clear(struct epgpio_softc *sc, bus_size_t reg, int bit)
+{
+	int t = bus_space_read_4(sc->sc_iot, sc->sc_ioh, reg) & 0xff;
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, reg, t & ~(1 << bit));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/ep93xx/epgpioreg.h	Sun Dec 11 10:28:12 2005 +0000
@@ -0,0 +1,136 @@
+/*	$NetBSD: epgpioreg.h,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $	*/
+
+/*
+ * Copyright (c) 2005 HAMAJIMA Katsuomi. 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.
+ */
+
+/*	Cirrus Logic EP9315
+	GPIO Interface register
+	http://www.cirrus.com/jp/pubs/manual/EP9315_Users_Guide.pdf	*/
+
+#ifndef	_EPGPIOREG_H_
+#define	_EPGPIOREG_H_
+
+/* Port A
+7:0	EGPIO[7:0]
+6	I2S port 2 SDO2
+5	I2S port 1 SDI1
+4	I2S port 1 SDO1
+3	HDLC clock or TENn
+2	DMARQ
+1	RTC 32.768kHz reference clock
+0	Modem Ring Indicator */
+#define	EP93XX_GPIO_PADR	0x00	/* Data (R/W) */
+#define	EP93XX_GPIO_PADDR	0x10	/* Data Direction (R/W) */
+#define	EP93XX_GPIO_AIntEn	0x9c	/* Interrupt Enable (R/W) */
+#define	EP93XX_GPIO_AIntType1	0x90	/* Interrupt edge or level (R/W) */
+#define	EP93XX_GPIO_AIntType2	0x94	/* rising/falling edge, high/low level (R/W) */
+#define	EP93XX_GPIO_AEOI	0x98	/* clear interrupt (W) */
+#define	EP93XX_GPIO_ADB		0xa8	/* Interrupt debounce enable (R/W) */
+#define	EP93XX_GPIO_RawIntStsA	0xa4	/* Raw Interrupt Status (R) */
+#define	EP93XX_GPIO_IntStsA	0xa0	/* Masked interrupt Status (R) */
+
+/* Port B
+7:0	EGPIO[15:8]
+7	DASPn
+5	I2S port 2 SDI2 */
+#define	EP93XX_GPIO_PBDR	0x04	/* Data (R/W) */
+#define	EP93XX_GPIO_PBDDR	0x14	/* Data Direction (R/W) */
+#define	EP93XX_GPIO_BIntEn	0xb8	/* Interrupt Enable (R/W) */
+#define	EP93XX_GPIO_BIntType1	0xac	/* Interrupt edge or level (R/W) */
+#define	EP93XX_GPIO_BIntType2	0xb0	/* rising/falling edge, high/low level (R/W) */
+#define	EP93XX_GPIO_BEOI	0xb4	/* clear interrupt (W) */
+#define	EP93XX_GPIO_BDB		0xc4	/* Interrupt debounce enable (R/W) */
+#define	EP93XX_GPIO_RawIntStsB	0xc0	/* Raw Interrupt Status (R) */
+#define	EP93XX_GPIO_IntStsB	0xbc	/* Masked interrupt Status (R) */
+
+/* Port C
+7:0	ROW[7:0]	Key Matrix row pin */
+#define	EP93XX_GPIO_PCDR	0x08	/* Data (R/W) */
+#define	EP93XX_GPIO_PCDDR	0x18	/* Data Direction (R/W) */
+
+/* Port D
+7:0	COL[7:0]	Key Matrix column pin */
+#define	EP93XX_GPIO_PDDR	0x0c	/* Data (R/W) */
+#define	EP93XX_GPIO_PDDDR	0x1c	/* Data Direction (R/W) */
+
+/* Port E
+7:5	IDEDA[2:0]	IDE control pin
+4	IDECS1n		IDE control pin
+3	IDECS0n		IDE control pin
+2	DIORn		IDE control pin
+1	RDLED		Red LED pin
+0	GRLED		Green LED pin */
+#define	EP93XX_GPIO_PEDR	0x20	/* Data (R/W) */
+#define	EP93XX_GPIO_PEDDR	0x24	/* Data Direction (R/W) */
+
+/* Port F
+7	VS2		PCMCIA pin
+6	READY		PCMCIA pin
+5	VS1		PCMCIA pin
+4	MCBVD2		PCMCIA pin
+3	MCBVD1		PCMCIA pin
+2	MCCD2		PCMCIA pin
+1	MCCD1		PCMCIA pin
+0	WP		PCMCIA pin */
+#define	EP93XX_GPIO_PFDR	0x30	/* Data (R/W) */
+#define	EP93XX_GPIO_PFDDR	0x34	/* Data Direction (R/W) */
+#define	EP93XX_GPIO_FIntEn	0x58	/* Interrupt Enable (R/W) */
+#define	EP93XX_GPIO_FIntType1	0x4c	/* Interrupt edge or level (R/W) */
+#define	EP93XX_GPIO_FIntType2	0x50	/* rising/falling edge, high/low level (R/W) */
+#define	EP93XX_GPIO_FEOI	0x54	/* clear interrupt (W) */
+#define	EP93XX_GPIO_FDB		0x64	/* Interrupt debounce enable (R/W) */
+#define	EP93XX_GPIO_RawIntStsF	0x60	/* Raw Interrupt Status (R) */
+#define	EP93XX_GPIO_IntStsF	0x5c	/* Masked interrupt Status (R) */
+
+/* Port G
+7:4	DD[15:12]	IDE data pin
+3:2	SLA[1:0]	PCMCIA voltage control pin
+1	EEDAT		EEPROM data pin
+0	EECLK		EEPROM clock pin */
+#define	EP93XX_GPIO_PGDR	0x38	/* Data (R/W) */
+#define	EP93XX_GPIO_PGDDR	0x3c	/* Data Direction (R/W) */
+
+/* Port H
+7:0	DD[7:0]		IDE data pin */
+#define	EP93XX_GPIO_PHDR	0x40	/* Data (R/W) */
+#define	EP93XX_GPIO_PHDDR	0x44	/* Data Direction (R/W) */
+
+/* EEPROM interface pin drive type (R/W) */
+#define	EP93XX_GPIO_EEDrive	0xc8
+#define	 EP93XX_GPIO_DATOD	(1<<1)	/* EEDAT pin */
+#define	 EP93XX_GPIO_CLKOD	(1<<0)	/* EECLK pin */
+
+/* Interrupt */
+#define	EP93XX_GPIO0_INTR	19	/* Port F bit 0 */
+#define	EP93XX_GPIO1_INTR	20	/* Port F bit 1 */
+#define	EP93XX_GPIO2_INTR	21	/* Port F bit 2 */
+#define	EP93XX_GPIO3_INTR	22	/* Port F bit 3 */
+#define	EP93XX_GPIO4_INTR	47	/* Port F bit 4 */
+#define	EP93XX_GPIO5_INTR	48	/* Port F bit 5 */
+#define	EP93XX_GPIO6_INTR	49	/* Port F bit 6 */
+#define	EP93XX_GPIO7_INTR	50	/* Port F bit 7 */
+#define	EP93XX_GPIO_INTR	59	/* Port A or B */
+
+#endif	/* _EPGPIOREG_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/ep93xx/epgpiovar.h	Sun Dec 11 10:28:12 2005 +0000
@@ -0,0 +1,72 @@
+/*	$NetBSD: epgpiovar.h,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $	*/
+
+/*
+ * Copyright (c) 2005 HAMAJIMA Katsuomi. 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.
+ */
+
+#ifndef	_EPGPIOVAR_H_
+#define	_EPGPIOVAR_H_
+
+typedef enum {
+	PORT_A = 0,
+	PORT_B = 1,
+	PORT_C = 2,
+	PORT_D = 3,
+	PORT_E = 4,
+	PORT_F = 5,
+	PORT_G = 6,
+	PORT_H = 7
+} epgpio_port;
+
+struct epgpio_softc;
+
+int epgpio_read(struct epgpio_softc *,epgpio_port, int bit);
+void epgpio_set(struct epgpio_softc *,epgpio_port, int bit);
+void epgpio_clear(struct epgpio_softc *,epgpio_port, int bit);
+void epgpio_in(struct epgpio_softc *,epgpio_port, int bit);
+void epgpio_out(struct epgpio_softc *,epgpio_port, int bit);
+
+void *epgpio_intr_establish(struct epgpio_softc *,epgpio_port, int bit,
+			    int flag, int ipl, int (*)(void *), void *);
+void epgpio_intr_disestablish(struct epgpio_softc *,epgpio_port, int bit);
+
+/* interrupt flags */
+#define	EDGE_TRIGGER	0x01
+#define	LEVEL_SENSE	0x00
+#define	RISING_EDGE	0x02
+#define	HIGH_LEVEL	0x02
+#define	FALLING_EDGE	0x00
+#define	LOW_LEVEL	0x00
+#define	DEBOUNCE	0x04
+
+struct epgpio_attach_args {
+	struct epgpio_softc	*ga_gc;
+	bus_space_tag_t		ga_iot;		/* Bus tag */
+	bus_addr_t		ga_addr;	/* i/o address */
+	int			ga_port;
+	int			ga_bit1;
+	int			ga_bit2;
+};
+
+#endif	/* _EPGPIOVAR_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/ep93xx/epled.c	Sun Dec 11 10:28:12 2005 +0000
@@ -0,0 +1,143 @@
+/*	$NetBSD: epled.c,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $	*/
+
+/*
+ * Copyright (c) 2005 HAMAJIMA Katsuomi. 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: epled.c,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <arm/ep93xx/epgpiovar.h> 
+#include <arm/ep93xx/epledvar.h> 
+
+struct epled_softc {
+	struct device		sc_dev;
+	int			sc_port;
+	int			sc_green;
+	int			sc_red;
+	struct epgpio_softc	*sc_gpio;
+};
+
+static int epled_match(struct device *, struct cfdata *, void *);
+static void epled_attach(struct device *, struct device *, void *);
+
+CFATTACH_DECL(epled, sizeof(struct epled_softc),
+	      epled_match, epled_attach, NULL, NULL);
+
+static struct epled_softc *the_epled_sc = 0;
+
+int
+epled_match(struct device *parent, struct cfdata *cf, void *aux)
+{
+	return 1;
+}
+
+void
+epled_attach(struct device *parent, struct device *self, void *aux)
+{       
+	struct epled_softc *sc = (struct epled_softc *)self;
+	struct epgpio_attach_args *ga = aux;
+
+	sc->sc_port = ga->ga_port;
+	sc->sc_green = ga->ga_bit1;
+	sc->sc_red = ga->ga_bit2;
+	sc->sc_gpio = (struct epgpio_softc *)parent;
+	printf("\n");
+
+	if (!the_epled_sc)
+		the_epled_sc = sc;
+#ifdef DIAGNOSTIC
+	else
+		printf("%s%d is already configured\n",
+			sc->sc_dev.dv_xname, sc->sc_dev.dv_unit);
+#endif
+
+	epgpio_out(sc->sc_gpio, sc->sc_port, sc->sc_green);
+	epgpio_out(sc->sc_gpio, sc->sc_port, sc->sc_red);
+}
+
+int
+epled_red_on(void)
+{
+	struct epled_softc *sc = the_epled_sc;
+
+#ifdef DIAGNOSTIC
+	if (!sc) {
+		printf("epled not configured\n");
+		return (ENXIO);
+	}
+#endif
+	epgpio_set(sc->sc_gpio, sc->sc_port, sc->sc_red);
+	return 0;
+}
+
+int
+epled_red_off(void)
+{
+	struct epled_softc *sc = the_epled_sc;
+
+#ifdef DIAGNOSTIC
+	if (!sc) {
+		printf("epled not configured\n");
+		return (ENXIO);
+	}
+#endif
+	epgpio_clear(sc->sc_gpio, sc->sc_port, sc->sc_red);
+	return 0;
+}
+
+int
+epled_green_on(void)
+{
+	struct epled_softc *sc = the_epled_sc;
+
+#ifdef DIAGNOSTIC
+	if (!sc) {
+		printf("epled not configured\n");
+		return (ENXIO);
+	}
+#endif
+	epgpio_set(sc->sc_gpio, sc->sc_port, sc->sc_green);
+	return 0;
+}
+
+int
+epled_green_off(void)
+{
+	struct epled_softc *sc = the_epled_sc;
+
+#ifdef DIAGNOSTIC
+	if (!sc) {
+		printf("epled not configured\n");
+		return (ENXIO);
+	}
+#endif
+	epgpio_clear(sc->sc_gpio, sc->sc_port, sc->sc_green);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/ep93xx/epledvar.h	Sun Dec 11 10:28:12 2005 +0000
@@ -0,0 +1,36 @@
+/*	$NetBSD: epledvar.h,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $	*/
+
+/*
+ * Copyright (c) 2005 HAMAJIMA Katsuomi. 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.
+ */
+
+#ifndef	_EPLEDVAR_H_
+#define	_EPLEDVAR_H_
+
+int epled_red_on(void);
+int epled_red_off(void);
+int epled_green_on(void);
+int epled_green_off(void);
+
+#endif	/* _EPLEDVAR_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/ep93xx/eppcic.c	Sun Dec 11 10:28:12 2005 +0000
@@ -0,0 +1,697 @@
+/*	$NetBSD: eppcic.c,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $	*/
+
+/*
+ * Copyright (c) 2005 HAMAJIMA Katsuomi. 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: eppcic.c,v 1.1.4.2 2005/12/11 10:28:15 christos Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/device.h>
+#include <sys/kthread.h>
+#include <uvm/uvm_param.h>
+#include <machine/bus.h>
+#include <dev/pcmcia/pcmciareg.h>
+#include <dev/pcmcia/pcmciavar.h>
+#include <dev/pcmcia/pcmciachip.h>
+#include <arm/ep93xx/epsocvar.h> 
+#include <arm/ep93xx/epgpiovar.h> 
+#include <arm/ep93xx/eppcicvar.h> 
+#include <arm/ep93xx/ep93xxreg.h>
+#include <arm/ep93xx/epsmcreg.h>
+#include "epled.h"
+#if NEPLED > 0
+#include <arm/ep93xx/epledvar.h> 
+#endif
+
+#include "epgpio.h"
+#if NEPGPIO == 0
+#error "epgpio requires in eppcic"
+#endif
+
+#ifdef EPPCIC_DEBUG
+int eppcic_debug = EPPCIC_DEBUG;
+#define DPRINTFN(n,x)	if (eppcic_debug>(n)) printf x;
+#else
+#define DPRINTFN(n,x)
+#endif
+
+/* Mem & I/O */
+#define	SOCKET0_MCCD1	1	/* pin36/pin26 (negative) Card Detect 1 */
+#define	SOCKET0_MCCD2	2	/* pin67/pin25 (negative) Card Detect 2 */
+#define	SOCKET0_VS1	5	/* pin33/pin43 (negative) Voltage Sense 1 */
+#define	SOCKET0_VS2	7	/* pin57/pin40 (negative) Voltage Sense 2 */
+/* Memory */
+#define	SOCKET0_WP	0	/* pin33/pin24 Write Protect */
+#define	SOCKET0_MCBVD1	3	/* pin63/pin46 Battery Voltage Detect 1 */
+#define	SOCKET0_MCBVD2	4	/* pin62/pin45 Battery Voltage Detect 2 */
+#define	SOCKET0_READY	6	/* pin16/pin37 Ready */
+/* I/O */
+#define	SOCKET0_STSCHG	3	/* pin63/pin46 (negative) Status Change */
+#define	SOCKET0_SPKR	4	/* pin62/pin45 (negative) Speaker */
+#define	SOCKET0_IREQ	6	/* pin16/pin37 Interrupt Request */
+
+struct eppcic_handle {
+	int			ph_socket;	/* socket number */
+	struct eppcic_softc	*ph_sc;
+	struct device		*ph_card;
+	int			(*ph_ih_func)(void *);
+	void			*ph_ih_arg;
+	struct proc		*ph_event_thread;
+	int			ph_run;		/* ktread running */
+	int			ph_width;	/* 8 or 16 */
+	int			ph_vcc;		/* 3 or 5 */
+	int			ph_status[2];	/* cd1 and cd2 */
+	int			ph_port;	/* GPIO port */
+	int			ph_cd[2];	/* card detect */
+	int			ph_vs[2];	/* voltage sense */
+	int			ph_ireq;	/* interrupt request */
+	struct {
+		bus_size_t	reg;
+		bus_addr_t	base;
+		bus_size_t	size;
+	} ph_space[3];
+#define	IO		0
+#define	COMMON		1
+#define	ATTRIBUTE	2
+};
+
+static int eppcic_intr_carddetect(void *);
+static int eppcic_intr_socket(void *);
+static int eppcic_print(void *, const char *);
+static void eppcic_create_event_thread(void *);
+static void eppcic_event_thread(void *);
+void eppcic_shutdown(void *);
+
+static int eppcic_mem_alloc(pcmcia_chipset_handle_t, bus_size_t,
+			    struct pcmcia_mem_handle *);
+static void eppcic_mem_free(pcmcia_chipset_handle_t,
+			    struct pcmcia_mem_handle *);
+static int eppcic_mem_map(pcmcia_chipset_handle_t, int, bus_addr_t, bus_size_t,
+			  struct pcmcia_mem_handle *, bus_size_t *, int *);
+static void eppcic_mem_unmap(pcmcia_chipset_handle_t, int);
+static int eppcic_io_alloc(pcmcia_chipset_handle_t, bus_addr_t, bus_size_t,
+			   bus_size_t, struct pcmcia_io_handle *);
+static void eppcic_io_free(pcmcia_chipset_handle_t, struct pcmcia_io_handle *);
+static int eppcic_io_map(pcmcia_chipset_handle_t, int, bus_addr_t, bus_size_t,
+			 struct pcmcia_io_handle *, int *);
+static void eppcic_io_unmap(pcmcia_chipset_handle_t, int);
+static void *eppcic_intr_establish(pcmcia_chipset_handle_t,
+				   struct pcmcia_function *,
+				   int, int (*)(void *), void *);
+static void eppcic_intr_disestablish(pcmcia_chipset_handle_t, void *);
+static void eppcic_socket_enable(pcmcia_chipset_handle_t);
+static void eppcic_socket_disable(pcmcia_chipset_handle_t);
+static void eppcic_socket_settype(pcmcia_chipset_handle_t, int);
+
+static void eppcic_attach_socket(struct eppcic_handle *);
+static void eppcic_config_socket(struct eppcic_handle *);
+static int eppcic_get_voltage(struct eppcic_handle *);
+static void eppcic_set_pcreg(struct eppcic_handle *, int);
+
+static struct pcmcia_chip_functions eppcic_functions = {
+	eppcic_mem_alloc,	eppcic_mem_free,
+	eppcic_mem_map,		eppcic_mem_unmap,
+	eppcic_io_alloc,	eppcic_io_free,
+	eppcic_io_map,		eppcic_io_unmap,
+	eppcic_intr_establish,	eppcic_intr_disestablish,
+	eppcic_socket_enable,	eppcic_socket_disable,
+	eppcic_socket_settype
+};
+
+void
+eppcic_attach_common(struct device *parent, struct device *self, void *aux,
+		     eppcic_chipset_tag_t pcic)
+{
+	struct eppcic_softc *sc = (struct eppcic_softc *)self;
+	struct epsoc_attach_args *sa = aux;
+	struct eppcic_handle *ph;
+	int reg;
+	int i;
+
+	if (!sa->sa_gpio) {
+		printf("%s: epgpio requires\n", self->dv_xname);
+		return;
+	}
+	sc->sc_gpio = sa->sa_gpio;
+	sc->sc_iot = sa->sa_iot;
+	sc->sc_hclk = sa->sa_hclk;
+	sc->sc_pcic = pcic;
+	sc->sc_enable = 0;
+	if (bus_space_map(sa->sa_iot, sa->sa_addr,
+			  sa->sa_size, 0, &sc->sc_ioh)){
+		printf("%s: Cannot map registers\n", self->dv_xname);
+		return;
+	}
+	printf("\n");
+
+#if NEPLED > 0
+	epled_green_on();
+	epled_red_off();
+#endif
+	/* socket 0 */
+	if (!(ph = malloc(sizeof(struct eppcic_handle), M_DEVBUF, M_NOWAIT))) {
+		printf("%s: Cannot allocate memory\n", self->dv_xname);
+		return; /* ENOMEM */
+	}
+	sc->sc_ph[0] = ph;
+	ph->ph_sc = sc;
+	ph->ph_socket = 0;
+	ph->ph_port = PORT_F;
+	ph->ph_cd[0] = SOCKET0_MCCD1;
+	ph->ph_cd[1] = SOCKET0_MCCD2;
+	ph->ph_vs[0] = SOCKET0_VS1;
+	ph->ph_vs[1] = SOCKET0_VS2;
+	ph->ph_ireq = SOCKET0_IREQ;
+	ph->ph_space[IO].reg = EP93XX_PCMCIA0_IO;
+	ph->ph_space[IO].base = EP93XX_PCMCIA0_HWBASE + EP93XX_PCMCIA_IO;
+	ph->ph_space[IO].size = EP93XX_PCMCIA_IO_SIZE;
+	ph->ph_space[COMMON].reg = EP93XX_PCMCIA0_Common;
+	ph->ph_space[COMMON].base = EP93XX_PCMCIA0_HWBASE
+				    + EP93XX_PCMCIA_COMMON;
+	ph->ph_space[COMMON].size = EP93XX_PCMCIA_COMMON_SIZE;
+	ph->ph_space[ATTRIBUTE].reg = EP93XX_PCMCIA0_Attribute;
+	ph->ph_space[ATTRIBUTE].base = EP93XX_PCMCIA0_HWBASE
+				       + EP93XX_PCMCIA_ATTRIBUTE;
+	ph->ph_space[ATTRIBUTE].size = EP93XX_PCMCIA_ATTRIBUTE_SIZE;
+	eppcic_attach_socket(ph);
+
+	reg = EP93XX_PCMCIA_WEN | (pcic->socket_type)(sc, 0);
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, EP93XX_PCMCIA_Ctrl,
+			  EP93XX_PCMCIA_RST | reg);
+	delay(10);
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, EP93XX_PCMCIA_Ctrl, reg);
+	delay(500);
+
+	for (i = 0; i < EP93XX_PCMCIA_NSOCKET; i++)
+		eppcic_config_socket(sc->sc_ph[i]);
+#if NEPLED > 0
+	epled_green_off();
+#endif
+}
+
+static void
+eppcic_attach_socket(struct eppcic_handle *ph)
+{
+	struct eppcic_softc *sc = ph->ph_sc;
+	eppcic_chipset_tag_t pcic = sc->sc_pcic;
+	int wait;
+
+	ph->ph_width = 16;
+	ph->ph_vcc = 3;
+	ph->ph_event_thread = NULL;
+	ph->ph_run = 0;
+	ph->ph_ih_func = NULL;
+	ph->ph_ih_arg = NULL;
+	epgpio_in(sc->sc_gpio, ph->ph_port, ph->ph_cd[0]);
+	epgpio_in(sc->sc_gpio, ph->ph_port, ph->ph_cd[1]);
+	epgpio_in(sc->sc_gpio, ph->ph_port, ph->ph_vs[0]);
+	epgpio_in(sc->sc_gpio, ph->ph_port, ph->ph_vs[1]);
+	ph->ph_status[0] = epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_cd[0]);
+	ph->ph_status[1] = epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_cd[1]);
+	wait = (pcic->power_ctl)(sc, ph->ph_socket, POWER_OFF);
+	delay(wait);
+	eppcic_set_pcreg(ph, ph->ph_space[IO].reg);
+	eppcic_set_pcreg(ph, ph->ph_space[COMMON].reg);
+	eppcic_set_pcreg(ph, ph->ph_space[ATTRIBUTE].reg);
+	wait = (pcic->power_ctl)(sc, ph->ph_socket, POWER_ON);
+	delay(wait);
+}
+
+static void
+eppcic_config_socket(struct eppcic_handle *ph)
+{
+	struct eppcic_softc *sc = ph->ph_sc;
+	eppcic_chipset_tag_t pcic = sc->sc_pcic;
+	struct pcmciabus_attach_args paa;
+	int wait;
+
+	paa.paa_busname = "pcmcia";
+	paa.pct = (pcmcia_chipset_tag_t)&eppcic_functions;
+	paa.pch = (pcmcia_chipset_handle_t)ph;
+	paa.iobase = ph->ph_space[IO].base;
+	paa.iosize = ph->ph_space[IO].size;
+	ph->ph_card = config_found_ia((void*)sc, "pcmciabus", &paa,
+				      eppcic_print);
+	
+	epgpio_intr_establish(sc->sc_gpio, ph->ph_port, ph->ph_cd[0],
+			      EDGE_TRIGGER | FALLING_EDGE | DEBOUNCE,
+			      IPL_TTY, eppcic_intr_carddetect, ph);
+	epgpio_intr_establish(sc->sc_gpio, ph->ph_port, ph->ph_cd[1],
+			      EDGE_TRIGGER | RISING_EDGE | DEBOUNCE,
+			      IPL_TTY, eppcic_intr_carddetect, ph);
+	wait = (pcic->power_ctl)(sc, ph->ph_socket, POWER_OFF);
+	delay(wait);
+
+	kthread_create(eppcic_create_event_thread, ph);
+}
+
+static int     
+eppcic_print(void *arg, const char *pnp)
+{                       
+	return (UNCONF);
+}       
+
+static void
+eppcic_create_event_thread(void *arg)
+{
+	struct eppcic_handle *ph = arg;
+	struct eppcic_softc *sc = ph->ph_sc;
+
+	ph->ph_status[0] = epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_cd[0]);
+	ph->ph_status[1] = epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_cd[1]);
+
+	DPRINTFN(1, ("eppcic_create_event_thread: cd1=%d, cd2=%d\n",ph->ph_status[0],ph->ph_status[1]));
+
+	if (!(ph->ph_status[0] | ph->ph_status[1]))
+		pcmcia_card_attach(ph->ph_card);
+
+	ph->ph_run = 1;
+	kthread_create1(eppcic_event_thread, ph, &ph->ph_event_thread,
+			"%s,%d", sc->sc_dev.dv_xname, ph->ph_socket);
+}
+
+static void
+eppcic_event_thread(void *arg)
+{
+	struct eppcic_handle *ph = arg;
+
+	for (;;) {
+		tsleep(ph, PWAIT, "CSC wait", 0);
+		if (!ph->ph_run)
+			break;
+
+		DPRINTFN(1, ("eppcic_event_thread: cd1=%d, cd2=%d\n",ph->ph_status[0],ph->ph_status[1]));
+
+		if (!ph->ph_status[0] && !ph->ph_status[1])
+			pcmcia_card_attach(ph->ph_card);
+		else if (ph->ph_status[0] && ph->ph_status[1])
+			pcmcia_card_detach(ph->ph_card, DETACH_FORCE);
+	}
+
+	DPRINTFN(1, ("eppcic_event_thread: run=%d\n",ph->ph_run));
+	ph->ph_event_thread = NULL;
+	kthread_exit(0);
+}
+
+void
+eppcic_shutdown(void *arg)
+{
+	struct eppcic_handle *ph = arg;
+
+	DPRINTFN(1, ("eppcic_shutdown\n"));
+	ph->ph_run = 0;
+	wakeup(ph);
+}
+
+static int
+eppcic_intr_carddetect(void *arg)
+{
+	struct eppcic_handle *ph = arg;
+	struct eppcic_softc *sc = ph->ph_sc;
+	int nstatus[2];
+
+	nstatus[0] = epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_cd[0]);
+	nstatus[1] = epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_cd[1]);
+
+	DPRINTFN(1, ("eppcic_intr: cd1=%#x, cd2=%#x\n",nstatus[0],nstatus[1]));
+
+	if (nstatus[0] != ph->ph_status[0] || nstatus[1] != ph->ph_status[1])
+		wakeup(ph);
+	ph->ph_status[0] = nstatus[0];
+	ph->ph_status[1] = nstatus[1];
+	return 0;
+}
+
+static int
+eppcic_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size,
+		 struct pcmcia_mem_handle *pmh)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+
+	DPRINTFN(1, ("eppcic_mem_alloc: size=%#x\n",(unsigned)size));
+
+	pmh->memt = sc->sc_iot;
+	return 0;
+}
+
+static void
+eppcic_mem_free(pcmcia_chipset_handle_t pch, struct pcmcia_mem_handle *pmh)
+{
+	DPRINTFN(1, ("eppcic_mem_free\n"));
+}
+
+static int
+eppcic_mem_map(pcmcia_chipset_handle_t pch, int kind, bus_addr_t addr,
+	       bus_size_t size, struct pcmcia_mem_handle *pmh,
+	       bus_size_t *offsetp, int *windowp)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+	bus_addr_t pa;
+	int err;
+
+	DPRINTFN(1, ("eppcic_mem_map: kind=%d, addr=%#x, size=%#x\n",kind,(unsigned)addr,(unsigned)size));
+
+	pa = addr;
+	*offsetp = 0;
+	size = round_page(size);
+	pmh->realsize = size;
+	if (kind & PCMCIA_WIDTH_MEM8)
+		ph->ph_width = 8;
+	else
+		ph->ph_width = 16;
+	switch (kind & ~PCMCIA_WIDTH_MEM_MASK) {
+	case PCMCIA_MEM_ATTR:
+		eppcic_set_pcreg(ph, ph->ph_space[ATTRIBUTE].reg);
+		pa += ph->ph_space[ATTRIBUTE].base;
+		break;
+	case PCMCIA_MEM_COMMON:
+		eppcic_set_pcreg(ph, ph->ph_space[COMMON].reg);
+		pa += ph->ph_space[COMMON].base;
+		break;
+	default:
+		return -1;
+	}
+
+	DPRINTFN(1, ("eppcic_mem_map: pa=%#x, *offsetp=%#x, size=%#x\n",(unsigned)pa,(unsigned)addr,(unsigned)size));
+
+	if (!(err = bus_space_map(sc->sc_iot, pa, size, 0, &pmh->memh)))
+		*windowp = (int)pmh->memh;
+	return err;
+}
+
+static void
+eppcic_mem_unmap(pcmcia_chipset_handle_t pch, int window)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+
+	DPRINTFN(1, ("eppcic_mem_unmap: window=%#x\n",window));
+
+	bus_space_unmap(sc->sc_iot, (bus_addr_t)window, 0x400);
+}
+
+static int
+eppcic_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start, bus_size_t size,
+		bus_size_t align, struct pcmcia_io_handle *pih)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+	bus_addr_t pa;
+
+	DPRINTFN(1, ("eppcic_io_alloc: start=%#x, size=%#x, align=%#x\n",(unsigned)start,(unsigned)size,(unsigned)align));
+
+	pih->iot = sc->sc_iot;
+	pih->addr = start;
+	pih->size = size;
+	pa = pih->addr + ph->ph_space[IO].base;
+	return bus_space_map(sc->sc_iot, pa, size, 0, &pih->ioh);
+}
+
+static void
+eppcic_io_free(pcmcia_chipset_handle_t pch, struct pcmcia_io_handle *pih)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+
+	DPRINTFN(1, ("eppcic_io_free\n"));
+
+	bus_space_unmap(sc->sc_iot, pih->ioh, pih->size);
+}
+
+static int
+eppcic_io_map(pcmcia_chipset_handle_t pch, int width, bus_addr_t offset,
+	      bus_size_t size, struct pcmcia_io_handle *pih, int *windowp)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+
+	DPRINTFN(1, ("eppcic_io_map: offset=%#x, size=%#x, width=%d",(unsigned)offset,(unsigned)size,width));
+
+	switch (width) {
+	case PCMCIA_WIDTH_IO8:
+		DPRINTFN(1, ("(8bit)\n"));
+		ph->ph_width = 8;
+		break;
+	case PCMCIA_WIDTH_IO16:
+	case PCMCIA_WIDTH_AUTO:	/* I don't understand how I check it */
+		DPRINTFN(1, ("(16bit)\n"));
+		ph->ph_width = 16;
+		break;
+	default:
+		DPRINTFN(1, ("(unknown)\n"));
+		return -1;
+	}
+	eppcic_set_pcreg(ph, ph->ph_space[IO].reg);
+	*windowp = 0; /* unused */
+	return 0;
+}
+
+static void
+eppcic_io_unmap(pcmcia_chipset_handle_t pch, int window)
+{
+	DPRINTFN(1, ("eppcic_io_unmap: window=%#x\n",window));
+}
+
+static void *
+eppcic_intr_establish(pcmcia_chipset_handle_t pch, struct pcmcia_function *pf,
+		      int ipl, int (*ih_func)(void *), void *ih_arg)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+
+	DPRINTFN(1, ("eppcic_intr_establish\n"));
+
+	if (ph->ph_ih_func)
+		return 0;
+
+	ph->ph_ih_func = ih_func;
+	ph->ph_ih_arg = ih_arg;
+	return epgpio_intr_establish(sc->sc_gpio, ph->ph_port, ph->ph_ireq,
+				     LEVEL_SENSE | LOW_LEVEL,
+				     ipl, eppcic_intr_socket, ph);
+}
+
+static void
+eppcic_intr_disestablish(pcmcia_chipset_handle_t pch, void *ih)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+
+	DPRINTFN(1, ("eppcic_intr_disestablish\n"));
+
+	ph->ph_ih_func = NULL;
+	ph->ph_ih_arg = NULL;
+	epgpio_intr_disestablish(sc->sc_gpio, ph->ph_port, ph->ph_ireq);
+}
+
+static int
+eppcic_intr_socket(void *arg)
+{
+	struct eppcic_handle *ph = arg;
+	int err = 0;
+
+	if (ph->ph_ih_func) {
+#if NEPLED > 0
+		epled_red_on();
+#endif
+		err = (*ph->ph_ih_func)(ph->ph_ih_arg);
+#if NEPLED > 0
+		epled_red_off();
+#endif
+	}
+	return err;
+}
+
+
+static void
+eppcic_socket_enable(pcmcia_chipset_handle_t pch)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+	eppcic_chipset_tag_t pcic = sc->sc_pcic;
+	int wait;
+
+	DPRINTFN(1, ("eppcic_socket_enable\n"));
+
+	wait = (pcic->power_ctl)(sc, ph->ph_socket, POWER_ON);
+	delay(wait);
+#if NEPLED > 0
+	if (!sc->sc_enable++)
+		epled_green_on();
+#endif
+	ph->ph_vcc = eppcic_get_voltage(ph);
+}
+
+static void
+eppcic_socket_disable(pcmcia_chipset_handle_t pch)
+{
+	struct eppcic_handle *ph = (struct eppcic_handle *)pch;
+	struct eppcic_softc *sc = ph->ph_sc;
+	eppcic_chipset_tag_t pcic = sc->sc_pcic;
+	int wait;
+
+	DPRINTFN(1, ("eppcic_socket_disable\n"));
+
+	wait = (pcic->power_ctl)(sc, ph->ph_socket, POWER_OFF);
+	delay(wait);
+#if NEPLED > 0
+	if (!--sc->sc_enable)
+		epled_green_off();
+#endif
+}
+
+static void
+eppcic_socket_settype(pcmcia_chipset_handle_t pch, int type)
+{
+	DPRINTFN(1, ("eppcic_socket_settype: type=%d",type));
+
+	switch (type) {
+	case PCMCIA_IFTYPE_MEMORY:
+		DPRINTFN(1, ("(Memory)\n"));
+		break;
+	case PCMCIA_IFTYPE_IO:
+		DPRINTFN(1, ("(I/O)\n"));
+		break;
+	default:
+		DPRINTFN(1, ("(unknown)\n"));
+		return;
+	}
+}
+
+static int
+eppcic_get_voltage(struct eppcic_handle *ph)
+{
+	struct eppcic_softc *sc = ph->ph_sc;
+	eppcic_chipset_tag_t pcic = sc->sc_pcic;
+	int cap, vcc = 0;
+
+	cap = (pcic->power_capability)(sc, ph->ph_socket);
+	if (epgpio_read(sc->sc_gpio, ph->ph_port, ph->ph_vs[0])) {
+		if (cap | VCC_5V)
+			vcc = 5;
+		else
+			printf("%s: unsupported Vcc 5 Volts",
+			       sc->sc_dev.dv_xname);
+	} else {
+		if (cap | VCC_3V)
+			vcc = 3;
+		else
+			printf("%s: unsupported Vcc 3.3 Volts",
+			       sc->sc_dev.dv_xname);
+	}
+	DPRINTFN(1, ("eppcic_get_voltage: vs1=%d, vs2=%d (%dV)\n",epgpio_read_bit(sc->sc_gpio, ph->ph_port, ph->ph_vs[0]),epgpio_read_bit(sc->sc_gpio, ph->ph_port, ph->ph_vs[1]),vcc));
+	return vcc;
+}
+
+#define	EXTRA_DELAY	40
+
+static void
+eppcic_set_pcreg(struct eppcic_handle *ph, int kind)
+{
+	struct eppcic_softc *sc = ph->ph_sc;
+	int atiming, htiming, ptiming;
+	int period = 1000000000 / sc->sc_hclk;
+	int width;
+
+	switch (ph->ph_width) {
+	case 8:
+		width = 0;
+		break;
+	case 16:
+		width = EP93XX_PCMCIA_WIDTH_16;
+		break;
+	default:
+		return;
+	}
+	switch (kind) {
+	case IO:
+		atiming = 165; htiming = 20; ptiming = 70;
+		break;
+	case COMMON:
+#if linux_timing!=hamajima20050816
+		switch (ph->ph_vcc) {
+		case 3:
+			atiming = 465; htiming = 35; ptiming = 100;
+			break;
+		case 5:
+			atiming = 200; htiming = 20; ptiming = 30;
+			break;
+		default:
+			return;
+		}
+		break;
+#endif
+	case ATTRIBUTE:
+		switch (ph->ph_vcc) {
+		case 3:
+#if linux_timing!=hamajima20050816
+			atiming = 465; htiming = 35; ptiming = 100;
+#else
+			atiming = 600; htiming = 35; ptiming = 100;
+#endif
+			break;
+		case 5:
+#if linux_timing!=hamajima20050816
+			atiming = 250; htiming = 20; ptiming = 30;
+#else
+			atiming = 300; htiming = 20; ptiming = 30;
+#endif
+			break;
+		default:
+			return;
+		}
+		break;
+	default:
+		return;
+	}
+
+#if linux_timing!=hamajima20050816
+	period = 1000000000 / 50000000;
+	width = EP93XX_PCMCIA_WIDTH_16;
+#endif
+
+	atiming = (atiming + EXTRA_DELAY) / period;
+	if (atiming>0xff)
+		atiming = 0xff;
+	htiming = ((htiming + EXTRA_DELAY) / period) + 1;
+	if (htiming>0xf)
+		htiming = 0xf;
+	ptiming = (ptiming + EXTRA_DELAY) / period;
+	if (ptiming>0xff)
+		ptiming = 0xff;
+
+	DPRIN