Back out the lwp/ktrace changes. They contained a lot of colateral damage, trunk
authorfvdl <fvdl@NetBSD.org>
Sun, 29 Jun 2003 22:28:00 +0000
branchtrunk
changeset 114306 4f398a0268d6
parent 114305 eed947a49c97
child 114307 057738e0a2c9
Back out the lwp/ktrace changes. They contained a lot of colateral damage, and need to be examined and discussed more.
sys/altq/altq_conf.h
sys/arch/algor/algor/bus_dma.c
sys/arch/alpha/alpha/machdep.c
sys/arch/alpha/alpha/promcons.c
sys/arch/alpha/alpha/syscall.c
sys/arch/alpha/alpha/vm_machdep.c
sys/arch/alpha/common/bus_dma.c
sys/arch/alpha/common/sgmap_typedep.c
sys/arch/alpha/include/pcb.h
sys/arch/amiga/amiga/amiga_init.c
sys/arch/amiga/amiga/machdep.c
sys/arch/arc/arc/bus_dma.c
sys/arch/arc/jazz/bus_dma_jazz.c
sys/arch/arm/arm/syscall.c
sys/arch/arm/arm/vm_machdep_arm.c
sys/arch/arm/arm32/arm32_machdep.c
sys/arch/arm/arm32/bus_dma.c
sys/arch/arm/footbridge/footbridge_com.c
sys/arch/arm/ixp12x0/ixp12x0_com.c
sys/arch/arm/s3c2xx0/sscom.c
sys/arch/arm/sa11x0/sa11x0_com.c
sys/arch/arm/xscale/ixp425_com.c
sys/arch/arm/xscale/ixp425_comvar.h
sys/arch/arm/xscale/ixp425reg.h
sys/arch/atari/atari/bus.c
sys/arch/atari/atari/machdep.c
sys/arch/cesfic/cesfic/machdep.c
sys/arch/cobalt/cobalt/bus.c
sys/arch/evbppc/evbppc/bus_dma.c
sys/arch/hp300/dev/ac.c
sys/arch/hp300/dev/apci.c
sys/arch/hp300/dev/ct.c
sys/arch/hp300/dev/dca.c
sys/arch/hp300/dev/dcm.c
sys/arch/hp300/dev/grf.c
sys/arch/hp300/dev/grfvar.h
sys/arch/hp300/dev/hil.c
sys/arch/hp300/dev/ite.c
sys/arch/hp300/dev/mt.c
sys/arch/hp300/dev/ppi.c
sys/arch/hp300/dev/rd.c
sys/arch/hp300/dev/sd.c
sys/arch/hp300/dev/st.c
sys/arch/hp300/hp300/hpux_machdep.c
sys/arch/hp300/hp300/machdep.c
sys/arch/hp300/include/hpux_machdep.h
sys/arch/hpc/hpc/kloader.c
sys/arch/hpcmips/hpcmips/bus_dma.c
sys/arch/i386/conf/GENERIC
sys/arch/i386/i386/apm.c
sys/arch/i386/i386/machdep.c
sys/arch/i386/i386/mem.c
sys/arch/i386/i386/process_machdep.c
sys/arch/i386/i386/procfs_machdep.c
sys/arch/i386/i386/syscall.c
sys/arch/i386/i386/vm_machdep.c
sys/arch/i386/include/ptrace.h
sys/arch/luna68k/luna68k/machdep.c
sys/arch/m68k/m68k/bus_dma.c
sys/arch/m68k/m68k/m68k_syscall.c
sys/arch/m68k/m68k/svr4_machdep.c
sys/arch/m68k/m68k/vm_machdep.c
sys/arch/mac68k/mac68k/machdep.c
sys/arch/macppc/dev/aed.c
sys/arch/macppc/dev/apm.c
sys/arch/macppc/dev/ofb.c
sys/arch/macppc/dev/z8530tty.c
sys/arch/macppc/macppc/bus_dma.c
sys/arch/mips/alchemy/dev/aucom.c
sys/arch/mips/alchemy/dev/aucom_aubus.c
sys/arch/mips/mips/bus_dma.c
sys/arch/mips/mips/cpu_exec.c
sys/arch/mips/mips/db_interface.c
sys/arch/mips/mips/mips_emul.c
sys/arch/mips/mips/mips_machdep.c
sys/arch/mips/mips/trap.c
sys/arch/mips/mips/vm_machdep.c
sys/arch/mips/sibyte/dev/sbobio.c
sys/arch/mips/sibyte/dev/sbscn.c
sys/arch/mipsco/mipsco/bus_dma.c
sys/arch/mvme68k/mvme68k/bus_dma.c
sys/arch/mvme68k/mvme68k/machdep.c
sys/arch/news68k/news68k/machdep.c
sys/arch/newsmips/newsmips/bus.c
sys/arch/next68k/next68k/machdep.c
sys/arch/pc532/pc532/machdep.c
sys/arch/playstation2/playstation2/bus_dma.c
sys/arch/playstation2/playstation2/kloader.c
sys/arch/pmax/dev/dc.c
sys/arch/pmax/dev/dtop.c
sys/arch/pmax/dev/fb_usrreq.c
sys/arch/pmax/dev/px.c
sys/arch/pmax/dev/rcons.c
sys/arch/pmax/pmax/bus_dma.c
sys/arch/pmax/tc/scc.c
sys/arch/powerpc/include/ptrace.h
sys/arch/powerpc/marvell/bus_dma.c
sys/arch/powerpc/powerpc/bus_dma.c
sys/arch/powerpc/powerpc/powerpc_machdep.c
sys/arch/powerpc/powerpc/process_machdep.c
sys/arch/powerpc/powerpc/procfs_machdep.c
sys/arch/powerpc/powerpc/syscall.c
sys/arch/powerpc/powerpc/vm_machdep.c
sys/arch/sgimips/sgimips/bus.c
sys/arch/sh3/sh3/coff_exec.c
sys/arch/sh3/sh3/exception.c
sys/arch/sh5/sh5/bus_dma.c
sys/arch/sh5/sh5/syscall.c
sys/arch/sparc/dev/cgeight.c
sys/arch/sparc/dev/cgfour.c
sys/arch/sparc/dev/cgfourteen.c
sys/arch/sparc/dev/cgtwo.c
sys/arch/sparc/dev/fd.c
sys/arch/sparc/dev/kd.c
sys/arch/sparc/dev/tctrl.c
sys/arch/sparc/sparc/machdep.c
sys/arch/sparc/sparc/openprom.c
sys/arch/sparc/sparc/trap.c
sys/arch/sparc/sparc/vm_machdep.c
sys/arch/sparc64/dev/kd.c
sys/arch/sparc64/dev/pcons.c
sys/arch/sparc64/dev/sab.c
sys/arch/sparc64/include/netbsd32_machdep.h
sys/arch/sparc64/sparc64/machdep.c
sys/arch/sparc64/sparc64/mem.c
sys/arch/sparc64/sparc64/netbsd32_machdep.c
sys/arch/sparc64/sparc64/openprom.c
sys/arch/sparc64/sparc64/trap.c
sys/arch/sparc64/sparc64/vm_machdep.c
sys/arch/sun2/sun2/machdep.c
sys/arch/sun3/sun3/machdep.c
sys/arch/sun3/sun3x/machdep.c
sys/arch/vax/vax/bus_dma.c
sys/arch/vax/vax/trap.c
sys/arch/vax/vax/vm_machdep.c
sys/arch/x68k/x68k/bus.c
sys/arch/x68k/x68k/machdep.c
sys/arch/x86/x86/bus_dma.c
sys/coda/coda_psdev.c
sys/coda/coda_venus.c
sys/coda/coda_venus.h
sys/coda/coda_vfsops.c
sys/coda/coda_vfsops.h
sys/coda/coda_vnops.c
sys/coda/coda_vnops.h
sys/compat/aout/aout_misc.c
sys/compat/aoutm68k/aoutm68k_misc.c
sys/compat/aoutm68k/aoutm68k_stat.c
sys/compat/common/compat_file.c
sys/compat/common/compat_util.c
sys/compat/common/compat_util.h
sys/compat/common/kern_info_09.c
sys/compat/common/kern_info_43.c
sys/compat/common/tty_43.c
sys/compat/common/uipc_syscalls_43.c
sys/compat/common/vfs_syscalls_12.c
sys/compat/common/vfs_syscalls_43.c
sys/compat/darwin/darwin_exec.c
sys/compat/darwin/darwin_exec.h
sys/compat/darwin/darwin_mman.c
sys/compat/darwin/darwin_sysctl.c
sys/compat/darwin/darwin_sysctl.h
sys/compat/freebsd/freebsd_exec.h
sys/compat/freebsd/freebsd_exec_aout.c
sys/compat/freebsd/freebsd_exec_elf32.c
sys/compat/freebsd/freebsd_file.c
sys/compat/freebsd/freebsd_ioctl.c
sys/compat/freebsd/freebsd_misc.c
sys/compat/hpux/hpux_compat.c
sys/compat/hpux/hpux_exec.c
sys/compat/hpux/hpux_exec.h
sys/compat/hpux/hpux_exec_aout.c
sys/compat/hpux/hpux_file.c
sys/compat/hpux/hpux_net.c
sys/compat/hpux/hpux_tty.c
sys/compat/ibcs2/ibcs2_exec.h
sys/compat/ibcs2/ibcs2_exec_coff.c
sys/compat/ibcs2/ibcs2_exec_elf32.c
sys/compat/ibcs2/ibcs2_exec_xout.c
sys/compat/ibcs2/ibcs2_fcntl.c
sys/compat/ibcs2/ibcs2_ioctl.c
sys/compat/ibcs2/ibcs2_misc.c
sys/compat/ibcs2/ibcs2_stat.c
sys/compat/irix/irix_dirent.c
sys/compat/irix/irix_exec.h
sys/compat/irix/irix_exec_elf32.c
sys/compat/irix/irix_mount.c
sys/compat/irix/irix_stat.c
sys/compat/linux/arch/alpha/linux_machdep.c
sys/compat/linux/arch/i386/linux_machdep.c
sys/compat/linux/arch/m68k/linux_machdep.c
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c
sys/compat/linux/arch/powerpc/linux_machdep.c
sys/compat/linux/common/linux_blkio.c
sys/compat/linux/common/linux_cdrom.c
sys/compat/linux/common/linux_exec.c
sys/compat/linux/common/linux_exec.h
sys/compat/linux/common/linux_exec_aout.c
sys/compat/linux/common/linux_exec_elf32.c
sys/compat/linux/common/linux_fdio.c
sys/compat/linux/common/linux_file.c
sys/compat/linux/common/linux_file64.c
sys/compat/linux/common/linux_hdio.c
sys/compat/linux/common/linux_ioctl.c
sys/compat/linux/common/linux_ioctl.h
sys/compat/linux/common/linux_misc.c
sys/compat/linux/common/linux_misc_notalpha.c
sys/compat/linux/common/linux_socket.c
sys/compat/linux/common/linux_sysctl.c
sys/compat/linux/common/linux_termios.c
sys/compat/linux/common/linux_uselib.c
sys/compat/m68k4k/m68k4k_exec.c
sys/compat/m68k4k/m68k4k_exec.h
sys/compat/mach/mach_exec.c
sys/compat/mach/mach_exec.h
sys/compat/mach/mach_message.c
sys/compat/mach/mach_vm.c
sys/compat/netbsd32/netbsd32_compat_09.c
sys/compat/netbsd32/netbsd32_compat_12.c
sys/compat/netbsd32/netbsd32_compat_43.c
sys/compat/netbsd32/netbsd32_core.c
sys/compat/netbsd32/netbsd32_exec.h
sys/compat/netbsd32/netbsd32_exec_aout.c
sys/compat/netbsd32/netbsd32_exec_elf32.c
sys/compat/netbsd32/netbsd32_execve.c
sys/compat/netbsd32/netbsd32_fs.c
sys/compat/netbsd32/netbsd32_ioctl.c
sys/compat/netbsd32/netbsd32_ioctl.h
sys/compat/netbsd32/netbsd32_netbsd.c
sys/compat/netbsd32/netbsd32_socket.c
sys/compat/netbsd32/netbsd32_sysctl.c
sys/compat/osf1/osf1_descrip.c
sys/compat/osf1/osf1_exec.h
sys/compat/osf1/osf1_exec_ecoff.c
sys/compat/osf1/osf1_file.c
sys/compat/osf1/osf1_mount.c
sys/compat/ossaudio/ossaudio.c
sys/compat/ossaudio/ossaudio.h
sys/compat/pecoff/pecoff_exec.c
sys/compat/pecoff/pecoff_exec.h
sys/compat/pecoff/pecoff_misc.c
sys/compat/sunos/sunos_exec.h
sys/compat/sunos/sunos_exec_aout.c
sys/compat/sunos/sunos_ioctl.c
sys/compat/sunos/sunos_misc.c
sys/compat/sunos32/sunos32.h
sys/compat/sunos32/sunos32_exec.h
sys/compat/sunos32/sunos32_exec_aout.c
sys/compat/sunos32/sunos32_ioctl.c
sys/compat/sunos32/sunos32_misc.c
sys/compat/svr4/svr4_exec.h
sys/compat/svr4/svr4_exec_elf32.c
sys/compat/svr4/svr4_exec_elf64.c
sys/compat/svr4/svr4_fcntl.c
sys/compat/svr4/svr4_filio.c
sys/compat/svr4/svr4_misc.c
sys/compat/svr4/svr4_net.c
sys/compat/svr4/svr4_sockio.c
sys/compat/svr4/svr4_stat.c
sys/compat/svr4/svr4_stream.c
sys/compat/svr4/svr4_termios.c
sys/compat/svr4/svr4_ttold.c
sys/compat/svr4_32/svr4_32_exec.h
sys/compat/svr4_32/svr4_32_exec_elf32.c
sys/compat/svr4_32/svr4_32_fcntl.c
sys/compat/svr4_32/svr4_32_filio.c
sys/compat/svr4_32/svr4_32_misc.c
sys/compat/svr4_32/svr4_32_net.c
sys/compat/svr4_32/svr4_32_sockio.c
sys/compat/svr4_32/svr4_32_stat.c
sys/compat/svr4_32/svr4_32_stream.c
sys/compat/svr4_32/svr4_32_termios.c
sys/compat/ultrix/ultrix_exec.h
sys/compat/ultrix/ultrix_exec_ecoff.c
sys/compat/ultrix/ultrix_fs.c
sys/compat/ultrix/ultrix_ioctl.c
sys/compat/ultrix/ultrix_misc.c
sys/compat/ultrix/ultrix_pathname.c
sys/compat/vax1k/vax1k_exec.c
sys/compat/vax1k/vax1k_exec.h
sys/conf/osrelease.sh
sys/ddb/db_variables.c
sys/ddb/db_xxx.c
sys/ddb/ddbvar.h
sys/dev/acpi/acpica/Osd/OsdSchedule.c
sys/dev/ata/ld_ataraid.c
sys/dev/ata/wd.c
sys/dev/audio.c
sys/dev/audio_if.h
sys/dev/ccd.c
sys/dev/cgd.c
sys/dev/clockctl.c
sys/dev/cons.c
sys/dev/dksubr.c
sys/dev/dkvar.h
sys/dev/dmover/dmover_io.c
sys/dev/hpc/biconsdev.c
sys/dev/hpc/hpcfb.c
sys/dev/i2o/dpti.c
sys/dev/i2o/iop.c
sys/dev/ic/com.c
sys/dev/ic/cy.c
sys/dev/ic/dpt.c
sys/dev/ic/icp_ioctl.c
sys/dev/ic/joy.c
sys/dev/ic/lancevar.h
sys/dev/ic/lpt.c
sys/dev/ic/mlx.c
sys/dev/ic/rrunner.c
sys/dev/ic/vga.c
sys/dev/ic/vgavar.h
sys/dev/ic/z8530tty.c
sys/dev/ieee1394/fwohci.c
sys/dev/ieee1394/ieee1394var.h
sys/dev/ieee1394/sbp2.c
sys/dev/ir/cirvar.h
sys/dev/ir/irframe.c
sys/dev/ir/irframe_tty.c
sys/dev/ir/irframevar.h
sys/dev/isa/fd.c
sys/dev/isa/mcd.c
sys/dev/isa/pcdisplay.c
sys/dev/isa/spkr.c
sys/dev/kttcp.c
sys/dev/ld.c
sys/dev/mca/ed_mca.c
sys/dev/md.c
sys/dev/midi.c
sys/dev/midi_if.h
sys/dev/midisyn.c
sys/dev/midisynvar.h
sys/dev/mm.c
sys/dev/ofw/openfirmio.c
sys/dev/pci/agp.c
sys/dev/pci/bktr/bktr_core.c
sys/dev/pci/bktr/bktr_core.h
sys/dev/pci/bktr/bktr_os.c
sys/dev/pci/cz.c
sys/dev/pci/if_wi_pci.c
sys/dev/pci/machfb.c
sys/dev/pci/mly.c
sys/dev/pci/oboe.c
sys/dev/pci/pci_subr.c
sys/dev/pci/pci_usrreq.c
sys/dev/pci/pcivar.h
sys/dev/pci/tga.c
sys/dev/pci/twe.c
sys/dev/pci/vga_pci.c
sys/dev/radio.c
sys/dev/raidframe/rf_copyback.c
sys/dev/raidframe/rf_disks.c
sys/dev/raidframe/rf_kintf.h
sys/dev/raidframe/rf_netbsdkintf.c
sys/dev/raidframe/rf_reconstruct.c
sys/dev/rnd.c
sys/dev/sbus/bpp.c
sys/dev/sbus/magma.c
sys/dev/sbus/p9100.c
sys/dev/sbus/tcx.c
sys/dev/sbus/zx.c
sys/dev/scsipi/cd.c
sys/dev/scsipi/ch.c
sys/dev/scsipi/scsiconf.c
sys/dev/scsipi/scsipi_ioctl.c
sys/dev/scsipi/scsipiconf.h
sys/dev/scsipi/sd.c
sys/dev/scsipi/ses.c
sys/dev/scsipi/ss.c
sys/dev/scsipi/st.c
sys/dev/scsipi/uk.c
sys/dev/sequencer.c
sys/dev/sun/bwtwo.c
sys/dev/sun/cgsix.c
sys/dev/sun/cgthree.c
sys/dev/sun/event.c
sys/dev/sun/event_var.h
sys/dev/sun/fb.c
sys/dev/sun/fbvar.h
sys/dev/sun/kbd.c
sys/dev/sun/ms.c
sys/dev/sun/sunkbd.c
sys/dev/sun/sunms.c
sys/dev/sysmon/sysmon.c
sys/dev/sysmon/sysmon_envsys.c
sys/dev/sysmon/sysmon_power.c
sys/dev/sysmon/sysmon_wdog.c
sys/dev/sysmon/sysmonvar.h
sys/dev/tc/cfb.c
sys/dev/tc/mfb.c
sys/dev/tc/px.c
sys/dev/tc/pxg.c
sys/dev/tc/sfb.c
sys/dev/tc/stic.c
sys/dev/tc/sticvar.h
sys/dev/tc/tfb.c
sys/dev/usb/ubtbcmfw.c
sys/dev/usb/ucom.c
sys/dev/usb/ugen.c
sys/dev/usb/uhid.c
sys/dev/usb/uirda.c
sys/dev/usb/ulpt.c
sys/dev/usb/urio.c
sys/dev/usb/usb.c
sys/dev/usb/uscanner.c
sys/dev/usb/ustir.c
sys/dev/verified_exec.c
sys/dev/vme/xd.c
sys/dev/vme/xy.c
sys/dev/vnd.c
sys/dev/wscons/wsdisplay.c
sys/dev/wscons/wsdisplay_compat_usl.c
sys/dev/wscons/wsdisplayvar.h
sys/dev/wscons/wsevent.c
sys/dev/wscons/wseventvar.h
sys/dev/wscons/wskbd.c
sys/dev/wscons/wsmouse.c
sys/dev/wscons/wsmux.c
sys/dev/wscons/wsmuxvar.h
sys/dev/wsfont/wsfontdev.c
sys/fs/adosfs/adlookup.c
sys/fs/adosfs/advfsops.c
sys/fs/adosfs/advnops.c
sys/fs/cd9660/cd9660_extern.h
sys/fs/cd9660/cd9660_lookup.c
sys/fs/cd9660/cd9660_node.c
sys/fs/cd9660/cd9660_node.h
sys/fs/cd9660/cd9660_vfsops.c
sys/fs/cd9660/cd9660_vnops.c
sys/fs/filecorefs/filecore_extern.h
sys/fs/filecorefs/filecore_lookup.c
sys/fs/filecorefs/filecore_vfsops.c
sys/fs/msdosfs/denode.h
sys/fs/msdosfs/msdosfs_denode.c
sys/fs/msdosfs/msdosfs_lookup.c
sys/fs/msdosfs/msdosfs_vfsops.c
sys/fs/msdosfs/msdosfs_vnops.c
sys/fs/ntfs/ntfs.h
sys/fs/ntfs/ntfs_subr.c
sys/fs/ntfs/ntfs_vfsops.c
sys/fs/ntfs/ntfs_vfsops.h
sys/fs/ntfs/ntfs_vnops.c
sys/fs/smbfs/smbfs.h
sys/fs/smbfs/smbfs_io.c
sys/fs/smbfs/smbfs_kq.c
sys/fs/smbfs/smbfs_node.c
sys/fs/smbfs/smbfs_vfsops.c
sys/fs/smbfs/smbfs_vnops.c
sys/fs/union/union.h
sys/fs/union/union_subr.c
sys/fs/union/union_vfsops.c
sys/fs/union/union_vnops.c
sys/kern/core_elf32.c
sys/kern/core_netbsd.c
sys/kern/exec_aout.c
sys/kern/exec_conf.c
sys/kern/exec_ecoff.c
sys/kern/exec_elf32.c
sys/kern/exec_macho.c
sys/kern/exec_script.c
sys/kern/exec_subr.c
sys/kern/init_main.c
sys/kern/kern_acct.c
sys/kern/kern_descrip.c
sys/kern/kern_event.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_ksyms.c
sys/kern/kern_ktrace.c
sys/kern/kern_lkm.c
sys/kern/kern_sig.c
sys/kern/kern_subr.c
sys/kern/kern_synch.c
sys/kern/kern_sysctl.c
sys/kern/kern_systrace.c
sys/kern/subr_log.c
sys/kern/sys_generic.c
sys/kern/sys_pipe.c
sys/kern/sys_process.c
sys/kern/sys_socket.c
sys/kern/sysv_sem.c
sys/kern/tty.c
sys/kern/tty_conf.c
sys/kern/tty_pty.c
sys/kern/tty_tty.c
sys/kern/uipc_domain.c
sys/kern/uipc_sem.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/kern/uipc_syscalls.c
sys/kern/uipc_usrreq.c
sys/kern/vfs_cache.c
sys/kern/vfs_getcwd.c
sys/kern/vfs_lookup.c
sys/kern/vfs_subr.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/kern/vnode_if.c
sys/kern/vnode_if.sh
sys/kern/vnode_if.src
sys/lkm/netinet/if_ipl/mln_ipl.c
sys/miscfs/fdesc/fdesc.h
sys/miscfs/fdesc/fdesc_vfsops.c
sys/miscfs/fdesc/fdesc_vnops.c
sys/miscfs/fifofs/fifo_vnops.c
sys/miscfs/genfs/genfs_vnops.c
sys/miscfs/genfs/layer_extern.h
sys/miscfs/genfs/layer_subr.c
sys/miscfs/genfs/layer_vfsops.c
sys/miscfs/kernfs/kernfs_vfsops.c
sys/miscfs/kernfs/kernfs_vnops.c
sys/miscfs/nullfs/null_vfsops.c
sys/miscfs/overlay/overlay_vfsops.c
sys/miscfs/portal/portal_vfsops.c
sys/miscfs/portal/portal_vnops.c
sys/miscfs/procfs/procfs.h
sys/miscfs/procfs/procfs_cmdline.c
sys/miscfs/procfs/procfs_ctl.c
sys/miscfs/procfs/procfs_fd.c
sys/miscfs/procfs/procfs_fpregs.c
sys/miscfs/procfs/procfs_linux.c
sys/miscfs/procfs/procfs_map.c
sys/miscfs/procfs/procfs_mem.c
sys/miscfs/procfs/procfs_note.c
sys/miscfs/procfs/procfs_regs.c
sys/miscfs/procfs/procfs_status.c
sys/miscfs/procfs/procfs_subr.c
sys/miscfs/procfs/procfs_vfsops.c
sys/miscfs/procfs/procfs_vnops.c
sys/miscfs/specfs/spec_vnops.c
sys/miscfs/syncfs/sync_subr.c
sys/miscfs/syncfs/sync_vnops.c
sys/miscfs/umapfs/umap_vfsops.c
sys/net/bpf.c
sys/net/if.c
sys/net/if.h
sys/net/if_tun.c
sys/net/raw_cb.h
sys/net/raw_usrreq.c
sys/net/route.c
sys/net/route.h
sys/net/rtsock.c
sys/netatalk/at_extern.h
sys/netatalk/ddp_usrreq.c
sys/netccitt/pk_acct.c
sys/netccitt/pk_extern.h
sys/netccitt/pk_usrreq.c
sys/netinet/ip_fil.c
sys/netinet/ip_fil.h
sys/netinet/ip_var.h
sys/netinet/raw_ip.c
sys/netinet/tcp_input.c
sys/netinet/tcp_output.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_usrreq.c
sys/netinet/tcp_var.h
sys/netinet/udp_usrreq.c
sys/netinet/udp_var.h
sys/netinet6/ip6_var.h
sys/netinet6/ip6protosw.h
sys/netinet6/raw_ip6.c
sys/netinet6/udp6_usrreq.c
sys/netinet6/udp6_var.h
sys/netiso/clnp.h
sys/netiso/clnp_raw.c
sys/netiso/cltp_usrreq.c
sys/netiso/cltp_var.h
sys/netiso/esis.c
sys/netiso/esis.h
sys/netiso/idrp_usrreq.c
sys/netiso/idrp_var.h
sys/netiso/iso.c
sys/netiso/iso_snpac.c
sys/netiso/iso_var.h
sys/netiso/tp_usrreq.c
sys/netiso/tp_var.h
sys/netkey/keysock.c
sys/netkey/keysock.h
sys/netnatm/natm.c
sys/netnatm/natm.h
sys/netns/idp_usrreq.c
sys/netns/idp_var.h
sys/netns/spp_usrreq.c
sys/netns/spp_var.h
sys/netsmb/smb_conn.h
sys/netsmb/smb_dev.c
sys/netsmb/smb_iod.c
sys/netsmb/smb_rq.c
sys/netsmb/smb_smb.c
sys/netsmb/smb_subr.c
sys/netsmb/smb_subr.h
sys/netsmb/smb_tran.h
sys/netsmb/smb_trantcp.c
sys/nfs/nfs.h
sys/nfs/nfs_bio.c
sys/nfs/nfs_boot.c
sys/nfs/nfs_bootdhcp.c
sys/nfs/nfs_bootparam.c
sys/nfs/nfs_kq.c
sys/nfs/nfs_node.c
sys/nfs/nfs_nqlease.c
sys/nfs/nfs_serv.c
sys/nfs/nfs_socket.c
sys/nfs/nfs_subs.c
sys/nfs/nfs_syscalls.c
sys/nfs/nfs_var.h
sys/nfs/nfs_vfsops.c
sys/nfs/nfs_vnops.c
sys/nfs/nfsdiskless.h
sys/nfs/nfsm_subs.h
sys/nfs/nfsmount.h
sys/nfs/nqnfs.h
sys/sys/acct.h
sys/sys/clockctl.h
sys/sys/conf.h
sys/sys/event.h
sys/sys/exec.h
sys/sys/exec_aout.h
sys/sys/exec_coff.h
sys/sys/exec_ecoff.h
sys/sys/exec_elf.h
sys/sys/exec_macho.h
sys/sys/exec_script.h
sys/sys/file.h
sys/sys/filedesc.h
sys/sys/ktrace.h
sys/sys/mount.h
sys/sys/namei.h
sys/sys/param.h
sys/sys/proc.h
sys/sys/protosw.h
sys/sys/ptrace.h
sys/sys/select.h
sys/sys/sem.h
sys/sys/socketvar.h
sys/sys/sysctl.h
sys/sys/systm.h
sys/sys/tty.h
sys/sys/uio.h
sys/sys/un.h
sys/sys/verified_exec.h
sys/sys/vnode.h
sys/sys/vnode_if.h
sys/ufs/ext2fs/ext2fs_alloc.c
sys/ufs/ext2fs/ext2fs_extern.h
sys/ufs/ext2fs/ext2fs_inode.c
sys/ufs/ext2fs/ext2fs_lookup.c
sys/ufs/ext2fs/ext2fs_readwrite.c
sys/ufs/ext2fs/ext2fs_vfsops.c
sys/ufs/ext2fs/ext2fs_vnops.c
sys/ufs/ffs/ffs_alloc.c
sys/ufs/ffs/ffs_extern.h
sys/ufs/ffs/ffs_inode.c
sys/ufs/ffs/ffs_softdep.c
sys/ufs/ffs/ffs_softdep.stub.c
sys/ufs/ffs/ffs_vfsops.c
sys/ufs/ffs/ffs_vnops.c
sys/ufs/lfs/lfs_alloc.c
sys/ufs/lfs/lfs_extern.h
sys/ufs/lfs/lfs_inode.c
sys/ufs/lfs/lfs_segment.c
sys/ufs/lfs/lfs_syscalls.c
sys/ufs/lfs/lfs_vfsops.c
sys/ufs/lfs/lfs_vnops.c
sys/ufs/mfs/mfs_extern.h
sys/ufs/mfs/mfs_vfsops.c
sys/ufs/mfs/mfs_vnops.c
sys/ufs/ufs/quota.h
sys/ufs/ufs/ufs_extern.h
sys/ufs/ufs/ufs_ihash.c
sys/ufs/ufs/ufs_inode.c
sys/ufs/ufs/ufs_lookup.c
sys/ufs/ufs/ufs_quota.c
sys/ufs/ufs/ufs_readwrite.c
sys/ufs/ufs/ufs_vfsops.c
sys/ufs/ufs/ufs_vnops.c
sys/uvm/uvm_extern.h
sys/uvm/uvm_glue.c
sys/uvm/uvm_meter.c
sys/uvm/uvm_mmap.c
sys/uvm/uvm_swap.c
sys/uvm/uvm_vnode.c
--- a/sys/altq/altq_conf.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/altq/altq_conf.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_conf.h,v 1.5 2003/06/28 14:20:43 darrenr Exp $	*/
+/*	$NetBSD: altq_conf.h,v 1.6 2003/06/29 22:28:00 fvdl Exp $	*/
 /*	$KAME: altq_conf.h,v 1.6 2001/01/29 19:59:09 itojun Exp $	*/
 
 /*
@@ -52,9 +52,9 @@
 #endif
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
-typedef int d_open_t __P((dev_t, int, int, struct lwp *));
-typedef int d_close_t __P((dev_t, int, int, struct lwp *));
-typedef int d_ioctl_t __P((dev_t, u_long, caddr_t, int, struct lwp *));
+typedef int d_open_t __P((dev_t, int, int, struct proc *));
+typedef int d_close_t __P((dev_t, int, int, struct proc *));
+typedef int d_ioctl_t __P((dev_t, u_long, caddr_t, int, struct proc *));
 #endif /* __NetBSD__ || __OpenBSD__ */
 
 #if defined(__OpenBSD__)
@@ -62,9 +62,9 @@
 #define	noclose	(dev_type_close((*))) enodev
 #define	noioctl	(dev_type_ioctl((*))) enodev
 
-int altqopen __P((dev_t, int, int, struct lwp *));
-int altqclose __P((dev_t, int, int, struct lwp *));
-int altqioctl __P((dev_t, u_long, caddr_t, int, struct lwp *));
+int altqopen __P((dev_t, int, int, struct proc *));
+int altqclose __P((dev_t, int, int, struct proc *));
+int altqioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
 #endif
 
 /*
--- a/sys/arch/algor/algor/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/algor/algor/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.8 2003/06/28 14:20:44 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.9 2003/06/29 22:28:01 fvdl 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.8 2003/06/28 14:20:44 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.9 2003/06/29 22:28:01 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -332,7 +332,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: "
--- a/sys/arch/alpha/alpha/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/alpha/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.269 2003/06/29 15:14:12 simonb Exp $ */
+/* $NetBSD: machdep.c,v 1.270 2003/06/29 22:28:01 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.269 2003/06/29 15:14:12 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.270 2003/06/29 22:28:01 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1753,14 +1753,14 @@
  * machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	dev_t consdev;
 
@@ -2009,8 +2009,8 @@
  *
  */
 int
-cpu_exec_ecoff_probe(l, epp)
-	struct lwp *l;
+cpu_exec_ecoff_probe(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	struct ecoff_exechdr *execp = (struct ecoff_exechdr *)epp->ep_hdr;
--- a/sys/arch/alpha/alpha/promcons.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/alpha/promcons.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: promcons.c,v 1.23 2003/06/29 15:17:40 simonb Exp $ */
+/* $NetBSD: promcons.c,v 1.24 2003/06/29 22:28:03 fvdl Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.23 2003/06/29 15:17:40 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.24 2003/06/29 22:28:03 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -79,7 +79,7 @@
 struct callout prom_ch = CALLOUT_INITIALIZER;
 
 int
-promopen(dev_t dev, int flag, int mode, struct lwp *l)
+promopen(dev_t dev, int flag, int mode, struct proc *p)
 {
 	int unit = minor(dev);
 	struct tty *tp;
@@ -111,7 +111,7 @@
 		ttsetwater(tp);
 
 		setuptimeout = 1;
-	} else if (tp->t_state&TS_XCLUDE && l->l_proc->p_ucred->cr_uid != 0) {
+	} else if (tp->t_state&TS_XCLUDE && p->p_ucred->cr_uid != 0) {
 		splx(s);
 		return EBUSY;
 	}
@@ -129,7 +129,7 @@
 }
  
 int
-promclose(dev_t dev, int flag, int mode, struct lwp *l)
+promclose(dev_t dev, int flag, int mode, struct proc *p)
 {
 	int unit = minor(dev);
 	struct tty *tp = prom_tty[unit];
@@ -157,24 +157,24 @@
 }
  
 int
-prompoll(dev_t dev, int events, struct lwp *l)
+prompoll(dev_t dev, int events, struct proc *p)
 {
 	struct tty *tp = prom_tty[minor(dev)];
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
-promioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
+promioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
 	int unit = minor(dev);
 	struct tty *tp = prom_tty[unit];
 	int error;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
-	return ttioctl(tp, cmd, data, flag, l);
+	return ttioctl(tp, cmd, data, flag, p);
 }
 
 int
--- a/sys/arch/alpha/alpha/syscall.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/alpha/syscall.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.8 2003/06/28 14:20:45 darrenr Exp $ */
+/* $NetBSD: syscall.c,v 1.9 2003/06/29 22:28:04 fvdl Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.8 2003/06/28 14:20:45 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.9 2003/06/29 22:28:04 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -366,7 +366,7 @@
 #ifdef KTRACE
 	if (KTRPOINT(p, KTR_SYSRET)) {
 		KERNEL_PROC_LOCK(l);
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(p, SYS_fork, 0, 0);
 		KERNEL_PROC_UNLOCK(l);
 	}
 #endif
--- a/sys/arch/alpha/alpha/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/alpha/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.79 2003/06/29 15:14:13 simonb Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.80 2003/06/29 22:28:04 fvdl Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.79 2003/06/29 15:14:13 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.80 2003/06/29 22:28:04 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -58,6 +58,7 @@
 	int error;
 	struct md_coredump cpustate;
 	struct coreseg cseg;
+	struct proc *p = l->l_proc;
 
 	CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
 	chdr->c_hdrsize = ALIGN(sizeof(*chdr));
@@ -79,13 +80,13 @@
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cpustate, sizeof(cpustate),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 
 	if (!error)
 		chdr->c_nseg++;
--- a/sys/arch/alpha/common/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/common/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.54 2003/06/28 14:20:45 darrenr Exp $ */
+/* $NetBSD: bus_dma.c,v 1.55 2003/06/29 22:28:04 fvdl 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.54 2003/06/28 14:20:45 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.55 2003/06/29 22:28:04 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -372,7 +372,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio_direct: "
--- a/sys/arch/alpha/common/sgmap_typedep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/common/sgmap_typedep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap_typedep.c,v 1.26 2003/06/28 14:20:45 darrenr Exp $ */
+/* $NetBSD: sgmap_typedep.c,v 1.27 2003/06/29 22:28:05 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-__KERNEL_RCSID(0, "$NetBSD: sgmap_typedep.c,v 1.26 2003/06/28 14:20:45 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgmap_typedep.c,v 1.27 2003/06/29 22:28:05 fvdl Exp $");
 
 #include "opt_ddb.h"
 
@@ -326,7 +326,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic(__S(__C(SGMAP_TYPE,_load_uio))
--- a/sys/arch/alpha/include/pcb.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/alpha/include/pcb.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcb.h,v 1.11 2003/06/29 18:11:14 martin Exp $ */
+/* $NetBSD: pcb.h,v 1.12 2003/06/29 22:28:05 fvdl Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
--- a/sys/arch/amiga/amiga/amiga_init.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/amiga/amiga/amiga_init.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: amiga_init.c,v 1.86 2003/06/29 18:41:47 aymeric Exp $	*/
+/*	$NetBSD: amiga_init.c,v 1.87 2003/06/29 22:28:06 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -36,7 +36,7 @@
 #include "opt_devreload.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.86 2003/06/29 18:41:47 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.87 2003/06/29 22:28:06 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
--- a/sys/arch/amiga/amiga/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/amiga/amiga/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.183 2003/06/28 14:20:46 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.184 2003/06/29 22:28:06 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -50,7 +50,7 @@
 #include "opt_panicbutton.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.183 2003/06/28 14:20:46 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.184 2003/06/29 22:28:06 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1603,8 +1603,8 @@
  * MID and proceed to new zmagic code ;-)
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	int error = ENOEXEC;
@@ -1615,7 +1615,7 @@
 #ifdef COMPAT_NOMID
 	if (!((execp->a_midmag >> 16) & 0x0fff)
 	    && execp->a_midmag == ZMAGIC)
-		return(exec_aout_prep_zmagic(l->l_proc, epp));
+		return(exec_aout_prep_zmagic(p, epp));
 #endif
 	return(error);
 }
--- a/sys/arch/arc/arc/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arc/arc/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.15 2003/06/28 14:20:47 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.16 2003/06/29 22:28:07 fvdl Exp $	*/
 /*	NetBSD: bus_dma.c,v 1.20 2000/01/10 03:24:36 simonb Exp 	*/
 
 /*-
@@ -360,7 +360,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/arc/jazz/bus_dma_jazz.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arc/jazz/bus_dma_jazz.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma_jazz.c,v 1.6 2003/06/28 14:20:47 darrenr Exp $	*/
+/*	$NetBSD: bus_dma_jazz.c,v 1.7 2003/06/29 22:28:08 fvdl Exp $	*/
 
 /*-
  * Copyright (C) 2003 Izumi Tsutsui.
@@ -290,8 +290,8 @@
 	if (error == 0) {
 		error = jazz_bus_dmamap_alloc_sgmap(t, map->dm_segs,
 		    map->dm_nsegs, map->_dm_boundary,
-		    uio->uio_segflg == UIO_USERSPACE ? uio->uio_lwp->l_proc :
-		    NULL, flags);
+		    uio->uio_segflg == UIO_USERSPACE ? uio->uio_procp : NULL,
+		    flags);
 	}
 	return (error);
 }
--- a/sys/arch/arm/arm/syscall.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/arm/syscall.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.17 2003/06/28 14:20:47 darrenr Exp $	*/
+/*	$NetBSD: syscall.c,v 1.18 2003/06/29 22:28:08 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.17 2003/06/28 14:20:47 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.18 2003/06/29 22:28:08 fvdl Exp $");
 
 #include <sys/device.h>
 #include <sys/errno.h>
@@ -454,7 +454,7 @@
 #ifdef KTRACE
 	if (KTRPOINT(p, KTR_SYSRET)) {
 		KERNEL_PROC_LOCK(p);
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(p, SYS_fork, 0, 0);
 		KERNEL_PROC_UNLOCK(p);
 	}
 #endif
--- a/sys/arch/arm/arm/vm_machdep_arm.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/arm/vm_machdep_arm.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep_arm.c,v 1.6 2003/06/29 10:51:29 ichiro Exp $	*/
+/*	$NetBSD: vm_machdep_arm.c,v 1.7 2003/06/29 22:28:08 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -37,7 +37,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep_arm.c,v 1.6 2003/06/29 10:51:29 ichiro Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep_arm.c,v 1.7 2003/06/29 22:28:08 fvdl Exp $");
 
 #include <sys/core.h>
 #include <sys/exec.h>
@@ -58,6 +58,7 @@
 cpu_coredump(struct lwp *l, struct vnode *vp, struct ucred *cred,
     struct core *chdr)
 {
+	struct proc *p = l->l_proc;
 	int error;
 	struct {
 		struct reg regs;
@@ -85,13 +86,13 @@
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cpustate, sizeof(cpustate),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
--- a/sys/arch/arm/arm32/arm32_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_machdep.c,v 1.35 2003/06/29 10:51:30 ichiro Exp $	*/
+/*	$NetBSD: arm32_machdep.c,v 1.36 2003/06/29 22:28:08 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -349,14 +349,14 @@
  */
 
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	/* all sysctl names at this level are terminal */
 	if (namelen != 1)
--- a/sys/arch/arm/arm32/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.31 2003/06/28 14:20:48 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.32 2003/06/29 22:28:09 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -336,7 +336,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/arm/footbridge/footbridge_com.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/footbridge/footbridge_com.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: footbridge_com.c,v 1.14 2003/06/29 14:51:04 chris Exp $	*/
+/*	$NetBSD: footbridge_com.c,v 1.15 2003/06/29 22:28:09 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1997 Mark Brinicombe
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.14 2003/06/29 14:51:04 chris Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.15 2003/06/29 22:28:09 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
@@ -226,13 +226,12 @@
 static int fcomparam __P((struct tty *, struct termios *));
 
 int
-fcomopen(dev, flag, mode, l)
+fcomopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fcom_softc *sc;
-	struct proc *p = l->l_proc;
 	int unit = minor(dev);
 	struct tty *tp;
 
@@ -283,10 +282,10 @@
 }
 
 int
-fcomclose(dev, flag, mode, l)
+fcomclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
 	struct tty *tp = sc->sc_tty;
@@ -333,34 +332,33 @@
 }
 
 int
-fcompoll(dev, events, l)
+fcompoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
 	struct tty *tp = sc->sc_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
-fcomioctl(dev, cmd, data, flag, l)
+fcomioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
 	struct tty *tp = sc->sc_tty;
-	struct proc *p = l->l_proc;
 	int error;
 	
-	if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l)) !=
+	if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p)) !=
 	    EPASSTHROUGH)
 		return error;
-	if ((error = ttioctl(tp, cmd, data, flag, l)) != EPASSTHROUGH)
+	if ((error = ttioctl(tp, cmd, data, flag, p)) != EPASSTHROUGH)
 		return error;
 
 	switch (cmd) {
--- a/sys/arch/arm/ixp12x0/ixp12x0_com.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_com.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp12x0_com.c,v 1.17 2003/06/29 11:10:35 ichiro Exp $ */
+/*	$NetBSD: ixp12x0_com.c,v 1.18 2003/06/29 22:28:10 fvdl Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.17 2003/06/29 11:10:35 ichiro Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.18 2003/06/29 22:28:10 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -485,10 +485,10 @@
 }
 
 int
-ixpcomopen(dev, flag, mode, l)
+ixpcomopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ixpcom_softc *sc;
 	struct tty *tp;
@@ -515,7 +515,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-		l->l_proc->p_ucred->cr_uid != 0)
+		p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -633,10 +633,10 @@
 }
 
 int
-ixpcomclose(dev, flag, mode, l)
+ixpcomclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ixpcom_softc *sc = device_lookup(&ixpcom_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -694,10 +694,10 @@
 }
 
 int
-ixpcompoll(dev, events, l)
+ixpcompoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ixpcom_softc *sc = device_lookup(&ixpcom_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -705,7 +705,7 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -719,7 +719,7 @@
 }
 
 int
-ixpcomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
+ixpcomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
 	struct ixpcom_softc *sc = device_lookup(&ixpcom_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -729,11 +729,11 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -756,7 +756,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag); 
+		error = suser(p->p_ucred, &p->p_acflag); 
 		if (error)
 			break;
 		sc->sc_swflags = *(int *)data;
--- a/sys/arch/arm/s3c2xx0/sscom.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/s3c2xx0/sscom.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: sscom.c,v 1.6 2003/06/29 11:10:37 ichiro Exp $ */
+/*	$NetBSD: sscom.c,v 1.7 2003/06/29 22:28:10 fvdl Exp $ */
 
 /*
  * Copyright (c) 2002 Fujitsu Component Limited
@@ -594,7 +594,7 @@
 }
 
 int
-sscomopen(dev_t dev, int flag, int mode, struct lwp *l)
+sscomopen(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct sscom_softc *sc;
 	struct tty *tp;
@@ -621,7 +621,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-		l->l_proc->p_ucred->cr_uid != 0)
+		p->p_ucred->cr_uid != 0)
 		return EBUSY;
 
 	s = spltty();
@@ -730,7 +730,7 @@
 }
  
 int
-sscomclose(dev_t dev, int flag, int mode, struct lwp *l)
+sscomclose(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct sscom_softc *sc = device_lookup(&sscom_cd, SSCOMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -782,7 +782,7 @@
 }
 
 int
-sscompoll(dev_t dev, int events, struct lwp *l)
+sscompoll(dev_t dev, int events, struct proc *p)
 {
 	struct sscom_softc *sc = device_lookup(&sscom_cd, SSCOMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -790,7 +790,7 @@
 	if (SSCOM_ISALIVE(sc) == 0)
 		return EIO;
  
-	return (*tp->t_linesw->l_poll)(tp, events, l);
+	return (*tp->t_linesw->l_poll)(tp, events, p);
 }
 
 struct tty *
@@ -803,7 +803,7 @@
 }
 
 int
-sscomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
+sscomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
 	struct sscom_softc *sc = device_lookup(&sscom_cd, SSCOMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -813,11 +813,11 @@
 	if (SSCOM_ISALIVE(sc) == 0)
 		return EIO;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
 
@@ -848,7 +848,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag); 
+		error = suser(p->p_ucred, &p->p_acflag); 
 		if (error)
 			break;
 		sc->sc_swflags = *(int *)data;
--- a/sys/arch/arm/sa11x0/sa11x0_com.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/sa11x0/sa11x0_com.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sa11x0_com.c,v 1.16 2003/06/29 11:10:37 ichiro Exp $        */
+/*      $NetBSD: sa11x0_com.c,v 1.17 2003/06/29 22:28:11 fvdl Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -526,10 +526,10 @@
 }
 
 int
-sacomopen(dev, flag, mode, l)
+sacomopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sacom_softc *sc;
 	struct tty *tp;
@@ -548,7 +548,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-		l->l_proc->p_ucred->cr_uid != 0)
+		p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -666,10 +666,10 @@
 }
  
 int
-sacomclose(dev, flag, mode, l)
+sacomclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sacom_softc *sc = device_lookup(&sacom_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -727,10 +727,10 @@
 }
 
 int
-sacompoll(dev, events, l)
+sacompoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sacom_softc *sc = device_lookup(&sacom_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -738,7 +738,7 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -752,12 +752,12 @@
 }
 
 int
-sacomioctl(dev, cmd, data, flag, l)
+sacomioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sacom_softc *sc = device_lookup(&sacom_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -767,11 +767,11 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -802,7 +802,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag); 
+		error = suser(p->p_ucred, &p->p_acflag); 
 		if (error)
 			break;
 		sc->sc_swflags = *(int *)data;
--- a/sys/arch/arm/xscale/ixp425_com.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/xscale/ixp425_com.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_com.c,v 1.9 2003/06/29 10:51:31 ichiro Exp $ */
+/*	$NetBSD: ixp425_com.c,v 1.10 2003/06/29 22:28:11 fvdl Exp $ */
 /*
  * Copyright (c) 2003
  *	Ichiro FUKUHARA <ichiro@ichiro.org>.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp425_com.c,v 1.9 2003/06/29 10:51:31 ichiro Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_com.c,v 1.10 2003/06/29 22:28:11 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -111,15 +111,13 @@
 static int	ixp4xx_com_to_tiocm(struct ixp4xx_com_softc *);
 
 static void	ixp4xx_com_set_cr(struct ixp4xx_com_softc *);
-static void	ixpcom_hwiflow(struct ixp4xx_com_softc *);
 
 static void	ixp4xxcomsoft(void *);
-static void	ixpcomdiag(void *);
 inline static void	ixp4xx_com_txsoft(struct ixp4xx_com_softc *, struct tty *);
 inline static void	ixp4xx_com_rxsoft(struct ixp4xx_com_softc *, struct tty *);
-inline static void	ixpcom_schedrx(struct ixp4xx_com_softc *);
 
 int		ixp4xx_cominit(bus_space_tag_t, bus_space_handle_t, int, int, tcflag_t);
+
 int             ixp4xx_comcngetc(dev_t);
 void            ixp4xx_comcnputc(dev_t, int);
 void            ixp4xx_comcnpollc(dev_t, int);
@@ -157,10 +155,6 @@
 	nommap, ttykqfilter, D_TTY
 };
 
-/* Stop input when 3/4 of the ring is full; restart when only 1/4 is full. */
-u_int	ixpcom_rbuf_hiwat = (IXPCOM_RING_SIZE * 1) / 4;
-u_int	ixpcom_rbuf_lowat = (IXPCOM_RING_SIZE * 3) / 4;
-
 #define COMUNIT_MASK    0x7ffff
 #define COMDIALOUT_MASK 0x80000
 
@@ -170,6 +164,8 @@
 #define COM_ISALIVE(sc) ((sc)->enabled != 0 && \
 			ISSET((sc)->sc_dev.dv_flags, DVF_ACTIVE))
 
+#define COM_BARRIER(t, h, f) bus_space_barrier((t), (h), 0, COM_NPORTS, (f))
+
 #define COM_LOCK(sc);
 #define COM_UNLOCK(sc);
 
@@ -234,8 +230,9 @@
 
 	ixp4xx_com_sc = sc;
 
+#if 0
 	callout_init(&sc->sc_diag_callout);
-
+#endif
 	/* configuring the device. */
 	sc->sc_frequency = FREQ;
 	sc->sc_dlbl = ixp4xx_comspeed(CONSPEED, sc->sc_frequency);
@@ -245,7 +242,7 @@
 	sc->sc_ier = IER_UUE;
 	bus_space_write_4(iot, ioh, IXP425_UART_IER, sc->sc_ier);
 
-	sc->sc_fcr = FCR_TRIGGER_32 | FCR_RESETTF | FCR_RESETRF | FCR_ENABLE;
+	sc->sc_fcr = FCR_TRIGGER_8 | FCR_RESETTF | FCR_RESETRF | FCR_ENABLE;
 	bus_space_write_4(iot, ioh, IXP425_UART_FCR, sc->sc_fcr);
 
 	if (iot == ixp4xx_comcn_sc.sc_iot
@@ -285,10 +282,6 @@
 
 	tty_attach(tp);
 
-	sc->sc_mcr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_MCR);
-	SET(sc->sc_mcr, MCR_IENABLE);
-	bus_space_write_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_MCR, sc->sc_mcr);
-
 	if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
 		int maj;
 
@@ -432,23 +425,6 @@
 			ixp4xx_com_set_cr(sc);
 	}
 
-	if (!ISSET(t->c_cflag, CHWFLOW)) {
-		/* Disable the high water mark. */
-		sc->sc_r_hiwat = 0;
-		sc->sc_r_lowat = 0;
-		if (ISSET(sc->sc_rx_flags, RX_TTY_OVERFLOWED)) {
-			CLR(sc->sc_rx_flags, RX_TTY_OVERFLOWED);
-			ixpcom_schedrx(sc);
-		}
-		if (ISSET(sc->sc_rx_flags, RX_TTY_BLOCKED|RX_IBUF_BLOCKED)) {
-			CLR(sc->sc_rx_flags, RX_TTY_BLOCKED|RX_IBUF_BLOCKED);
-			ixpcom_hwiflow(sc);
-		}
-	} else {
-		sc->sc_r_hiwat = ixpcom_rbuf_hiwat;
-		sc->sc_r_lowat = ixpcom_rbuf_lowat;
-	}
-
 	COM_UNLOCK(sc);
 	splx(s);
 
@@ -456,7 +432,7 @@
 	 * Update the tty layer's idea of the carrier bit.
 	 * We tell tty the carrier is always on.
 	 */
-	(void) (*tp->t_linesw->l_modem)(tp, ISSET(sc->sc_msr, MSR_DCD));
+	(void) (*tp->t_linesw->l_modem)(tp, 1);
 
 #ifdef COM_DEBUG
 	if (com_debug)
@@ -481,8 +457,6 @@
 
 	ixp4xx_com_iflush(sc);
 
-	bus_space_write_4(iot, ioh, IXP425_UART_IER, IER_UUE);
-
 	bus_space_write_4(iot, ioh, IXP425_UART_LCR, sc->sc_lcr | LCR_DLAB);
 	bus_space_write_4(iot, ioh, IXP425_UART_DLL, sc->sc_dlbl);
 	bus_space_write_4(iot, ioh, IXP425_UART_DLH, sc->sc_dlbh);
@@ -495,60 +469,7 @@
 static int
 ixp4xx_comhwiflow(struct tty *tp, int block)
 {
-	struct ixp4xx_com_softc *sc
-		= device_lookup(&ixpcom_cd, COMUNIT(tp->t_dev));
-        int s;
-
-        if (COM_ISALIVE(sc) == 0)
-                return (0);
-
-        if (sc->sc_mcr_rts == 0)
-                return (0);
-
-        s = splserial();
-        COM_LOCK(sc);
-
-        if (block) {
-                if (!ISSET(sc->sc_rx_flags, RX_TTY_BLOCKED)) {
-                        SET(sc->sc_rx_flags, RX_TTY_BLOCKED);
-                        ixpcom_hwiflow(sc);
-                }
-        } else {
-                if (ISSET(sc->sc_rx_flags, RX_TTY_OVERFLOWED)) {
-                        CLR(sc->sc_rx_flags, RX_TTY_OVERFLOWED);
-                        ixpcom_schedrx(sc);
-                }
-                if (ISSET(sc->sc_rx_flags, RX_TTY_BLOCKED)) {
-                        CLR(sc->sc_rx_flags, RX_TTY_BLOCKED);
-                        ixpcom_hwiflow(sc);
-                }
-        }
-
-        COM_UNLOCK(sc);
-        splx(s);
-        return (1);
-}
-
-/*
- * (un)block input via hw flowcontrol
- */
-void
-ixpcom_hwiflow(struct ixp4xx_com_softc *sc)
-{
-        bus_space_tag_t iot = sc->sc_iot;
-        bus_space_handle_t ioh = sc->sc_ioh;
-
-        if (sc->sc_mcr_rts == 0)
-                return;
-
-        if (ISSET(sc->sc_rx_flags, RX_ANY_BLOCK)) {
-                CLR(sc->sc_mcr, sc->sc_mcr_rts);
-                CLR(sc->sc_mcr_active, sc->sc_mcr_rts);
-        } else {
-                SET(sc->sc_mcr, sc->sc_mcr_rts);
-                SET(sc->sc_mcr_active, sc->sc_mcr_rts);
-        }
-	bus_space_write_4(iot, ioh, IXP425_UART_MCR, sc->sc_mcr_active);
+        return (0);
 }
 
 static void
@@ -567,9 +488,7 @@
 		n++;
 	}
 	sc->sc_tbc -= n;
-	sc->sc_tba += n;
 }
-	
 
 static void
 ixp4xx_comstart(struct tty *tp)
@@ -619,7 +538,7 @@
 	if (!ISSET(sc->sc_ier, IER_TIE)) {
 		SET(sc->sc_ier, IER_TIE);
 		bus_space_write_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_IER,
-			sc->sc_ier);
+			sc->sc_ier | IER_UUE);
 	}
 
 	/* Output the first chunk of the contiguous buffer. */
@@ -631,15 +550,6 @@
 	return;
 }
 
-inline static void
-ixpcom_schedrx(struct ixp4xx_com_softc *sc)
-{
-	sc->sc_rx_ready = 1;
-
-	/* Wake up the poller. */
-	softintr_schedule(sc->sc_si);
-}
-
 static void
 ixp4xx_com_break(struct ixp4xx_com_softc *sc, int onoff)
 {
@@ -687,18 +597,9 @@
 	}
 
 	/* Turn off interrupts. */
-#if 1
-	if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
-		sc->sc_ier = IER_RAVIE | IER_RTOIE;
-	} else
-		sc->sc_ier = IER_UUE;
-	bus_space_write_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_IER,
-		sc->sc_ier);
-#else
 	sc->sc_ier &= ~(IER_RAVIE | IER_TIE);
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_IER,
 		sc->sc_ier | IER_UUE);
-#endif
 
 	if (sc->disable) {
 #ifdef DIAGNOSTIC
@@ -713,7 +614,7 @@
 }
 
 int
-ixp4xx_comopen(dev_t dev, int flag, int mode, struct lwp *l)
+ixp4xx_comopen(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct ixp4xx_com_softc *sc;
 	struct tty *tp;
@@ -740,7 +641,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-		l->l_proc->p_ucred->cr_uid != 0)
+		p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -768,12 +669,15 @@
 			sc->enabled = 1;
 		}
 		/* Turn on interrupts. */
-		SET(sc->sc_ier, IER_RAVIE | IER_RTOIE | IER_RLSE | IER_RIE);
+		sc->sc_mcr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_MCR);
+		SET(sc->sc_mcr, MCR_IENABLE);
+		bus_space_write_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_MCR, sc->sc_mcr);
+		SET(sc->sc_ier, IER_RAVIE | IER_TIE);
 		bus_space_write_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_IER, sc->sc_ier);
-
+#if 0
 		/* Fetch the current modem control status, needed later. */
-		sc->sc_msr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, IXP425_UART_MSR);
-
+		sc->sc_msr = bus_space_read_4(iot, ioh, IXP425_UART_MSR);
+#endif
 		COM_UNLOCK(sc);
 		splx(s2);
 
@@ -820,7 +724,6 @@
 		sc->sc_rbavail = IXPCOM_RING_SIZE;
 		ixp4xx_com_iflush(sc);
 		CLR(sc->sc_rx_flags, RX_ANY_BLOCK);
-		ixpcom_hwiflow(sc);
 
 #ifdef COM_DEBUG
 		if (com_debug)
@@ -854,7 +757,7 @@
 }
 
 int
-ixp4xx_comclose(dev_t dev, int flag, int mode, struct lwp *l)
+ixp4xx_comclose(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct ixp4xx_com_softc *sc =
 		device_lookup(&ixpcom_cd, COMUNIT(dev));
@@ -909,7 +812,7 @@
 }
 
 int
-ixp4xx_compoll(dev_t dev, int events, struct lwp *l)
+ixp4xx_compoll(dev_t dev, int events, struct proc *p)
 {
 	struct ixp4xx_com_softc *sc =
 		device_lookup(&ixpcom_cd, COMUNIT(dev));
@@ -918,7 +821,7 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
 
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -932,7 +835,7 @@
 }
 
 int
-ixp4xx_comioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
+ixp4xx_comioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
 	struct ixp4xx_com_softc *sc =
 		device_lookup(&ixpcom_cd, COMUNIT(dev));
@@ -943,11 +846,11 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -978,7 +881,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+		error = suser(p->p_ucred, &p->p_acflag);
 		if (error)
 			break;
 		sc->sc_swflags = *(int *)data;
@@ -1114,7 +1017,7 @@
 	if (ISSET(combits, MSR_RI | MSR_TERI))
 		SET(ttybits, TIOCM_RI);
 
-	if ((sc->sc_ier & 0x0f) != 0)
+	if ((sc->sc_ier & IER_UUE) != 0)
 		SET(ttybits, TIOCM_LE);
 
 	return (ttybits);
@@ -1209,29 +1112,6 @@
 	(*tp->t_linesw->l_start)(tp);
 }
 
-void
-ixpcomdiag(void *arg)
-{
-	struct ixp4xx_com_softc *sc = arg;
-	int overflows, floods;
-	int s;
-
-	s = splserial();
-	COM_LOCK(sc);
-	overflows = sc->sc_overflows;
-	sc->sc_overflows = 0;
-	floods = sc->sc_floods;
-	sc->sc_floods = 0;
-	sc->sc_errors = 0;
-	COM_UNLOCK(sc);
-	splx(s);
-
-	printf("%s: %d silo overflow%s, %d ibuf flood%s\n",
-		sc->sc_dev.dv_xname,
-		overflows, overflows == 1 ? "" : "s",
-		floods, floods == 1 ? "" : "s");
-}
-
 inline static void
 ixp4xx_com_rxsoft(struct ixp4xx_com_softc *sc, struct tty *tp)
 {
@@ -1248,14 +1128,8 @@
 	while (cc) {
 		code = get[0];
 		lsr = get[1];
-		if (ISSET(lsr, LSR_OE | LSR_FE | LSR_PE | LSR_BI)) {
-			if (ISSET(lsr, LSR_OE)) {
-				sc->sc_overflows++;
-				if (sc->sc_errors++ == 0)
-					callout_reset(&sc->sc_diag_callout,
-						60 * hz, ixpcomdiag, sc);
-			}
-			if (ISSET(lsr, LSR_BI | LSR_FE))
+		if (ISSET(lsr, LSR_OE | LSR_FE | LSR_PE)) {
+			if (ISSET(lsr, LSR_FE))
 				SET(code, TTY_FE);
 			if (ISSET(lsr, LSR_PE))
 				SET(code, TTY_PE);
@@ -1304,12 +1178,11 @@
 		if (cc >= 1) {
 			if (ISSET(sc->sc_rx_flags, RX_IBUF_OVERFLOWED)) {
 				CLR(sc->sc_rx_flags, RX_IBUF_OVERFLOWED);
-				SET(sc->sc_ier, IER_RAVIE | IER_RTOIE);
+				SET(sc->sc_ier,IER_RAVIE);
 				ixp4xx_com_set_cr(sc);
 			}
 			if (ISSET(sc->sc_rx_flags, RX_IBUF_BLOCKED)) {
 				CLR(sc->sc_rx_flags, RX_IBUF_BLOCKED);
-				ixpcom_hwiflow(sc);
 			}
 		}
 		COM_UNLOCK(sc);
@@ -1324,59 +1197,48 @@
 	bus_space_tag_t iot = sc->sc_iot;
 	bus_space_handle_t ioh = sc->sc_ioh;
 	u_char *put, *end;
-	u_int cc;
-	u_char iir, lsr;
+	u_int cc, res;
+	u_int32_t c;
 
 	if (COM_ISALIVE(sc) == 0)
 		return (0);
 
 	COM_LOCK(sc);
-	iir = bus_space_read_4(iot, ioh, IXP425_UART_IIR);
-	if (ISSET(iir, IIR_NOPEND)) {
+	res = bus_space_read_4(iot, ioh, IXP425_UART_IER) & IER_UUE;
+
+	if (!res) {
 		COM_UNLOCK(sc);
 		return (0);
 	}
 
+	res = bus_space_read_4(iot, ioh, IXP425_UART_LSR);
+	if (!ISSET(res, LSR_DR | LSR_TDRQ))
+		return (0);
+
 	end = sc->sc_ebuf;
 	put = sc->sc_rbput;
 	cc = sc->sc_rbavail;
 
-again:	do {
-		u_char  msr;
-
-		lsr = bus_space_read_4(iot, ioh, IXP425_UART_LSR);
-		if (ISSET(lsr, LSR_BI)) {
-			int cn_trapped = 0;
-
-			cn_check_magic(sc->sc_tty->t_dev,
-				CNC_BREAK, ixp4xx_com_cnm_state);
-			if (cn_trapped)
-				continue;
-		}
-
-		if (ISSET(lsr, LSR_RCV_MASK) &&
-		    !ISSET(sc->sc_rx_flags, RX_IBUF_OVERFLOWED)) {
+	if (ISSET(res, LSR_DR)) {
+		if (!ISSET(sc->sc_rx_flags, RX_IBUF_OVERFLOWED)) {
 			while (cc > 0) {
-				int cn_trapped = 0;
-				put[0] = bus_space_read_4(iot, ioh, IXP425_UART_DATA);
-				put[1] = lsr;
+				if (!ISSET(res, LSR_DR))
+					break;
+				c = bus_space_read_4(iot, ioh, IXP425_UART_DATA);
+				if (ISSET(res, LSR_FE)) {
+					cn_check_magic(sc->sc_tty->t_dev,
+						       CNC_BREAK,
+						       ixp4xx_com_cnm_state);
+				}
+				put[0] = c & 0xff;
+				put[1] = (c >> 8) & 0xff;
 				cn_check_magic(sc->sc_tty->t_dev,
-					put[0], ixp4xx_com_cnm_state);
-				if (cn_trapped) {
-					lsr = bus_space_read_4(iot, ioh,
-							IXP425_UART_LSR);
-					if (!ISSET(lsr, LSR_RCV_MASK))
-						break;
-
-					continue;
-				}
+					       put[0], ixp4xx_com_cnm_state);
 				put += 2;
 				if (put >= end)
 					put = sc->sc_rbuf;
 				cc--;
-				lsr = bus_space_read_4(iot, ioh, IXP425_UART_LSR);
-				if (!ISSET(lsr, LSR_RCV_MASK))
-					break;
+				res = bus_space_read_4(iot, ioh, IXP425_UART_LSR);
 			}
 
 			/*
@@ -1394,12 +1256,7 @@
 			 * See if we are in danger of overflowing a buffer. If
 			 * so, use hardware flow control to ease the pressure.
 			 */
-
-			if (!ISSET(sc->sc_rx_flags, RX_IBUF_BLOCKED) &&
-				cc < sc->sc_r_hiwat) {
-					SET(sc->sc_rx_flags, RX_IBUF_BLOCKED);
-					ixpcom_hwiflow(sc);
-			}
+			/* later XXXX */
 
 			/*
                          * If we're out of space, disable receive interrupts
@@ -1407,29 +1264,26 @@
                          */
 			if (!cc) {
 				SET(sc->sc_rx_flags, RX_IBUF_OVERFLOWED);
-				CLR(sc->sc_ier, IER_RAVIE | IER_RTOIE);
+				CLR(sc->sc_ier, IER_RAVIE);
 				ixp4xx_com_set_cr(sc);
 			}
 		} else {
-			if ((iir & IIR_IMASK) == IIR_RXRDY) {
-				sc->sc_ier = IER_UUE;
-				delay(10);
-				ixp4xx_com_set_cr(sc);
-			}
+#ifdef DIAGNOSTIC
+			panic("ixpcomintr: we shouldn't reach here");
+#endif
+			CLR(sc->sc_ier, IER_RAVIE);
+			ixp4xx_com_set_cr(sc);
 		}
-
-	msr = bus_space_read_4(iot, ioh, IXP425_UART_MSR);
-	sc->sc_msr = msr;
-
-	} while (ISSET((iir = bus_space_read_4(iot, ioh, IXP425_UART_IIR)),
-		IIR_RXRDY) || ((iir & IIR_IMASK) == 0));
+	}
 
 	/*
 	 * Done handling any receive interrupts. See if data can be
 	 * transmitted as well. Schedule tx done event if no data left
 	 * and tty was marked busy.
 	 */
-	if (ISSET(lsr, LSR_TDRQ)) {
+
+	res = bus_space_read_4(iot, ioh, IXP425_UART_LSR);
+	if (ISSET(res, LSR_TDRQ)) {
 		/*
 		 * If we've delayed a parameter change, do it now, and restart
 		 * output.
@@ -1456,10 +1310,6 @@
 			}
 		}
 	}
-
-	if (!ISSET((iir = bus_space_read_4(iot, ioh, IXP425_UART_IIR)), IIR_NOPEND))
-                goto again;
-
 	COM_UNLOCK(sc);
 
 	/* Wake up the poller. */
--- a/sys/arch/arm/xscale/ixp425_comvar.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/xscale/ixp425_comvar.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ixp425_comvar.h,v 1.4 2003/06/29 10:51:31 ichiro Exp $        */
+/*      $NetBSD: ixp425_comvar.h,v 1.5 2003/06/29 22:28:12 fvdl Exp $        */
 /*-
  * Copyright (c) 2001, The NetBSD Foundation, Inc.  All rights reserved.
  *
@@ -77,19 +77,14 @@
  	volatile u_int		sc_rbavail;
 
 	/* status flags */
-	int			sc_hwflags,
-				sc_swflags;
+	int			sc_hwflags, sc_swflags;
+
 	volatile u_int		sc_rx_flags,
 				sc_tx_busy,
 				sc_tx_done,
 				sc_tx_stopped,
 				sc_st_check,
 				sc_rx_ready;
-	u_int			sc_overflows,
-				sc_floods,
-				sc_errors;
-	u_int			sc_r_hiwat,
-				sc_r_lowat;
 	volatile int		sc_heldchange;
 	volatile int		sc_msr, sc_msr_delta, sc_msr_mask, sc_mcr,
 				sc_mcr_active, sc_lcr, sc_ier, sc_fcr,
--- a/sys/arch/arm/xscale/ixp425reg.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/arm/xscale/ixp425reg.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425reg.h,v 1.6 2003/06/29 10:51:31 ichiro Exp $ */
+/*	$NetBSD: ixp425reg.h,v 1.7 2003/06/29 22:28:12 fvdl Exp $ */
 /*
  * Copyright (c) 2003
  *	Ichiro FUKUHARA <ichiro@ichiro.org>.
@@ -140,7 +140,6 @@
 
 /* Interrupt Identification Register */
 #define	IXP425_UART_IIR		0x0008
-#define	 IIR_IMASK		0xf
 #define	 IIR_NOPEND		(1U << 0)	/* No pending interrupts */
 #define	 IIR_MLSC		(0U << 1)	/* Modem status */
 #define	 IIR_TXRDY		(1U << 1)	/* Transmitter ready */
@@ -192,7 +191,6 @@
 #define	 LSR_PE			(1U << 2)	/* Parity error */
 #define	 LSR_OE			(1U << 1)	/* Overrun, lost incoming byte */
 #define	 LSR_DR			(1U << 0)	/* Byte ready in Receive Buffer */
-#define	 LSR_RCV_MASK		0x1f		/* Incoming data and error */
 
 /* Modem Status Register */
 #define	IXP425_UART_MSR		0x0018
--- a/sys/arch/atari/atari/bus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/atari/atari/bus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.34 2003/06/28 14:20:48 darrenr Exp $	*/
+/*	$NetBSD: bus.c,v 1.35 2003/06/29 22:28:12 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -522,7 +522,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/atari/atari/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/atari/atari/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.126 2003/06/28 14:20:49 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.127 2003/06/29 22:28:13 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -979,8 +979,8 @@
  * MID and proceed to new zmagic code ;-)
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	int error = ENOEXEC;
@@ -991,7 +991,7 @@
 #ifdef COMPAT_NOMID
 	if (!((execp->a_midmag >> 16) & 0x0fff)
 	    && execp->a_midmag == ZMAGIC)
-		return(exec_aout_prep_zmagic(l->l_proc, epp));
+		return(exec_aout_prep_zmagic(p, epp));
 #endif
 	return(error);
 }
--- a/sys/arch/cesfic/cesfic/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/cesfic/cesfic/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.19 2003/06/28 14:20:49 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.20 2003/06/29 22:28:13 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -760,8 +760,8 @@
  *	done on little-endian machines...  -- cgd
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 #if defined(COMPAT_NOMID) || defined(COMPAT_44)
@@ -779,7 +779,7 @@
 	switch (midmag) {
 #ifdef COMPAT_NOMID
 	case (MID_ZERO << 16) | ZMAGIC:
-		error = exec_aout_prep_oldzmagic(l->l_proc, epp);
+		error = exec_aout_prep_oldzmagic(p, epp);
 		return (error);
 #endif
 #ifdef COMPAT_44
--- a/sys/arch/cobalt/cobalt/bus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/cobalt/cobalt/bus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.15 2003/06/28 14:20:50 darrenr Exp $	*/
+/*	$NetBSD: bus.c,v 1.16 2003/06/29 22:28:14 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -412,7 +412,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/evbppc/evbppc/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/evbppc/evbppc/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.3 2003/06/28 14:20:50 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.4 2003/06/29 22:28:14 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -299,7 +299,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/hp300/dev/ac.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/ac.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ac.c,v 1.19 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: ac.c,v 1.20 2003/06/29 22:28:15 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ac.c,v 1.19 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ac.c,v 1.20 2003/06/29 22:28:15 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -186,10 +186,10 @@
 
 /*ARGSUSED*/
 int
-acopen(dev, flag, mode, l)
+acopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = minor(dev);
 	struct ac_softc *sc;
@@ -215,10 +215,10 @@
 
 /*ARGSUSED*/
 int
-acclose(dev, flag, mode, l)
+acclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ac_softc *sc = ac_cd.cd_devs[minor(dev)];
 
@@ -231,12 +231,12 @@
 
 /*ARGSUSED*/
 int
-acioctl(dev, cmd, data, flag, l)
+acioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data; 
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ac_softc *sc = ac_cd.cd_devs[minor(dev)];
 	char *dp;
--- a/sys/arch/hp300/dev/apci.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/apci.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: apci.c,v 1.23 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: apci.c,v 1.24 2003/06/29 22:28:15 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: apci.c,v 1.23 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apci.c,v 1.24 2003/06/29 22:28:15 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -302,10 +302,10 @@
 
 /* ARGSUSED */
 int
-apciopen(dev, flag, mode, l)
+apciopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = APCIUNIT(dev);
 	struct apci_softc *sc;
@@ -331,7 +331,7 @@
 
 	if ((tp->t_state & TS_ISOPEN) &&
 	    (tp->t_state & TS_XCLUDE) &&
-	    l->l_proc->p_ucred->cr_uid != 0)
+	    p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -394,10 +394,10 @@
 
 /* ARGSUSED */
 int
-apciclose(dev, flag, mode, l)
+apciclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apci_softc *sc;
 	struct tty *tp;
@@ -455,15 +455,15 @@
 }
 
 int
-apcipoll(dev, events, l)
+apcipoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apci_softc *sc = apci_cd.cd_devs[APCIUNIT(dev)];
 	struct tty *tp = sc->sc_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -595,23 +595,23 @@
 }
 
 int
-apciioctl(dev, cmd, data, flag, l)
+apciioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apci_softc *sc = apci_cd.cd_devs[APCIUNIT(dev)];
 	struct tty *tp = sc->sc_tty;
 	struct apciregs *apci = sc->sc_apci;
 	int error;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -664,7 +664,7 @@
 	case TIOCSFLAGS: {
 		int userbits;
 
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+		error = suser(p->p_ucred, &p->p_acflag);
 		if (error)
 			return (EPERM);
 
--- a/sys/arch/hp300/dev/ct.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/ct.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ct.c,v 1.34 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: ct.c,v 1.35 2003/06/29 22:28:15 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.34 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.35 2003/06/29 22:28:15 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -371,10 +371,10 @@
 
 /*ARGSUSED*/
 int
-ctopen(dev, flag, type, l)
+ctopen(dev, flag, type, p)
 	dev_t dev;
 	int flag, type;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ct_softc *sc;
 	u_char stat;
@@ -413,17 +413,17 @@
 	if (cc != sizeof(stat))
 		return(EBUSY);
 
-	sc->sc_tpr = tprintf_open(l->l_proc);
+	sc->sc_tpr = tprintf_open(p);
 	sc->sc_flags |= CTF_OPEN;
 	return(0);
 }
 
 /*ARGSUSED*/
 int
-ctclose(dev, flag, fmt, l)
+ctclose(dev, flag, fmt, p)
 	dev_t dev;
 	int flag, fmt;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ct_softc *sc = ct_cd.cd_devs[UNIT(dev)];
 
@@ -925,12 +925,12 @@
 
 /*ARGSUSED*/
 int
-ctioctl(dev, cmd, data, flag, l)
+ctioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	int flag;
 	caddr_t data;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct mtop *op;
 	int cnt;
--- a/sys/arch/hp300/dev/dca.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/dca.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: dca.c,v 1.56 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: dca.c,v 1.57 2003/06/29 22:28:15 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dca.c,v 1.56 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dca.c,v 1.57 2003/06/29 22:28:15 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -343,10 +343,10 @@
 
 /* ARGSUSED */
 int
-dcaopen(dev, flag, mode, l)
+dcaopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = DCAUNIT(dev);
 	struct dca_softc *sc;
@@ -375,7 +375,7 @@
 
 	if ((tp->t_state & TS_ISOPEN) &&
 	    (tp->t_state & TS_XCLUDE) &&
-	    l->l_proc->p_ucred->cr_uid != 0)
+	    p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -432,10 +432,10 @@
  
 /*ARGSUSED*/
 int
-dcaclose(dev, flag, mode, l)
+dcaclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dca_softc *sc;
 	struct tty *tp;
@@ -512,15 +512,15 @@
 }
 
 int
-dcapoll(dev, events, l)
+dcapoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dca_softc *sc = dca_cd.cd_devs[DCAUNIT(dev)];
 	struct tty *tp = sc->sc_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -706,12 +706,12 @@
 }
 
 int
-dcaioctl(dev, cmd, data, flag, l)
+dcaioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = DCAUNIT(dev);
 	struct dca_softc *sc = dca_cd.cd_devs[unit];
@@ -719,11 +719,11 @@
 	struct dcadevice *dca = sc->sc_dca;
 	int error;
  
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -776,7 +776,7 @@
 	case TIOCSFLAGS: {
 		int userbits;
 
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+		error = suser(p->p_ucred, &p->p_acflag);
 		if (error)
 			return (EPERM);
 
--- a/sys/arch/hp300/dev/dcm.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/dcm.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcm.c,v 1.60 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: dcm.c,v 1.61 2003/06/29 22:28:16 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.60 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.61 2003/06/29 22:28:16 fvdl Exp $");
 
 #include "opt_kgdb.h"
 
@@ -491,10 +491,10 @@
 
 /* ARGSUSED */
 int
-dcmopen(dev, flag, mode, l)
+dcmopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dcm_softc *sc;
 	struct tty *tp;
@@ -524,7 +524,7 @@
 
 	if ((tp->t_state & TS_ISOPEN) &&
 	    (tp->t_state & TS_XCLUDE) &&
-	    l->l_proc->p_ucred->cr_uid != 0)
+	    p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -586,10 +586,10 @@
  
 /*ARGSUSED*/
 int
-dcmclose(dev, flag, mode, l)
+dcmclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int s, unit, board, port;
 	struct dcm_softc *sc;
@@ -665,10 +665,10 @@
 }
 
 int
-dcmpoll(dev, events, l)
+dcmpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit, board, port;
 	struct dcm_softc *sc;
@@ -681,7 +681,7 @@
 	sc = dcm_cd.cd_devs[board];
 	tp = sc->sc_tty[port];
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -991,12 +991,12 @@
 }
 
 int
-dcmioctl(dev, cmd, data, flag, l)
+dcmioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dcm_softc *sc;
 	struct tty *tp;
@@ -1017,11 +1017,11 @@
 		       sc->sc_dev.dv_xname, port, cmd, *data, flag);
 #endif
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -1087,7 +1087,7 @@
 	case TIOCSFLAGS: {
 		int userbits;
 
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+		error = suser(p->p_ucred, &p->p_acflag);
 		if (error)
 			return (EPERM);
 
--- a/sys/arch/hp300/dev/grf.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/grf.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf.c,v 1.52 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: grf.c,v 1.53 2003/06/29 22:28:16 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.52 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.53 2003/06/29 22:28:16 fvdl Exp $");
 
 #include "opt_compat_hpux.h"
 
@@ -165,10 +165,10 @@
 
 /*ARGSUSED*/
 int
-grfopen(dev, flags, mode, l)
+grfopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = GRFUNIT(dev);
 	struct grf_softc *sc;
@@ -190,7 +190,7 @@
 	/*
 	 * XXX: cannot handle both HPUX and BSD processes at the same time
 	 */
-	if (l->l_proc->p_emul == &emul_hpux)
+	if (p->p_emul == &emul_hpux)
 		if (gp->g_flags & GF_BSDOPEN)
 			return(EBUSY);
 		else
@@ -215,10 +215,10 @@
 
 /*ARGSUSED*/
 int
-grfclose(dev, flags, mode, l)
+grfclose(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = GRFUNIT(dev);
 	struct grf_softc *sc;
@@ -241,12 +241,12 @@
 
 /*ARGSUSED*/
 int
-grfioctl(dev, cmd, data, flag, l)
+grfioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	int flag;
 	caddr_t data;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct grf_softc *sc;
 	struct grf_data *gp;
@@ -260,8 +260,8 @@
 		return (ENXIO);
 
 #ifdef COMPAT_HPUX
-	if (l->l_proc->p_emul == &emul_hpux)
-		return(hpuxgrfioctl(dev, cmd, data, flag, l));
+	if (p->p_emul == &emul_hpux)
+		return(hpuxgrfioctl(dev, cmd, data, flag, p));
 #endif
 	error = 0;
 	switch (cmd) {
@@ -279,11 +279,11 @@
 		break;
 
 	case GRFIOCMAP:
-		error = grfmap(dev, (caddr_t *)data, l->l_proc);
+		error = grfmap(dev, (caddr_t *)data, p);
 		break;
 
 	case GRFIOCUNMAP:
-		error = grfunmap(dev, *(caddr_t *)data, l->l_proc);
+		error = grfunmap(dev, *(caddr_t *)data, p);
 		break;
 
 	default:
@@ -377,11 +377,11 @@
 
 /*ARGSUSED*/
 int
-hpuxgrfioctl(dev, cmd, data, flag, l)
+hpuxgrfioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	int cmd, flag;
 	caddr_t data;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct grf_softc *sc = grf_cd.cd_devs[GRFUNIT(dev)];
 	struct grf_data *gp = sc->sc_data;
@@ -421,11 +421,11 @@
 
 	/* map in control regs and frame buffer */
 	case GCMAP:
-		error = grfmap(dev, (caddr_t *)data, l->l_proc);
+		error = grfmap(dev, (caddr_t *)data, p);
 		break;
 
 	case GCUNMAP:
-		error = grfunmap(dev, *(caddr_t *)data, l->l_proc);
+		error = grfunmap(dev, *(caddr_t *)data, p);
 		/* XXX: HP-UX uses GCUNMAP to get rid of GCSLOT memory */
 		if (error)
 			error = grflckunmmap(dev, *(caddr_t *)data);
--- a/sys/arch/hp300/dev/grfvar.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/grfvar.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: grfvar.h,v 1.15 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: grfvar.h,v 1.16 2003/06/29 22:28:17 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -137,7 +137,7 @@
 #endif
 
 #ifdef COMPAT_HPUX
-int	hpuxgrfioctl __P((dev_t, int, caddr_t, int, struct lwp *));
+int	hpuxgrfioctl __P((dev_t, int, caddr_t, int, struct proc *));
 
 int	grflock __P((struct grf_data *, int));
 int	grfunlock __P((struct grf_data *));
--- a/sys/arch/hp300/dev/hil.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/hil.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil.c,v 1.58 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: hil.c,v 1.59 2003/06/29 22:28:17 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hil.c,v 1.58 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hil.c,v 1.59 2003/06/29 22:28:17 fvdl Exp $");
 
 #include "opt_compat_hpux.h"
 #include "rnd.h"
@@ -239,10 +239,10 @@
 
 /* ARGSUSED */
 int
-hilopen(dev, flags, mode, l)
+hilopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
   	struct hil_softc *hilp;
 	struct hilloopdev *dptr;
@@ -278,7 +278,7 @@
 	 *	Multiple processes can open the device.
 	 */
 #ifdef COMPAT_HPUX
-	if (l->l_proc->p_emul == &emul_hpux) {
+	if (p->p_emul == &emul_hpux) {
 		if (dptr->hd_flags & (HIL_READIN|HIL_QUEUEIN))
 			return(EBUSY);
 		dptr->hd_flags |= HIL_READIN;
@@ -320,10 +320,10 @@
 
 /* ARGSUSED */
 int
-hilclose(dev, flags, mode, l)
+hilclose(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
   	struct hil_softc *hilp;
 	struct hilloopdev *dptr;
@@ -343,20 +343,20 @@
 	if (HILUNIT(dev) && (dptr->hd_flags & HIL_PSEUDO))
 		return (0);
 
-	if (l && l->l_proc->p_emul == &emul_netbsd) {
+	if (p && p->p_emul == &emul_netbsd) {
 		/*
 		 * If this is the loop device,
 		 * free up all queues belonging to this process.
 		 */
 		if (HILUNIT(dev) == 0) {
 			for (i = 0; i < NHILQ; i++)
-				if (hilp->hl_queue[i].hq_procp == l->l_proc)
-					(void) hilqfree(hilp, i, l->l_proc);
+				if (hilp->hl_queue[i].hq_procp == p)
+					(void) hilqfree(hilp, i, p);
 		} else {
 			mask = ~hildevmask(HILUNIT(dev));
 			s = splhil();
 			for (i = 0; i < NHILQ; i++)
-				if (hilp->hl_queue[i].hq_procp == l->l_proc) {
+				if (hilp->hl_queue[i].hq_procp == p) {
 					dptr->hd_qmask &= ~hilqmask(i);
 					hilp->hl_queue[i].hq_devmask &= mask;
 				}
@@ -461,12 +461,12 @@
 }
 
 int
-hilioctl(dev, cmd, data, flag, l)
+hilioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct hil_softc *hilp;
 	struct hilloopdev *dptr;
@@ -518,7 +518,7 @@
 	}
 
 #ifdef COMPAT_HPUX
-	if (l->l_proc->p_emul == &emul_hpux)
+	if (p->p_emul == &emul_hpux)
 		return(hpuxhilioctl(dev, cmd, data, flag));
 #endif
 
@@ -599,20 +599,19 @@
 		break;
 
         case HILIOCALLOCQ:
-		error = hilqalloc(hilp, (struct hilqinfo *)data, l->l_proc);
+		error = hilqalloc(hilp, (struct hilqinfo *)data, p);
 		break;
 
         case HILIOCFREEQ:
-		error = hilqfree(hilp, ((struct hilqinfo *)data)->qid,
-		    l->l_proc);
+		error = hilqfree(hilp, ((struct hilqinfo *)data)->qid, p);
 		break;
 
         case HILIOCMAPQ:
-		error = hilqmap(hilp, *(int *)data, HILUNIT(dev), l->l_proc);
+		error = hilqmap(hilp, *(int *)data, HILUNIT(dev), p);
 		break;
 
         case HILIOCUNMAPQ:
-		error = hilqunmap(hilp, *(int *)data, HILUNIT(dev), l->l_proc);
+		error = hilqunmap(hilp, *(int *)data, HILUNIT(dev), p);
 		break;
 
 	case HILIOCHPUX:
@@ -772,10 +771,10 @@
 
 /*ARGSUSED*/
 int
-hilpoll(dev, events, l)
+hilpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct hil_softc *hilp;
 	struct hilloopdev *dptr;
@@ -801,7 +800,7 @@
 		if (dptr->hd_queue.c_cc > 0)
 			revents |= events & (POLLIN | POLLRDNORM);
 		else
-			selrecord(l, &dptr->hd_selr);
+			selrecord(p, &dptr->hd_selr);
 		splx(s);
 		return (revents);
 	}
@@ -829,14 +828,14 @@
 	 */
 	s = splhil();
 	for (qp = hilp->hl_queue; qp < &hilp->hl_queue[NHILQ]; qp++)
-		if (qp->hq_procp == l->l_proc && (mask & qp->hq_devmask) &&
+		if (qp->hq_procp == p && (mask & qp->hq_devmask) &&
 		    qp->hq_eventqueue->hil_evqueue.head !=
 		    qp->hq_eventqueue->hil_evqueue.tail) {
 			splx(s);
 			return (revents | (events & (POLLIN | POLLRDNORM)));
 		}
 
-	selrecord(l, &dptr->hd_selr);
+	selrecord(p, &dptr->hd_selr);
 	splx(s);
 	return (revents);
 }
--- a/sys/arch/hp300/dev/ite.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/ite.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.59 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: ite.c,v 1.60 2003/06/29 22:28:17 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.59 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.60 2003/06/29 22:28:17 fvdl Exp $");
 
 #include "hil.h"
 
@@ -356,10 +356,10 @@
 
 /* ARGSUSED */
 int
-iteopen(dev, mode, devtype, l)
+iteopen(dev, mode, devtype, p)
 	dev_t dev;
 	int mode, devtype;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = ITEUNIT(dev);
 	struct tty *tp;
@@ -379,7 +379,7 @@
 	} else
 		tp = ip->tty;
 	if ((tp->t_state&(TS_ISOPEN|TS_XCLUDE)) == (TS_ISOPEN|TS_XCLUDE)
-	    && l->l_proc->p_ucred->cr_uid != 0)
+	    && p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 	if ((ip->flags & ITE_ACTIVE) == 0) {
 		error = iteon(ip, 0);
@@ -411,10 +411,10 @@
 
 /*ARGSUSED*/
 int
-iteclose(dev, flag, mode, l)
+iteclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ite_softc *sc = ite_cd.cd_devs[ITEUNIT(dev)];
 	struct ite_data *ip = sc->sc_data;
@@ -456,15 +456,15 @@
 }
 
 int
-itepoll(dev, events, l)
+itepoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ite_softc *sc = ite_cd.cd_devs[ITEUNIT(dev)];
 	struct tty *tp = sc->sc_data->tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -477,22 +477,22 @@
 }
 
 int
-iteioctl(dev, cmd, addr, flag, l)
+iteioctl(dev, cmd, addr, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t addr;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ite_softc *sc = ite_cd.cd_devs[ITEUNIT(dev)];
 	struct ite_data *ip = sc->sc_data;
 	struct tty *tp = ip->tty;
 	int error;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, addr, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, addr, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
-	return ttioctl(tp, cmd, addr, flag, l);
+	return ttioctl(tp, cmd, addr, flag, p);
 }
 
 void
--- a/sys/arch/hp300/dev/mt.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/mt.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mt.c,v 1.22 2003/06/29 15:58:19 thorpej Exp $	*/
+/*	$NetBSD: mt.c,v 1.23 2003/06/29 22:28:18 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.22 2003/06/29 15:58:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.23 2003/06/29 22:28:18 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -317,10 +317,10 @@
 }
 
 int
-mtopen(dev, flag, mode, l)
+mtopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = UNIT(dev);
 	struct mt_softc *sc;
@@ -337,7 +337,7 @@
 	if (sc->sc_flags & MTF_OPEN)
 		return (EBUSY);
 	sc->sc_flags |= MTF_OPEN;
-	sc->sc_ttyp = tprintf_open(l->l_proc);
+	sc->sc_ttyp = tprintf_open(p);
 	if ((sc->sc_flags & MTF_ALIVE) == 0) {
 		error = mtcommand(dev, MTRESET, 0);
 		if (error != 0 || (sc->sc_flags & MTF_ALIVE) == 0)
@@ -423,10 +423,10 @@
 }
 
 int
-mtclose(dev, flag, fmt, l)
+mtclose(dev, flag, fmt, p)
 	dev_t dev;
 	int flag, fmt;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct mt_softc *sc = mt_cd.cd_devs[UNIT(dev)];
 
@@ -976,12 +976,12 @@
 }
 
 int
-mtioctl(dev, cmd, data, flag, l)
+mtioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct mtop *op;
 	int cnt;
--- a/sys/arch/hp300/dev/ppi.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/ppi.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppi.c,v 1.25 2003/06/29 15:58:20 thorpej Exp $	*/
+/*	$NetBSD: ppi.c,v 1.26 2003/06/29 22:28:18 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.25 2003/06/29 15:58:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.26 2003/06/29 22:28:18 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -209,10 +209,10 @@
 }
 
 int
-ppiopen(dev, flags, fmt, l)
+ppiopen(dev, flags, fmt, p)
 	dev_t dev;
 	int flags, fmt;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = UNIT(dev);
 	struct ppi_softc *sc;
@@ -238,10 +238,10 @@
 }
 
 int
-ppiclose(dev, flags, fmt, l)
+ppiclose(dev, flags, fmt, p)
 	dev_t dev;
 	int flags, fmt;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = UNIT(dev);
 	struct ppi_softc *sc = ppi_cd.cd_devs[unit];
@@ -472,12 +472,12 @@
 }
 
 int
-ppiioctl(dev, cmd, data, flag, l)
+ppiioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ppi_softc *sc = ppi_cd.cd_devs[UNIT(dev)];
 	struct ppiparam *pp, *upp;
--- a/sys/arch/hp300/dev/rd.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/rd.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.59 2003/06/29 15:58:20 thorpej Exp $	*/
+/*	$NetBSD: rd.c,v 1.60 2003/06/29 22:28:18 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.59 2003/06/29 15:58:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.60 2003/06/29 22:28:18 fvdl Exp $");
 
 #include "opt_useleds.h"
 #include "rnd.h"
@@ -576,10 +576,10 @@
 }
 
 int
-rdopen(dev, flags, mode, l)
+rdopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = rdunit(dev);
 	struct rd_softc *rs;
@@ -635,10 +635,10 @@
 }
 
 int
-rdclose(dev, flag, mode, l)
+rdclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = rdunit(dev);
 	struct rd_softc *rs = rd_cd.cd_devs[unit];
@@ -1147,12 +1147,12 @@
 }
 
 int
-rdioctl(dev, cmd, data, flag, l)
+rdioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = rdunit(dev);
 	struct rd_softc *sc = rd_cd.cd_devs[unit];
--- a/sys/arch/hp300/dev/sd.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/sd.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.63 2003/06/29 15:58:20 thorpej Exp $	*/
+/*	$NetBSD: sd.c,v 1.64 2003/06/29 22:28:19 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.63 2003/06/29 15:58:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.64 2003/06/29 22:28:19 fvdl Exp $");
 
 #include "rnd.h"
 #include "opt_useleds.h"
@@ -510,10 +510,10 @@
 }
 
 int
-sdopen(dev, flags, mode, l)
+sdopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = sdunit(dev);
 	struct sd_softc *sc;
@@ -569,10 +569,10 @@
 }
 
 int
-sdclose(dev, flag, mode, l)
+sdclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = sdunit(dev);
 	struct sd_softc *sc = sd_cd.cd_devs[unit];
@@ -1036,7 +1036,7 @@
 	int pid;
 
 	if ((pid = sc->sc_format_pid) >= 0 &&
-	    pid != uio->uio_lwp->l_proc->p_pid)
+	    pid != uio->uio_procp->p_pid)
 		return (EPERM);
 		
 	return (physio(sdstrategy, NULL, dev, B_READ, minphys, uio));
@@ -1053,19 +1053,19 @@
 	int pid;
 
 	if ((pid = sc->sc_format_pid) >= 0 &&
-	    pid != uio->uio_lwp->l_proc->p_pid)
+	    pid != uio->uio_procp->p_pid)
 		return (EPERM);
 		
 	return (physio(sdstrategy, NULL, dev, B_WRITE, minphys, uio));
 }
 
 int
-sdioctl(dev, cmd, data, flag, l)
+sdioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = sdunit(dev);
 	struct sd_softc *sc = sd_cd.cd_devs[unit];
@@ -1126,13 +1126,13 @@
 
 	case SDIOCSFORMAT:
 		/* take this device into or out of "format" mode */
-		if (suser(l->l_proc->p_ucred, &l->l_proc->p_acflag))
+		if (suser(p->p_ucred, &p->p_acflag))
 			return(EPERM);
 
 		if (*(int *)data) {
 			if (sc->sc_format_pid >= 0)
 				return (EPERM);
-			sc->sc_format_pid = l->l_proc->p_pid;
+			sc->sc_format_pid = p->p_pid;
 		} else
 			sc->sc_format_pid = -1;
 		return (0);
@@ -1147,7 +1147,7 @@
 		 * Save what user gave us as SCSI cdb to use with next
 		 * read or write to the char device.
 		 */
-		if (sc->sc_format_pid != l->l_proc->p_pid)
+		if (sc->sc_format_pid != p->p_pid)
 			return (EPERM);
 		if (legal_cmds[((struct scsi_fmt_cdb *)data)->cdb[0]] == 0)
 			return (EINVAL);
--- a/sys/arch/hp300/dev/st.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/dev/st.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: st.c,v 1.38 2003/06/29 15:58:20 thorpej Exp $	*/
+/*	$NetBSD: st.c,v 1.39 2003/06/29 22:28:19 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.38 2003/06/29 15:58:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.39 2003/06/29 22:28:19 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -360,10 +360,10 @@
 }
 
 int
-stopen(dev, flag, type, l)
+stopen(dev, flag, type, p)
 	dev_t dev;
 	int flag, type;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct st_softc *sc;
 	struct st_xsense *xsense;
@@ -399,7 +399,7 @@
 	/*
 	 * Be prepared to print error messages
 	 */
-	sc->sc_ctty = tprintf_open(l->l_proc);
+	sc->sc_ctty = tprintf_open(p);
 
 	/* do a mode sense to get current */
 	modlen = sc->sc_datalen[CMD_MODE_SENSE];
@@ -658,10 +658,10 @@
 
 /*ARGSUSED*/
 int
-stclose(dev, flag, mode, l)
+stclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct st_softc *sc = st_cd.cd_devs[UNIT(dev)];
 	int hit = 0;
@@ -856,12 +856,12 @@
 
 /*ARGSUSED*/
 int
-stioctl(dev, cmd, data, flag, l)
+stioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data; 
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct st_softc *sc = st_cd.cd_devs[UNIT(dev)];
 	int cnt;
--- a/sys/arch/hp300/hp300/hpux_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/hp300/hpux_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpux_machdep.c,v 1.34 2003/06/29 15:58:20 thorpej Exp $	*/
+/*	$NetBSD: hpux_machdep.c,v 1.35 2003/06/29 22:28:20 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpux_machdep.c,v 1.34 2003/06/29 15:58:20 thorpej Exp $");                                                  
+__KERNEL_RCSID(0, "$NetBSD: hpux_machdep.c,v 1.35 2003/06/29 22:28:20 fvdl Exp $");                                                  
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -168,8 +168,8 @@
  * m68k-specific setup for HP-UX executables.
  */
 int
-hpux_cpu_makecmds(l, epp)
-	struct lwp *l;
+hpux_cpu_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	/* struct hpux_exec *hpux_ep = epp->ep_hdr; */
@@ -189,8 +189,8 @@
  * in ev->ev_len.
  */
 int
-hpux_cpu_vmcmd(l, ev)
-	struct lwp *l;
+hpux_cpu_vmcmd(p, ev)
+	struct proc *p;
 	struct exec_vmcmd *ev;
 {
 	struct hpux_exec *execp = (struct hpux_exec *)ev->ev_addr;
@@ -205,10 +205,10 @@
 	/* Deal with misc. HP-UX process attributes. */
 	if (execp->ha_trsize & HPUXM_VALID) {
 		if (execp->ha_trsize & HPUXM_DATAWT)
-			l->l_proc->p_md.mdp_flags &= ~MDP_CCBDATA;
+			p->p_md.mdp_flags &= ~MDP_CCBDATA;
 
 		if (execp->ha_trsize & HPUXM_STKWT)
-			l->l_proc->p_md.mdp_flags &= ~MDP_CCBSTACK;
+			p->p_md.mdp_flags &= ~MDP_CCBSTACK;
 	}
 
 	return (0);
--- a/sys/arch/hp300/hp300/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/hp300/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.171 2003/06/29 15:58:20 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.172 2003/06/29 22:28:20 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.171 2003/06/29 15:58:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.172 2003/06/29 22:28:20 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_hpux.h"
@@ -668,14 +668,14 @@
  * machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	dev_t consdev;
 
@@ -1327,8 +1327,8 @@
  *	done on little-endian machines...  -- cgd
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 #if defined(COMPAT_NOMID) || defined(COMPAT_44)
@@ -1346,12 +1346,12 @@
 	switch (midmag) {
 #ifdef COMPAT_NOMID
 	case (MID_ZERO << 16) | ZMAGIC:
-		error = exec_aout_prep_oldzmagic(l->l_proc, epp);
+		error = exec_aout_prep_oldzmagic(p, epp);
 		return(error);
 #endif
 #ifdef COMPAT_44
 	case (MID_HP300 << 16) | ZMAGIC:
-		error = exec_aout_prep_oldzmagic(l->l_proc, epp);
+		error = exec_aout_prep_oldzmagic(p, epp);
 		return(error);
 #endif
 	}
--- a/sys/arch/hp300/include/hpux_machdep.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hp300/include/hpux_machdep.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpux_machdep.h,v 1.15 2003/06/29 15:58:21 thorpej Exp $	*/
+/*	$NetBSD: hpux_machdep.h,v 1.16 2003/06/29 22:28:21 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -69,8 +69,8 @@
 struct exec_package;
 struct exec_vmcmd;
 
-int	hpux_cpu_makecmds __P((struct lwp *, struct exec_package *));
-int	hpux_cpu_vmcmd __P((struct lwp *, struct exec_vmcmd *));
+int	hpux_cpu_makecmds __P((struct proc *, struct exec_package *));
+int	hpux_cpu_vmcmd __P((struct proc *, struct exec_vmcmd *));
 int	hpux_cpu_sysconf_arch __P((void));
 int	hpux_to_bsd_uoff __P((int *, int *, struct lwp *));
 
--- a/sys/arch/hpc/hpc/kloader.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hpc/hpc/kloader.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kloader.c,v 1.5 2003/06/28 14:20:52 darrenr Exp $	*/
+/*	$NetBSD: kloader.c,v 1.6 2003/06/29 22:28:22 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -309,9 +309,10 @@
 struct vnode *
 kloader_open(const char *filename)
 {
+	struct proc *p = KLOADER_PROC;
 	struct nameidata nid;
 
-	NDINIT(&nid, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, curlwp);
+	NDINIT(&nid, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, p);
 
 	if (namei(&nid) != 0) {
 		PRINTF("namei failed (%s)\n", filename);
--- a/sys/arch/hpcmips/hpcmips/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/hpcmips/hpcmips/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.18 2003/06/28 14:20:53 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.19 2003/06/29 22:28:22 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -329,7 +329,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_hpcmips_bd_map_load_uio: USERSPACE but no proc");
--- a/sys/arch/i386/conf/GENERIC	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/conf/GENERIC	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.563 2003/06/28 15:34:41 darrenr Exp $
+# $NetBSD: GENERIC,v 1.564 2003/06/29 22:28:23 fvdl Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.563 $"
+#ident 		"GENERIC-$Revision: 1.564 $"
 
 maxusers	32		# estimated number of users
 
--- a/sys/arch/i386/i386/apm.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/apm.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: apm.c,v 1.78 2003/06/28 14:20:54 darrenr Exp $ */
+/*	$NetBSD: apm.c,v 1.79 2003/06/29 22:28:23 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.78 2003/06/28 14:20:54 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.79 2003/06/29 22:28:23 fvdl Exp $");
 
 #include "apm.h"
 #if NAPM > 1
@@ -1592,10 +1592,10 @@
 }
 
 int
-apmopen(dev, flag, mode, l)
+apmopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = APMUNIT(dev);
 	int ctl = APMDEV(dev);
@@ -1612,7 +1612,7 @@
 		return ENXIO;
 	
 	DPRINTF(APMDEBUG_DEVICE,
-	    ("apmopen: pid %d flag %x mode %x\n", l->l_proc->p_pid, flag, mode));
+	    ("apmopen: pid %d flag %x mode %x\n", p->p_pid, flag, mode));
 
 	APM_LOCK(sc);
 	switch (ctl) {
@@ -1644,16 +1644,16 @@
 }
 
 int
-apmclose(dev, flag, mode, l)
+apmclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc = apm_cd.cd_devs[APMUNIT(dev)];
 	int ctl = APMDEV(dev);
 
 	DPRINTF(APMDEBUG_DEVICE,
-	    ("apmclose: pid %d flag %x mode %x\n", l->l_proc->p_pid, flag, mode));
+	    ("apmclose: pid %d flag %x mode %x\n", p->p_pid, flag, mode));
 
 	APM_LOCK(sc);
 	switch (ctl) {
@@ -1673,12 +1673,12 @@
 }
 
 int
-apmioctl(dev, cmd, data, flag, l)
+apmioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc = apm_cd.cd_devs[APMUNIT(dev)];
 	struct apm_power_info *powerp;
@@ -1798,10 +1798,10 @@
 }
 
 int
-apmpoll(dev, events, l)
+apmpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc = apm_cd.cd_devs[APMUNIT(dev)];
 	int revents = 0;
@@ -1811,7 +1811,7 @@
 		if (sc->event_count)
 			revents |= events & (POLLIN | POLLRDNORM);
 		else
-			selrecord(l, &sc->sc_rsel);
+			selrecord(p, &sc->sc_rsel);
 	}
 	APM_UNLOCK(sc);
 
--- a/sys/arch/i386/i386/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.525 2003/06/28 14:20:55 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.526 2003/06/29 22:28:24 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.525 2003/06/28 14:20:55 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.526 2003/06/29 22:28:24 fvdl Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -497,14 +497,14 @@
  * machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	dev_t consdev;
 	struct btinfo_bootpath *bibp;
@@ -2149,14 +2149,14 @@
  * if COMPAT_NOMID is given as a kernel option.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	int error = ENOEXEC;
 
 #ifdef COMPAT_NOMID
-	if ((error = exec_nomid(l->l_proc, epp)) == 0)
+	if ((error = exec_nomid(p, epp)) == 0)
 		return error;
 #endif /* ! COMPAT_NOMID */
 
--- a/sys/arch/i386/i386/mem.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/mem.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.57 2003/06/28 14:20:55 darrenr Exp $	*/
+/*	$NetBSD: mem.c,v 1.58 2003/06/29 22:28:25 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.57 2003/06/28 14:20:55 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.58 2003/06/29 22:28:25 fvdl Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -80,10 +80,10 @@
 
 /*ARGSUSED*/
 int
-mmopen(dev, flag, mode, l)
+mmopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 
 	switch (minor(dev)) {
--- a/sys/arch/i386/i386/process_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/process_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.47 2003/06/28 14:20:56 darrenr Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.48 2003/06/29 22:28:26 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.47 2003/06/28 14:20:56 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.48 2003/06/29 22:28:26 fvdl Exp $");
 
 #include "opt_vm86.h"
 #include "npx.h"
@@ -456,8 +456,8 @@
 }
 
 int
-ptrace_machdep_dorequest(l, lt, req, addr, data)
-	struct lwp *l;
+ptrace_machdep_dorequest(p, lt, req, addr, data)
+	struct proc *p;
 	struct lwp *lt;
 	int req;
 	caddr_t addr;
@@ -484,8 +484,8 @@
 			uio.uio_resid = sizeof(struct xmmregs);
 			uio.uio_segflg = UIO_USERSPACE;
 			uio.uio_rw = write ? UIO_WRITE : UIO_READ;
-			uio.uio_lwp = l;
-			return (process_machdep_doxmmregs(l, lt, &uio));
+			uio.uio_procp = p;
+			return (process_machdep_doxmmregs(p, lt, &uio));
 		}
 	}
 
@@ -501,8 +501,8 @@
  */
 
 int
-process_machdep_doxmmregs(curl, l, uio)
-	struct lwp *curl;		/* tracer */
+process_machdep_doxmmregs(curp, l, uio)
+	struct proc *curp;		/* tracer */
 	struct lwp *l;			/* traced */
 	struct uio *uio;
 {
@@ -511,7 +511,7 @@
 	char *kv;
 	int kl;
 
-	if ((error = process_checkioperm(curl, l->l_proc)) != 0)
+	if ((error = process_checkioperm(curp, l->l_proc)) != 0)
 		return (error);
 
 	kl = sizeof(r);
--- a/sys/arch/i386/i386/procfs_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/procfs_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.14 2003/06/28 14:20:56 darrenr Exp $	*/
+/*	$NetBSD: procfs_machdep.c,v 1.15 2003/06/29 22:28:26 fvdl Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.14 2003/06/28 14:20:56 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15 2003/06/29 22:28:26 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -179,13 +179,13 @@
 }
 
 int
-procfs_machdep_rw(struct lwp *curl, struct lwp *l, struct pfsnode *pfs,
+procfs_machdep_rw(struct proc *curp, struct lwp *l, struct pfsnode *pfs,
     struct uio *uio)
 {
 
 	switch (pfs->pfs_type) {
 	case Pmachdep_xmmregs:
-		return (procfs_machdep_doxmmregs(curl, l, pfs, uio));
+		return (procfs_machdep_doxmmregs(curp, l, pfs, uio));
 
 	default:
 		panic("procfs_machdep_rw");
@@ -213,17 +213,17 @@
 }
 
 int
-procfs_machdep_doxmmregs(struct lwp *curl, struct lwp *l,
+procfs_machdep_doxmmregs(struct proc *curp, struct lwp *l,
     struct pfsnode *pfs, struct uio *uio)
 {
 
-	return (process_machdep_doxmmregs(curl, l, uio));
+	return (process_machdep_doxmmregs(curp, l, uio));
 }
 
 int
-procfs_machdep_validxmmregs(struct lwp *l, struct mount *mp)
+procfs_machdep_validxmmregs(struct proc *p, struct mount *mp)
 {
 
-	return (process_machdep_validxmmregs(l->l_proc));
+	return (process_machdep_validxmmregs(p));
 }
 #endif
--- a/sys/arch/i386/i386/syscall.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/syscall.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.19 2003/06/28 14:20:56 darrenr Exp $	*/
+/*	$NetBSD: syscall.c,v 1.20 2003/06/29 22:28:26 fvdl 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.19 2003/06/28 14:20:56 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.20 2003/06/29 22:28:26 fvdl Exp $");
 
 #include "opt_syscall_debug.h"
 #include "opt_vm86.h"
@@ -310,7 +310,7 @@
 #ifdef KTRACE
 	if (KTRPOINT(p, KTR_SYSRET)) {
 		KERNEL_PROC_LOCK(l);
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(p, SYS_fork, 0, 0);
 		KERNEL_PROC_UNLOCK(l);
 	}
 #endif
--- a/sys/arch/i386/i386/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/i386/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.109 2003/06/28 14:20:56 darrenr Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.110 2003/06/29 22:28:26 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1995 Charles M. Hannum.  All rights reserved.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.109 2003/06/28 14:20:56 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.110 2003/06/29 22:28:26 fvdl Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_largepages.h"
@@ -285,6 +285,7 @@
 	struct ucred *cred;
 	struct core *chdr;
 {
+	struct proc *p = l->l_proc;
 	struct md_core md_core;
 	struct coreseg cseg;
 	int error;
@@ -310,13 +311,13 @@
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, cred,
-	    NULL, l);
+	    NULL, p);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
@@ -403,7 +404,6 @@
 	vsize_t len;
 {
 	vaddr_t faddr, taddr, off;
-	struct proc *p;
 	paddr_t fpa;
 
 	if ((bp->b_flags & B_PHYS) == 0)
@@ -425,9 +425,8 @@
 	 * where we we just allocated (TLB will be flushed when our
 	 * mapping is removed).
 	 */
-	p = bp->b_proc;
 	while (len) {
-		(void) pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map),
+		(void) pmap_extract(vm_map_pmap(&bp->b_proc->p_vmspace->vm_map),
 		    faddr, &fpa);
 		pmap_kenter_pa(taddr, fpa, VM_PROT_READ|VM_PROT_WRITE);
 		faddr += PAGE_SIZE;
--- a/sys/arch/i386/include/ptrace.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/i386/include/ptrace.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.10 2003/06/28 14:20:57 darrenr Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.11 2003/06/29 22:28:27 fvdl Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -125,15 +125,15 @@
 struct xmmregs;
 
 /* Functions used by both ptrace(2) and procfs. */
-int	process_machdep_doxmmregs(struct lwp *, struct lwp *, struct uio *);
+int	process_machdep_doxmmregs(struct proc *, struct lwp *, struct uio *);
 int	process_machdep_validxmmregs(struct proc *);
 
 /* Functions used by procfs. */
 struct mount;
 struct pfsnode;
-int	procfs_machdep_doxmmregs(struct lwp *, struct lwp *,
+int	procfs_machdep_doxmmregs(struct proc *, struct lwp *,
 	    struct pfsnode *, struct uio *);
-int	procfs_machdep_validxmmregs(struct lwp *, struct mount *);
+int	procfs_machdep_validxmmregs(struct proc *, struct mount *);
 
 #endif /* _KERNEL */
 
--- a/sys/arch/luna68k/luna68k/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/luna68k/luna68k/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.32 2003/06/28 14:20:57 darrenr Exp $ */
+/* $NetBSD: machdep.c,v 1.33 2003/06/29 22:28:28 fvdl Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.32 2003/06/28 14:20:57 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.33 2003/06/29 22:28:28 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -888,15 +888,15 @@
  * understand and, if so, set up the vmcmds for it.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	int error = ENOEXEC;
 #ifdef COMPAT_SUNOS
 	extern sunos_exec_aout_makecmds
 	__P((struct proc *, struct exec_package *));
-	if ((error = sunos_exec_aout_makecmds(l->l_proc, epp)) == 0)
+	if ((error = sunos_exec_aout_makecmds(p, epp)) == 0)
 		return 0;
 #endif
 	return error;
--- a/sys/arch/m68k/m68k/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/m68k/m68k/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.7 2003/06/28 14:20:57 darrenr Exp $ */
+/* $NetBSD: bus_dma.c,v 1.8 2003/06/29 22:28:29 fvdl Exp $ */
 
 /*
  * This file was taken from from alpha/common/bus_dma.c
@@ -46,7 +46,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.7 2003/06/28 14:20:57 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.8 2003/06/29 22:28:29 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -342,7 +342,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_direct_common: USERSPACE but no proc");
--- a/sys/arch/m68k/m68k/m68k_syscall.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/m68k/m68k/m68k_syscall.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_syscall.c,v 1.8 2003/06/28 14:20:58 darrenr Exp $	*/
+/*	$NetBSD: m68k_syscall.c,v 1.9 2003/06/29 22:28:29 fvdl Exp $	*/
 
 /*-
  * Portions Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -441,7 +441,7 @@
 	machine_userret(l, f, 0);
 #ifdef KTRACE
 	if (KTRPOINT(l->l_proc, KTR_SYSRET))
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(l->l_proc, SYS_fork, 0, 0);
 #endif
 }
 
--- a/sys/arch/m68k/m68k/svr4_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/m68k/m68k/svr4_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_machdep.c,v 1.10 2003/06/29 15:27:59 thorpej Exp $	*/
+/*	$NetBSD: svr4_machdep.c,v 1.11 2003/06/29 22:28:29 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -330,7 +330,7 @@
 			return (error);
 		name = KERN_HOSTNAME;
 		return (kern_sysctl(&name, 1, NULL, NULL, SCARG(uap, a1), len,
-		    l));
+		    p));
 	default:
 		printf("uninplemented svr4_sysarch(%d), a1 %p\n",
 		    SCARG(uap, op), SCARG(uap, a1));
--- a/sys/arch/m68k/m68k/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/m68k/m68k/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.4 2003/06/29 15:49:49 thorpej Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.5 2003/06/29 22:28:29 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.4 2003/06/29 15:49:49 thorpej Exp $");                                                  
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.5 2003/06/29 22:28:29 fvdl Exp $");                                                  
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -186,6 +186,7 @@
 	struct ucred *cred;
 	struct core *chdr;
 {
+	struct proc *p = l->l_proc;
 	struct md_core md_core;
 	struct coreseg cseg;
 	int error;
@@ -216,13 +217,13 @@
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, cred,
-	    NULL, l);
+	    NULL, p);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
--- a/sys/arch/mac68k/mac68k/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mac68k/mac68k/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.289 2003/06/28 14:20:58 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.290 2003/06/29 22:28:31 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1062,8 +1062,8 @@
 }
 
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	int error = ENOEXEC;
@@ -1071,7 +1071,7 @@
 #ifdef COMPAT_NOMID
 	/* Check to see if MID == 0. */
 	if (((struct exec *)epp->ep_hdr)->a_midmag == ZMAGIC)
-		return exec_aout_prep_oldzmagic(l->l_proc, epp);
+		return exec_aout_prep_oldzmagic(p, epp);
 #endif
 
 	return error;
--- a/sys/arch/macppc/dev/aed.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/macppc/dev/aed.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: aed.c,v 1.12 2003/06/29 11:02:21 darrenr Exp $	*/
+/*	$NetBSD: aed.c,v 1.13 2003/06/29 22:28:33 fvdl Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -418,10 +418,10 @@
 }
 
 int 
-aedopen(dev, flag, mode, l)
+aedopen(dev, flag, mode, p)
     dev_t dev;
     int flag, mode;
-    struct lwp *l;
+    struct proc *p;
 {
 	int unit;
 	int error = 0;
@@ -440,7 +440,7 @@
 	aed_sc->sc_evq_tail = 0;
 	aed_sc->sc_evq_len = 0;
 	aed_sc->sc_open = 1;
-	aed_sc->sc_ioproc = l->l_proc;
+	aed_sc->sc_ioproc = p;
 	splx(s);
 
 	return (error);
@@ -448,10 +448,10 @@
 
 
 int 
-aedclose(dev, flag, mode, l)
+aedclose(dev, flag, mode, p)
     dev_t dev;
     int flag, mode;
-    struct lwp *l;
+    struct proc *p;
 {
 	int s = spladb();
 
@@ -512,12 +512,12 @@
 }
 
 int 
-aedioctl(dev, cmd, data, flag, l)
+aedioctl(dev, cmd, data, flag, p)
     dev_t dev;
     u_long cmd;
     caddr_t data;
     int flag;
-    struct lwp *l;
+    struct proc *p;
 {
 	switch (cmd) {
 	case ADBIOCDEVSINFO: {
@@ -581,10 +581,10 @@
 
 
 int 
-aedpoll(dev, events, l)
+aedpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	int s, revents;
 
@@ -597,7 +597,7 @@
 	if (aed_sc->sc_evq_len > 0)
 		revents |= events & (POLLIN | POLLRDNORM);
 	else
-		selrecord(l, &aed_sc->sc_selinfo);
+		selrecord(p, &aed_sc->sc_selinfo);
 	splx(s);
 
 	return (revents);
--- a/sys/arch/macppc/dev/apm.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/macppc/dev/apm.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: apm.c,v 1.7 2003/06/29 11:02:21 darrenr Exp $	*/
+/*	$NetBSD: apm.c,v 1.8 2003/06/29 22:28:33 fvdl Exp $	*/
 /*	$OpenBSD: apm.c,v 1.5 2002/06/07 07:13:59 miod Exp $	*/
 
 /*-
@@ -194,10 +194,10 @@
 }
 
 int
-apmopen(dev, flag, mode, l)
+apmopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc;
 	int error = 0;
@@ -208,7 +208,7 @@
 		return ENXIO;
 
 	DPRINTF(("apmopen: dev %d pid %d flag %x mode %x\n",
-	    APMDEV(dev), l->l_proc->p_pid, flag, mode));
+	    APMDEV(dev), p->p_pid, flag, mode));
 
 	APM_LOCK(sc);
 	switch (APMDEV(dev)) {
@@ -239,10 +239,10 @@
 }
 
 int
-apmclose(dev, flag, mode, l)
+apmclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc;
 
@@ -251,8 +251,7 @@
 	    !(sc = apm_cd.cd_devs[APMUNIT(dev)]))
 		return ENXIO;
 
-	DPRINTF(("apmclose: pid %d flag %x mode %x\n", l->l_proc->p_pid,
-		flag, mode));
+	DPRINTF(("apmclose: pid %d flag %x mode %x\n", p->p_pid, flag, mode));
 
 	APM_LOCK(sc);
 	switch (APMDEV(dev)) {
@@ -268,12 +267,12 @@
 }
 
 int
-apmioctl(dev, cmd, data, flag, l)
+apmioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc;
 	struct pmu_battery_info batt;
@@ -403,10 +402,10 @@
 #endif
 
 int
-apmpoll(dev, events, l)
+apmpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct apm_softc *sc = apm_cd.cd_devs[APMUNIT(dev)];
 	int revents = 0;
@@ -416,7 +415,7 @@
 		if (sc->event_count)
 			revents |= events & (POLLIN | POLLRDNORM);
 		else
-			selrecord(l, &sc->sc_rsel);
+			selrecord(p, &sc->sc_rsel);
 	}
 	APM_UNLOCK(sc);
 
--- a/sys/arch/macppc/dev/ofb.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/macppc/dev/ofb.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofb.c,v 1.34 2003/06/29 11:02:21 darrenr Exp $	*/
+/*	$NetBSD: ofb.c,v 1.35 2003/06/29 22:28:33 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -89,7 +89,7 @@
 	sizeof(_ofb_scrlist) / sizeof(struct wsscreen_descr *), _ofb_scrlist
 };
 
-static int ofb_ioctl __P((void *, u_long, caddr_t, int, struct lwp *));
+static int ofb_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
 static paddr_t ofb_mmap __P((void *, off_t, int));
 static int ofb_alloc_screen __P((void *, const struct wsscreen_descr *,
 				void **, int *, int *, long *));
@@ -325,12 +325,12 @@
 }
 
 int
-ofb_ioctl(v, cmd, data, flag, l)
+ofb_ioctl(v, cmd, data, flag, p)
 	void *v;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct ofb_softc *sc = v;
 	struct ofb_devconfig *dc = sc->sc_dc;
@@ -367,7 +367,7 @@
 	case PCI_IOC_CFGREAD:
 	case PCI_IOC_CFGWRITE:
 		return (pci_devioctl(sc->sc_pc, sc->sc_pcitag,
-		    cmd, data, flag, l));
+		    cmd, data, flag, p));
 	}
 	return EPASSTHROUGH;
 }
--- a/sys/arch/macppc/dev/z8530tty.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/macppc/dev/z8530tty.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: z8530tty.c,v 1.17 2003/06/29 11:02:22 darrenr Exp $	*/
+/*	$NetBSD: z8530tty.c,v 1.18 2003/06/29 22:28:34 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -436,11 +436,11 @@
  * Open a zs serial (tty) port.
  */
 int
-zsopen(dev, flags, mode, l)
+zsopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags;
 	int mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = ZSUNIT(dev);
 	struct zstty_softc *zst;
@@ -463,7 +463,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-	    l->l_proc->p_ucred->cr_uid != 0)
+	    p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -574,11 +574,11 @@
  * Close a zs serial port.
  */
 int
-zsclose(dev, flags, mode, l)
+zsclose(dev, flags, mode, p)
 	dev_t dev;
 	int flags;
 	int mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct zstty_softc *zst = zstty_cd.cd_devs[ZSUNIT(dev)];
 	struct tty *tp = zst->zst_tty;
@@ -630,24 +630,24 @@
 }
 
 int
-zspoll(dev, events, l)
+zspoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct zstty_softc *zst = zstty_cd.cd_devs[ZSUNIT(dev)];
 	struct tty *tp = zst->zst_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
-zsioctl(dev, cmd, data, flag, l)
+zsioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct zstty_softc *zst = zstty_cd.cd_devs[ZSUNIT(dev)];
 	struct zs_chanstate *cs = zst->zst_cs;
@@ -655,11 +655,11 @@
 	int error;
 	int s;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -687,7 +687,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+		error = suser(p->p_ucred, &p->p_acflag);
 		if (error)
 			break;
 		zst->zst_swflags = *(int *)data;
--- a/sys/arch/macppc/macppc/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/macppc/macppc/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.26 2003/06/28 14:20:59 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.27 2003/06/29 22:28:34 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -324,7 +324,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/mips/alchemy/dev/aucom.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/alchemy/dev/aucom.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,6 +1,6 @@
 #define	AU1x00_UART	/* XXX */
 
-/*	$NetBSD: aucom.c,v 1.8 2003/06/29 13:18:24 simonb Exp $	*/
+/*	$NetBSD: aucom.c,v 1.9 2003/06/29 22:28:35 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
  * XXX: hacked to work with almost 16550-alike Alchemy Au1X00 on-chip uarts
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aucom.c,v 1.8 2003/06/29 13:18:24 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aucom.c,v 1.9 2003/06/29 22:28:35 fvdl Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -830,7 +830,7 @@
 }
 
 int
-comopen(dev_t dev, int flag, int mode, struct lwp *l)
+comopen(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct com_softc *sc;
 	struct tty *tp;
@@ -857,7 +857,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-		l->l_proc->p_ucred->cr_uid != 0)
+		p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -980,7 +980,7 @@
 }
  
 int
-comclose(dev_t dev, int flag, int mode, struct lwp *l)
+comclose(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct com_softc *sc = device_lookup(&com_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -1032,7 +1032,7 @@
 }
 
 int
-compoll(dev_t dev, int events, struct lwp *l)
+compoll(dev_t dev, int events, struct proc *p)
 {
 	struct com_softc *sc = device_lookup(&com_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -1040,7 +1040,7 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -1053,7 +1053,7 @@
 }
 
 int
-comioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
+comioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
 	struct com_softc *sc = device_lookup(&com_cd, COMUNIT(dev));
 	struct tty *tp = sc->sc_tty;
@@ -1063,11 +1063,11 @@
 	if (COM_ISALIVE(sc) == 0)
 		return (EIO);
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -1098,7 +1098,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag); 
+		error = suser(p->p_ucred, &p->p_acflag); 
 		if (error)
 			break;
 		sc->sc_swflags = *(int *)data;
--- a/sys/arch/mips/alchemy/dev/aucom_aubus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/alchemy/dev/aucom_aubus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aucom_aubus.c,v 1.6 2003/06/29 13:18:24 simonb Exp $ */
+/* $NetBSD: aucom_aubus.c,v 1.7 2003/06/29 22:28:35 fvdl Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
--- a/sys/arch/mips/mips/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.8 2003/06/29 11:35:15 simonb Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.9 2003/06/29 22:28:36 fvdl 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.8 2003/06/29 11:35:15 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.9 2003/06/29 22:28:36 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -332,7 +332,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/mips/mips/cpu_exec.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/cpu_exec.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.39 2003/06/29 15:14:13 simonb Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.40 2003/06/29 22:28:36 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -62,7 +62,7 @@
 #include <machine/reg.h>
 #include <mips/regnum.h>			/* symbolic register indices */
 
-int	mips_elf_makecmds(struct lwp *, struct exec_package *);
+int	mips_elf_makecmds(struct proc *, struct exec_package *);
 
 
 /*
@@ -74,8 +74,8 @@
  *
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	int error;
@@ -90,7 +90,7 @@
 #endif
 	{
 		/* If that failed, try old NetBSD-1.1 elf format */
-		error = mips_elf_makecmds (l, epp);
+		error = mips_elf_makecmds (p, epp);
 		return error;
 	}
 
@@ -143,8 +143,8 @@
  * Do any machine-dependent diddling of the exec package when doing ECOFF.
  */
 int
-cpu_exec_ecoff_probe(l, epp)
-	struct lwp *l;
+cpu_exec_ecoff_probe(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 
@@ -154,15 +154,15 @@
 #endif /* EXEC_ECOFF */
 
 /*
- * mips_elf_makecmds (l, epp)
+ * mips_elf_makecmds (p, epp)
  *
  * Test if an executable is a MIPS ELF executable.   If it is,
  * try to load it.
  */
 
 int
-mips_elf_makecmds (l, epp)
-        struct lwp *l;
+mips_elf_makecmds (p, epp)
+        struct proc *p;
         struct exec_package *epp;
 {
 	Elf32_Ehdr *ex = (Elf32_Ehdr *)epp->ep_hdr;
@@ -212,7 +212,7 @@
 		if ((error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t)&ph,
 				    sizeof ph, ex->e_phoff + i * sizeof ph,
 				    UIO_SYSSPACE, IO_NODELOCKED,
-				    l->l_proc->p_ucred, &resid, l))
+				    p->p_ucred, &resid, p))
 		    != 0)
 			return error;
 
@@ -287,7 +287,7 @@
 
 	epp->ep_maxsaddr = USRSTACK - MAXSSIZ;
 	epp->ep_minsaddr = USRSTACK;
-	epp->ep_ssize = l->l_proc->p_rlimit[RLIMIT_STACK].rlim_cur;
+	epp->ep_ssize = p->p_rlimit[RLIMIT_STACK].rlim_cur;
 
 	/*
 	 * set up commands for stack.  note that this takes *two*, one to
--- a/sys/arch/mips/mips/db_interface.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/db_interface.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.48 2003/06/29 11:35:15 simonb Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.49 2003/06/29 22:28:37 fvdl Exp $	*/
 
 /*
  * Mach Operating System
@@ -69,9 +69,9 @@
 static void	kdbpoke_1(vaddr_t addr, char newval);
 static short	kdbpeek_2(vaddr_t addr);
 static char	kdbpeek_1(vaddr_t addr);
-vaddr_t	MachEmulateBranch(struct frame *, vaddr_t, unsigned, int);	/* XXX */
+vaddr_t		MachEmulateBranch(struct frame *, vaddr_t, unsigned, int);
 
-paddr_t kvtophys(vaddr_t);	/* XXX */
+paddr_t kvtophys(vaddr_t);
 
 #ifdef DDB_TRACE
 int
--- a/sys/arch/mips/mips/mips_emul.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/mips_emul.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_emul.c,v 1.5 2003/06/29 12:21:32 simonb Exp $ */
+/*	$NetBSD: mips_emul.c,v 1.6 2003/06/29 22:28:37 fvdl Exp $ */
 
 /*
  * Copyright (c) 1999 Shuichiro URATA.  All rights reserved.
@@ -40,7 +40,7 @@
 #include <mips/vmparam.h>			/* for VM_MAX_ADDRESS */
 #include <mips/trap.h>
 
-void MachEmulateFP(u_int32_t, struct frame *, u_int32_t);	/* XXX */
+void MachEmulateFP(u_int32_t, struct frame *, u_int32_t);
 
 static __inline void	send_sigsegv(u_int32_t, u_int32_t, struct frame *,
 			    u_int32_t);
--- a/sys/arch/mips/mips/mips_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/mips_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.164 2003/06/29 09:24:53 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.165 2003/06/29 22:28:37 fvdl Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -119,7 +119,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.164 2003/06/29 09:24:53 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.165 2003/06/29 22:28:37 fvdl Exp $");
 
 #include "opt_cputype.h"
 
@@ -1116,14 +1116,14 @@
  * Machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 #ifdef __HAVE_BOOTINFO_H
 	struct btinfo_bootpath *bibp;
--- a/sys/arch/mips/mips/trap.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/trap.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.179 2003/06/29 11:32:11 simonb Exp $	*/
+/*	$NetBSD: trap.c,v 1.180 2003/06/29 22:28:38 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.179 2003/06/29 11:32:11 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.180 2003/06/29 22:28:38 fvdl Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ktrace.h"
@@ -154,7 +154,7 @@
 	userret(l);
 #ifdef KTRACE
 	if (KTRPOINT(l->l_proc, KTR_SYSRET))
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(l->l_proc, SYS_fork, 0, 0);
 #endif
 }
 
--- a/sys/arch/mips/mips/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/mips/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.96 2003/06/29 09:24:54 simonb Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.97 2003/06/29 22:28:39 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -45,7 +45,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.96 2003/06/29 09:24:54 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.97 2003/06/29 22:28:39 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -246,6 +246,7 @@
 		struct frame frame;
 		struct fpreg fpregs;
 	} cpustate;
+	struct proc *p = l->l_proc;
 
 	CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
 	chdr->c_hdrsize = ALIGN(sizeof(struct core));
@@ -262,7 +263,7 @@
 	cseg.c_size = chdr->c_cpusize;
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
@@ -270,7 +271,7 @@
 			(off_t)chdr->c_cpusize,
 			(off_t)(chdr->c_hdrsize + chdr->c_seghdrsize),
 			UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT,
-			cred, NULL, l);
+			cred, NULL, p);
 
 	if (!error)
 		chdr->c_nseg++;
--- a/sys/arch/mips/sibyte/dev/sbobio.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/sibyte/dev/sbobio.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbobio.c,v 1.10 2003/06/29 12:20:19 simonb Exp $ */
+/* $NetBSD: sbobio.c,v 1.11 2003/06/29 22:28:40 fvdl Exp $ */
 
 /*
  * Copyright 2000, 2001
--- a/sys/arch/mips/sibyte/dev/sbscn.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mips/sibyte/dev/sbscn.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbscn.c,v 1.9 2003/06/29 09:23:14 simonb Exp $ */
+/* $NetBSD: sbscn.c,v 1.10 2003/06/29 22:28:40 fvdl Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -540,7 +540,7 @@
 }
 
 int
-sbscnopen(dev_t dev, int flag, int mode, struct lwp *l)
+sbscnopen(dev_t dev, int flag, int mode, struct proc *p)
 {
 	int unit = SBSCN_UNIT(dev);
 	int chan = SBSCN_CHAN(dev);
@@ -571,7 +571,7 @@
 
 	if (ISSET(tp->t_state, TS_ISOPEN) &&
 	    ISSET(tp->t_state, TS_XCLUDE) &&
-	    l->l_proc->p_ucred->cr_uid != 0)
+	    p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	s = spltty();
@@ -677,7 +677,7 @@
 }
 
 int
-sbscnclose(dev_t dev, int flag, int mode, struct lwp *l)
+sbscnclose(dev_t dev, int flag, int mode, struct proc *p)
 {
 	struct sbscn_softc *sc = sbscn_cd.cd_devs[SBSCN_UNIT(dev)];
 	struct sbscn_channel *ch = &sc->sc_channels[SBSCN_CHAN(dev)];
@@ -723,13 +723,13 @@
 }
 
 int
-sbscnpoll(dev_t dev, int events, struct lwp *l)
+sbscnpoll(dev_t dev, int events, struct proc *p)
 {
 	struct sbscn_softc *sc = sbscn_cd.cd_devs[SBSCN_UNIT(dev)];
 	struct sbscn_channel *ch = &sc->sc_channels[SBSCN_CHAN(dev)];
 	struct tty *tp = ch->ch_tty;
 
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -743,7 +743,7 @@
 }
 
 int
-sbscnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
+sbscnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
 	struct sbscn_softc *sc = sbscn_cd.cd_devs[SBSCN_UNIT(dev)];
 	struct sbscn_channel *ch = &sc->sc_channels[SBSCN_CHAN(dev)];
@@ -751,11 +751,11 @@
 	int error;
 	int s;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
@@ -785,7 +785,7 @@
 		break;
 
 	case TIOCSFLAGS:
-		error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+		error = suser(p->p_ucred, &p->p_acflag);
 		if (error)
 			break;
 		ch->ch_swflags = *(int *)data;
--- a/sys/arch/mipsco/mipsco/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mipsco/mipsco/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.11 2003/06/28 14:21:01 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.12 2003/06/29 22:28:40 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -356,7 +356,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/mvme68k/mvme68k/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mvme68k/mvme68k/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.22 2003/06/28 14:21:01 darrenr Exp $	*/
+/* $NetBSD: bus_dma.c,v 1.23 2003/06/29 22:28:41 fvdl Exp $	*/
 
 /*
  * This file was taken from from next68k/dev/bus_dma.c, which was originally
@@ -46,7 +46,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22 2003/06/28 14:21:01 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.23 2003/06/29 22:28:41 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -357,7 +357,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_direct_common: USERSPACE but no proc");
--- a/sys/arch/mvme68k/mvme68k/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/mvme68k/mvme68k/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102 2003/06/28 14:21:01 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.103 2003/06/29 22:28:41 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -160,7 +160,7 @@
 int	cpu_dump __P((int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *));
 void	cpu_init_kcore_hdr __P((void));
 u_long	cpu_dump_mempagecnt __P((void));
-int	cpu_exec_aout_makecmds __P((struct lwp *, struct exec_package *));
+int	cpu_exec_aout_makecmds __P((struct proc *, struct exec_package *));
 void	straytrap __P((int, u_short));
 
 /*
@@ -1237,8 +1237,8 @@
  * understand and, if so, set up the vmcmds for it.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-    struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+    struct proc *p;
     struct exec_package *epp;
 {
     return ENOEXEC;
--- a/sys/arch/news68k/news68k/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/news68k/news68k/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.41 2003/06/28 14:21:02 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.42 2003/06/29 22:28:42 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -840,8 +840,8 @@
  *	done on little-endian machines...  -- cgd
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 #if defined(COMPAT_NOMID) || defined(COMPAT_44)
@@ -859,7 +859,7 @@
 	switch (midmag) {
 #ifdef COMPAT_NOMID
 	case (MID_ZERO << 16) | ZMAGIC:
-		error = exec_aout_prep_oldzmagic(l->l_proc, epp);
+		error = exec_aout_prep_oldzmagic(p, epp);
 		return(error);
 #endif
 #ifdef COMPAT_44
--- a/sys/arch/newsmips/newsmips/bus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/newsmips/newsmips/bus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.13 2003/06/28 14:21:02 darrenr Exp $	*/
+/*	$NetBSD: bus.c,v 1.14 2003/06/29 22:28:42 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -424,7 +424,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/next68k/next68k/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/next68k/next68k/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.60 2003/06/28 14:21:02 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.61 2003/06/29 22:28:43 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1021,8 +1021,8 @@
  * understand and, if so, set up the vmcmds for it.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-    struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+    struct proc *p;
     struct exec_package *epp;
 {
     return ENOEXEC;
--- a/sys/arch/pc532/pc532/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pc532/pc532/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.143 2003/06/28 14:21:03 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.144 2003/06/29 22:28:43 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996 Matthias Pfaller.
@@ -1158,8 +1158,8 @@
  * Any takers for Sinix, Genix, SVR2/32000 or Minix?
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return ENOEXEC;
--- a/sys/arch/playstation2/playstation2/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/playstation2/playstation2/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.5 2003/06/28 14:21:04 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.6 2003/06/29 22:28:44 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -318,7 +318,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/playstation2/playstation2/kloader.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/playstation2/playstation2/kloader.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kloader.c,v 1.6 2003/06/28 14:21:04 darrenr Exp $	*/
+/*	$NetBSD: kloader.c,v 1.7 2003/06/29 22:28:44 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -290,7 +290,7 @@
 	struct proc *p = curlwp->l_proc;
 	struct nameidata nid;
 
-	NDINIT(&nid, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, curlwp);
+	NDINIT(&nid, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, p);
 
 	if (namei(&nid) != 0) {
 		DPRINTF("namei failed (%s)\n", filename);
--- a/sys/arch/pmax/dev/dc.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/dev/dc.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: dc.c,v 1.73 2003/06/29 09:56:27 simonb Exp $	*/
+/*	$NetBSD: dc.c,v 1.74 2003/06/29 22:28:45 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.73 2003/06/29 09:56:27 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.74 2003/06/29 22:28:45 fvdl Exp $");
 
 /*
  * devDC7085.c --
@@ -464,10 +464,10 @@
  * open tty
  */
 int
-dcopen(dev, flag, mode, l)
+dcopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 	struct dc_softc *sc;
@@ -535,10 +535,10 @@
 
 /*ARGSUSED*/
 int
-dcclose(dev, flag, mode, l)
+dcclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dc_softc *sc;
 	struct tty *tp;
@@ -599,17 +599,17 @@
 }
 
 int
-dcpoll(dev, events, l)
+dcpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dc_softc *sc;
 	struct tty *tp;
 
 	sc = dc_cd.cd_devs[DCUNIT(dev)];
 	tp = sc->dc_tty[DCLINE(dev)];
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -626,12 +626,12 @@
 
 /*ARGSUSED*/
 int
-dcioctl(dev, cmd, data, flag, l)
+dcioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct dc_softc *sc;
 	struct tty *tp;
@@ -645,11 +645,11 @@
 	sc = dc_cd.cd_devs[unit];
 	tp = sc->dc_tty[line];
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
--- a/sys/arch/pmax/dev/dtop.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/dev/dtop.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtop.c,v 1.65 2003/06/29 09:56:28 simonb Exp $	*/
+/*	$NetBSD: dtop.c,v 1.66 2003/06/29 22:28:45 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -94,7 +94,7 @@
 ********************************************************/
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.65 2003/06/29 09:56:28 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.66 2003/06/29 22:28:45 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "rasterconsole.h"
@@ -305,10 +305,10 @@
 
 
 int
-dtopopen(dev, flag, mode, l)
+dtopopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 	int unit;
@@ -367,10 +367,10 @@
 
 /*ARGSUSED*/
 int
-dtopclose(dev, flag, mode, l)
+dtopclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 	int unit;
@@ -404,15 +404,15 @@
 }
 
 int
-dtoppoll(dev, events, l)
+dtoppoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 
 	tp = DTOP_TTY(minor(dev));
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -425,12 +425,12 @@
 
 /*ARGSUSED*/
 int
-dtopioctl(dev, cmd, data, flag, l)
+dtopioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 	int unit = minor(dev);
@@ -438,11 +438,11 @@
 
 	tp = DTOP_TTY(unit);
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
--- a/sys/arch/pmax/dev/fb_usrreq.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/dev/fb_usrreq.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,7 +1,6 @@
-/*	$NetBSD: fb_usrreq.c,v 1.26 2003/06/29 09:56:28 simonb Exp $	*/
+/*	$NetBSD: fb_usrreq.c,v 1.27 2003/06/29 22:28:46 fvdl Exp $	*/
 
 #include <sys/conf.h>
-#include <sys/lwp.h>
 
 dev_type_open(fbopen);
 dev_type_close(fbclose);
@@ -17,10 +16,10 @@
 
 /*ARGSUSED*/
 int
-fbopen(dev, flag, mode, l)
+fbopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fbinfo *fi;
 
@@ -57,10 +56,10 @@
 
 /*ARGSUSED*/
 int
-fbclose(dev, flag, mode, l)
+fbclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fbinfo *fi;
 	struct pmax_fbtty *fbtty;
@@ -99,11 +98,11 @@
 
 /*ARGSUSED*/
 int
-fbioctl(dev, cmd, data, flag, l)
+fbioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fbinfo *fi;
 	struct pmax_fbtty *fbtty;
@@ -122,7 +121,7 @@
 	 * so that X consortium Xservers work.
 	 */
 	case QIOCGINFO:
-		return (fbmmap_fb(fi, dev, data, l->l_proc));
+		return (fbmmap_fb(fi, dev, data, p));
 
 	case QIOCPMSTATE:
 		/*
@@ -239,10 +238,10 @@
  * Poll on Digital-OS-compatible in-kernel input-event ringbuffer.
  */
 int
-fbpoll(dev, events, l)
+fbpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fbinfo *fi;
 	int revents = 0;
@@ -257,7 +256,7 @@
 		    fi->fi_fbu->scrInfo.qe.eTail)
 		 	revents |= (events & (POLLIN|POLLRDNORM));
 		else
-	  		selrecord(l, &fi->fi_selp);
+	  		selrecord(p, &fi->fi_selp);
 	}
 
 	/* XXX mice are not writable, what to do for poll on write? */
--- a/sys/arch/pmax/dev/px.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/dev/px.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: px.c,v 1.48 2003/06/29 09:56:28 simonb Exp $	*/
+/*	$NetBSD: px.c,v 1.49 2003/06/29 22:28:46 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.48 2003/06/29 09:56:28 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.49 2003/06/29 22:28:46 fvdl Exp $");
 
 /*
  * px.c: driver for the DEC TURBOchannel 2D and 3D accelerated framebuffers
@@ -1661,10 +1661,10 @@
 }
 
 int
-pxopen(dev, flag, mode, l)
+pxopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	extern struct fbinfo *firstfi;		/* XXX */
 	struct stic_regs *stic;
@@ -1702,10 +1702,10 @@
 }
 
 int
-pxclose(dev, flag, mode, l)
+pxclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	extern struct fbinfo *firstfi;		/* XXX */
 	struct stic_regs *stic;
@@ -1749,12 +1749,12 @@
 }
 
 int
-pxioctl(dev, cmd, data, flag, l)
+pxioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct pmax_fbtty *fbtty;
 	struct px_info *pxi;
@@ -1777,7 +1777,7 @@
 		/*
 		 * Map card info.
 		 */
-		return (px_mmap_info(l->l_proc, dev, (vaddr_t *)data));
+		return (px_mmap_info(p, dev, (vaddr_t *)data));
 
 	case QIOCPMSTATE:
 		/*
@@ -1864,10 +1864,10 @@
 }
 
 int
-pxpoll(dev, events, l)
+pxpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fbinfo *fi = &px_unit[minor(dev)]->pxi_fbinfo;
 	int revents = 0;
@@ -1877,7 +1877,7 @@
 		    fi->fi_fbu->scrInfo.qe.eTail)
 		 	revents |= (events & (POLLIN | POLLRDNORM));
 		else
-	  		selrecord(l, &fi->fi_selp);
+	  		selrecord(p, &fi->fi_selp);
 	}
 
 	return (revents);
--- a/sys/arch/pmax/dev/rcons.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/dev/rcons.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: rcons.c,v 1.57 2003/06/29 09:56:29 simonb Exp $	*/
+/*	$NetBSD: rcons.c,v 1.58 2003/06/29 22:28:46 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1995
@@ -315,10 +315,10 @@
 
 /* ARGSUSED */
 int
-rconsopen(dev, flag, mode, l)
+rconsopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp = &rcons_tty [0];
  	/*static int firstopen = 1;*/
@@ -336,7 +336,7 @@
 		tp->t_state = TS_ISOPEN | TS_CARR_ON;
 		(void)(*tp->t_param)(tp, &tp->t_termios);
 		ttsetwater(tp);
-	} else if (tp->t_state & TS_XCLUDE && l->l_proc->p_ucred->cr_uid != 0)
+	} else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
 		return (EBUSY);
 
 	status = (*tp->t_linesw->l_open)(dev, tp);
@@ -345,10 +345,10 @@
 
 /* ARGSUSED */
 int
-rconsclose(dev, flag, mode, l)
+rconsclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp = &rcons_tty [0];
 
@@ -384,15 +384,15 @@
 }
 
 int
-rconspoll(dev, events, l)
+rconspoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 
 	tp = &rcons_tty [0];
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -405,20 +405,20 @@
 }
 
 int
-rconsioctl(dev, cmd, data, flag, l)
+rconsioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tty *tp;
 	int error;
 
 	tp = &rcons_tty [0];
-	if ((error = tp->t_linesw->l_ioctl(tp, cmd, data, flag, l)) != EPASSTHROUGH)
+	if ((error = tp->t_linesw->l_ioctl(tp, cmd, data, flag, p)) != EPASSTHROUGH)
 		return (error);
-	return ttioctl(tp, cmd, data, flag, l);
+	return ttioctl(tp, cmd, data, flag, p);
 }
 
 #ifdef notyet
--- a/sys/arch/pmax/pmax/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/pmax/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.36 2003/06/28 14:21:04 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.37 2003/06/29 22:28:47 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -365,7 +365,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/pmax/tc/scc.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/pmax/tc/scc.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: scc.c,v 1.80 2003/06/29 09:56:29 simonb Exp $	*/
+/*	$NetBSD: scc.c,v 1.81 2003/06/29 22:28:47 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.80 2003/06/29 09:56:29 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.81 2003/06/29 22:28:47 fvdl Exp $");
 
 /*
  * Intel 82530 dual usart chip driver. Supports the serial port(s) on the
@@ -616,10 +616,10 @@
 }
 
 int
-sccopen(dev, flag, mode, l)
+sccopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct scc_softc *sc;
 	struct tty *tp;
@@ -697,10 +697,10 @@
 
 /*ARGSUSED*/
 int
-sccclose(dev, flag, mode, l)
+sccclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct scc_softc *sc = scc_cd.cd_devs[SCCUNIT(dev)];
 	struct tty *tp;
@@ -748,17 +748,17 @@
 }
 
 int
-sccpoll(dev, events, l)
+sccpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct scc_softc *sc;
 	struct tty *tp;
 
 	sc = scc_cd.cd_devs[SCCUNIT(dev)];	/* XXX*/
 	tp = sc->scc_tty[SCCLINE(dev)];
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 struct tty *
@@ -777,12 +777,12 @@
 
 /*ARGSUSED*/
 int
-sccioctl(dev, cmd, data, flag, l)
+sccioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct scc_softc *sc;
 	struct tty *tp;
@@ -792,11 +792,11 @@
 	sc = scc_cd.cd_devs[SCCUNIT(dev)];
 	tp = sc->scc_tty[line];
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return (error);
 
--- a/sys/arch/powerpc/include/ptrace.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/include/ptrace.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.6 2003/06/29 11:02:23 darrenr Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.7 2003/06/29 22:28:48 fvdl Exp $	*/
 
 #ifndef _POWERPC_PTRACE_H
 #define	_POWERPC_PTRACE_H
@@ -25,8 +25,8 @@
 	case PT_GETVECREGS: \
 	case PT_SETVECREGS:
 
-int ptrace_machdep_dorequest(struct lwp *, struct lwp *, int, caddr_t, int);
-int process_machdep_dovecregs(struct lwp *, struct lwp *, struct uio *);
+int ptrace_machdep_dorequest(struct proc *, struct lwp *, int, caddr_t, int);
+int process_machdep_dovecregs(struct proc *, struct lwp *, struct uio *);
 int process_machdep_validvecregs(struct proc *);
 
 /* We have machine-dependent procfs nodes.  */
@@ -48,9 +48,9 @@
 /* Functions used by procfs.  */
 struct mount;
 struct pfsnode;
-int procfs_machdep_dovecregs(struct lwp *, struct lwp *,
+int procfs_machdep_dovecregs(struct proc *, struct lwp *,
 	struct pfsnode *, struct uio *);
-int procfs_machdep_validvecregs(struct lwp *, struct mount *);
+int procfs_machdep_validvecregs(struct proc *, struct mount *);
 
 #endif /* ALTIVEC */
 #endif /* _KERNEL */
--- a/sys/arch/powerpc/marvell/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/marvell/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.3 2003/06/28 14:21:04 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.4 2003/06/29 22:28:49 fvdl Exp $	*/
 
 #define DEBUG 1
 
@@ -413,7 +413,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/powerpc/powerpc/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/powerpc/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.14 2003/06/28 14:21:05 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.15 2003/06/29 22:28:49 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -377,7 +377,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: powerpc_machdep.c,v 1.19 2003/06/29 11:02:23 darrenr Exp $	*/
+/*	$NetBSD: powerpc_machdep.c,v 1.20 2003/06/29 22:28:49 fvdl Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -109,14 +109,14 @@
  * Machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	/* all sysctl names at this level are terminal */
 	if (namelen != 1)
--- a/sys/arch/powerpc/powerpc/process_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/powerpc/process_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.14 2003/06/29 11:02:24 darrenr Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.15 2003/06/29 22:28:49 fvdl Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -173,7 +173,7 @@
 }
 
 int
-ptrace_machdep_dorequest(struct lwp *curl, struct lwp *l,
+ptrace_machdep_dorequest(struct proc *p, struct lwp *l,
 	int req, caddr_t addr, int data)
 {
 	struct uio uio;
@@ -196,8 +196,8 @@
 		uio.uio_resid = sizeof(struct vreg);
 		uio.uio_segflg = UIO_USERSPACE;
 		uio.uio_rw = write ? UIO_WRITE : UIO_READ;
-		uio.uio_lwp = l;
-		return process_machdep_dovecregs(l, l, &uio);
+		uio.uio_procp = p;
+		return process_machdep_dovecregs(p, l, &uio);
 	}
 
 #ifdef DIAGNOSTIC
@@ -212,14 +212,14 @@
  */
 
 int
-process_machdep_dovecregs(struct lwp *curl, struct lwp *l, struct uio *uio)
+process_machdep_dovecregs(struct proc *curp, struct lwp *l, struct uio *uio)
 {
 	struct vreg r;
 	int error;
 	char *kv;
 	int kl;
 
-	if ((error = process_checkioperm(curl, l->l_proc)) != 0)
+	if ((error = process_checkioperm(curp, l->l_proc)) != 0)
 		return (error);
 
 	kl = sizeof(r);
--- a/sys/arch/powerpc/powerpc/procfs_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/powerpc/procfs_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.2 2003/06/29 11:02:24 darrenr Exp $	*/
+/*	$NetBSD: procfs_machdep.c,v 1.3 2003/06/29 22:28:50 fvdl Exp $	*/
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -40,13 +40,13 @@
 }
 
 int
-procfs_machdep_rw(struct lwp *curl, struct lwp *l, struct pfsnode *pfs,
+procfs_machdep_rw(struct proc *curp, struct lwp *l, struct pfsnode *pfs,
     struct uio *uio)
 {
 
 	switch (pfs->pfs_type) {
 	case Pmachdep_vecregs:
-		return (procfs_machdep_dovecregs(curl, l, pfs, uio));
+		return (procfs_machdep_dovecregs(curp, l, pfs, uio));
 
 	default:
 		panic("procfs_machdep_rw");
@@ -74,17 +74,17 @@
 }
 
 int
-procfs_machdep_dovecregs(struct lwp *curl, struct lwp *l,
+procfs_machdep_dovecregs(struct proc *curp, struct lwp *l,
     struct pfsnode *pfs, struct uio *uio)
 {
 
-	return (process_machdep_dovecregs(curl, l, uio));
+	return (process_machdep_dovecregs(curp, l, uio));
 }
 
 int
-procfs_machdep_validvecregs(struct lwp *l, struct mount *mp)
+procfs_machdep_validvecregs(struct proc *p, struct mount *mp)
 {
 
-	return (process_machdep_validvecregs(l->l_proc));
+	return (process_machdep_validvecregs(p));
 }
 #endif
--- a/sys/arch/powerpc/powerpc/syscall.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/powerpc/syscall.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.20 2003/06/28 14:21:05 darrenr Exp $	*/
+/*	$NetBSD: syscall.c,v 1.21 2003/06/29 22:28:50 fvdl Exp $	*/
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -69,7 +69,7 @@
 #define EMULNAME(x)	(x)
 #define EMULNAMEU(x)	(x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.20 2003/06/28 14:21:05 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.21 2003/06/29 22:28:50 fvdl Exp $");
 
 void
 child_return(void *arg)
@@ -91,7 +91,7 @@
 #ifdef	KTRACE
 	if (KTRPOINT(p, KTR_SYSRET)) {
 		KERNEL_PROC_LOCK(l);
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(p, SYS_fork, 0, 0);
 		KERNEL_PROC_UNLOCK(l);
 	}
 #endif
--- a/sys/arch/powerpc/powerpc/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.51 2003/06/29 11:02:24 darrenr Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.52 2003/06/29 22:28:50 fvdl Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -269,6 +269,7 @@
 {
 	struct coreseg cseg;
 	struct md_coredump md_core;
+	struct proc *p = l->l_proc;
 	struct pcb *pcb = &l->l_addr->u_pcb;
 	int error;
 
@@ -302,11 +303,11 @@
 
 	if ((error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 			    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-			    IO_NODELOCKED|IO_UNIT, cred, NULL, l)) != 0)
+			    IO_NODELOCKED|IO_UNIT, cred, NULL, p)) != 0)
 		return error;
 	if ((error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof md_core,
 			    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-			    IO_NODELOCKED|IO_UNIT, cred, NULL, l)) != 0)
+			    IO_NODELOCKED|IO_UNIT, cred, NULL, p)) != 0)
 		return error;
 
 	chdr->c_nseg++;
--- a/sys/arch/sgimips/sgimips/bus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sgimips/sgimips/bus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.18 2003/06/28 14:21:05 darrenr Exp $	*/
+/*	$NetBSD: bus.c,v 1.19 2003/06/29 22:28:52 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -542,7 +542,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/sh3/sh3/coff_exec.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sh3/sh3/coff_exec.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: coff_exec.c,v 1.18 2003/06/28 14:21:06 darrenr Exp $	*/
+/*	$NetBSD: coff_exec.c,v 1.19 2003/06/29 22:28:52 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -62,12 +62,11 @@
  */
 
 int
-exec_coff_makecmds(struct lwp *l, struct exec_package *epp)
+exec_coff_makecmds(struct proc *p, struct exec_package *epp)
 {
 	int error;
 	struct coff_filehdr *fp = epp->ep_hdr;
 	struct coff_aouthdr *ap;
-	struct proc *p;
 
 	if (epp->ep_hdrvalid < COFF_HDR_SIZE)
 		return ENOEXEC;
@@ -75,7 +74,6 @@
 	if (COFF_BADMAG(fp))
 		return ENOEXEC;
 
-	p = l->l_proc;
 	ap = (void *)((char *)epp->ep_hdr + sizeof(struct coff_filehdr));
 	switch (ap->a_magic) {
 	case COFF_OMAGIC:
@@ -419,7 +417,7 @@
 
 #if 0
 int
-coff_load_shlib(struct lwp *l, char *path, struct exec_package *epp)
+coff_load_shlib(struct proc *p, char *path, struct exec_package *epp)
 {
 	int error, siz, resid;
 	int taddr, tsize, daddr, dsize, offset;
@@ -436,7 +434,7 @@
 #ifdef TODO
 	IBCS2_CHECK_ALT_EXIST(p, &sg, path);
 #endif
-	NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, l);
+	NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p);
 	/* first get the vnode */
 	if ((error = namei(&nd)) != 0) {
 		DPRINTF(("coff_load_shlib: can't find library %s\n", path));
--- a/sys/arch/sh3/sh3/exception.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sh3/sh3/exception.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception.c,v 1.7 2003/06/28 14:21:06 darrenr Exp $	*/
+/*	$NetBSD: exception.c,v 1.8 2003/06/29 22:28:52 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -541,7 +541,7 @@
 	userret(l);
 #ifdef KTRACE
 	if (KTRPOINT(p, KTR_SYSRET))
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(p, SYS_fork, 0, 0);
 #endif
 }
 
--- a/sys/arch/sh5/sh5/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sh5/sh5/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.9 2003/06/28 14:21:06 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.10 2003/06/29 22:28:53 fvdl 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.9 2003/06/28 14:21:06 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.10 2003/06/29 22:28:53 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -382,7 +382,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio_direct: USERSPACE but no proc");
--- a/sys/arch/sh5/sh5/syscall.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sh5/sh5/syscall.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.9 2003/06/28 14:21:06 darrenr Exp $	*/
+/*	$NetBSD: syscall.c,v 1.10 2003/06/29 22:28:53 fvdl Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -424,6 +424,6 @@
 
 #ifdef KTRACE
 	if (KTRPOINT(l->l_proc, KTR_SYSRET))
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(l->l_proc, SYS_fork, 0, 0);
 #endif
 }
--- a/sys/arch/sparc/dev/cgeight.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/cgeight.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgeight.c,v 1.33 2003/06/29 09:56:24 darrenr Exp $	*/
+/*	$NetBSD: cgeight.c,v 1.34 2003/06/29 22:28:53 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -315,10 +315,10 @@
 }
 
 int
-cgeightopen(dev, flags, mode, l)
+cgeightopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = minor(dev);
 
@@ -328,12 +328,12 @@
 }
 
 int
-cgeightioctl(dev, cmd, data, flags, l)
+cgeightioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 #if defined(SUN4)
 	struct cgeight_softc *sc = cgeight_cd.cd_devs[minor(dev)];
--- a/sys/arch/sparc/dev/cgfour.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/cgfour.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfour.c,v 1.32 2003/06/29 09:56:24 darrenr Exp $	*/
+/*	$NetBSD: cgfour.c,v 1.33 2003/06/29 22:28:54 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -311,10 +311,10 @@
 }
 
 int
-cgfouropen(dev, flags, mode, l)
+cgfouropen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = minor(dev);
 
@@ -324,12 +324,12 @@
 }
 
 int
-cgfourioctl(dev, cmd, data, flags, l)
+cgfourioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 #if defined(SUN4)
 	struct cgfour_softc *sc = cgfour_cd.cd_devs[minor(dev)];
--- a/sys/arch/sparc/dev/cgfourteen.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/cgfourteen.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfourteen.c,v 1.33 2003/06/29 09:56:24 darrenr Exp $ */
+/*	$NetBSD: cgfourteen.c,v 1.34 2003/06/29 22:28:54 fvdl Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -315,10 +315,10 @@
 static int cg14_opens = 0;
 
 int
-cgfourteenopen(dev, flags, mode, l)
+cgfourteenopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct cgfourteen_softc *sc = cgfourteen_cd.cd_devs[minor(dev)];
 	int unit = minor(dev);
@@ -340,10 +340,10 @@
 }
 
 int
-cgfourteenclose(dev, flags, mode, l)
+cgfourteenclose(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct cgfourteen_softc *sc = cgfourteen_cd.cd_devs[minor(dev)];
 	int s, opens;
@@ -364,12 +364,12 @@
 }
 
 int
-cgfourteenioctl(dev, cmd, data, flags, l)
+cgfourteenioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct cgfourteen_softc *sc = cgfourteen_cd.cd_devs[minor(dev)];
 	struct fbgattr *fba;
--- a/sys/arch/sparc/dev/cgtwo.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/cgtwo.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgtwo.c,v 1.44 2003/06/29 09:56:24 darrenr Exp $ */
+/*	$NetBSD: cgtwo.c,v 1.45 2003/06/29 22:28:55 fvdl Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -227,10 +227,10 @@
 }
 
 int
-cgtwoopen(dev, flags, mode, l)
+cgtwoopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = minor(dev);
 
@@ -240,12 +240,12 @@
 }
 
 int
-cgtwoioctl(dev, cmd, data, flags, l)
+cgtwoioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	register caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 	register struct cgtwo_softc *sc = cgtwo_cd.cd_devs[minor(dev)];
 	register struct fbgattr *fba;
--- a/sys/arch/sparc/dev/fd.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/fd.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.108 2003/06/29 09:56:25 darrenr Exp $	*/
+/*	$NetBSD: fd.c,v 1.109 2003/06/29 22:28:55 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -1063,10 +1063,10 @@
 }
 
 int
-fdopen(dev, flags, fmt, l)
+fdopen(dev, flags, fmt, p)
 	dev_t dev;
 	int flags, fmt;
-	struct lwp *l;
+	struct proc *p;
 {
  	int unit, pmask;
 	struct fd_softc *fd;
@@ -1114,10 +1114,10 @@
 }
 
 int
-fdclose(dev, flags, fmt, l)
+fdclose(dev, flags, fmt, p)
 	dev_t dev;
 	int flags, fmt;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
 	int pmask = (1 << DISKPART(dev));
@@ -1863,12 +1863,12 @@
 }
 
 int
-fdioctl(dev, cmd, addr, flag, l)
+fdioctl(dev, cmd, addr, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t addr;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct fd_softc *fd;
 	struct fdc_softc *fdc;
@@ -2051,7 +2051,7 @@
 			fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
 		}
 
-		error = fdformat(dev, fd_formb, l->l_proc);
+		error = fdformat(dev, fd_formb, p);
 		free(fd_formb, M_TEMP);
 		return error;
 
--- a/sys/arch/sparc/dev/kd.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/kd.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kd.c,v 1.24 2003/06/29 09:56:25 darrenr Exp $	*/
+/*	$NetBSD: kd.c,v 1.25 2003/06/29 22:28:56 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -190,10 +190,10 @@
 }
 
 int
-kdopen(dev, flag, mode, l)
+kdopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	int error, s, unit;
@@ -215,7 +215,7 @@
 	/* It's simpler to do this up here. */
 	if (((tp->t_state & (TS_ISOPEN | TS_XCLUDE))
 	     ==             (TS_ISOPEN | TS_XCLUDE))
-	    && (l->l_proc->p_ucred->cr_uid != 0) )
+	    && (p->p_ucred->cr_uid != 0) )
 	{
 		return (EBUSY);
 	}
@@ -252,10 +252,10 @@
 }
 
 int
-kdclose(dev, flag, mode, l)
+kdclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	struct tty *tp;
@@ -308,10 +308,10 @@
 }
 
 int
-kdpoll(dev, events, l)
+kdpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	struct tty *tp;
@@ -319,16 +319,16 @@
 	kd = &kd_softc; 	/* XXX */
 	tp = kd->kd_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
-kdioctl(dev, cmd, data, flag, l)
+kdioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	struct tty *tp;
@@ -337,11 +337,11 @@
 	kd = &kd_softc; 	/* XXX */
 	tp = kd->kd_tty;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
 
--- a/sys/arch/sparc/dev/tctrl.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/dev/tctrl.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: tctrl.c,v 1.23 2003/06/29 09:56:25 darrenr Exp $	*/
+/*	$NetBSD: tctrl.c,v 1.24 2003/06/29 22:28:56 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -897,10 +897,10 @@
 }
 
 int
-tctrlopen(dev, flags, mode, l)
+tctrlopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int unit = (minor(dev)&0xf0);
 	int ctl = (minor(dev)&0x0f);
@@ -931,10 +931,10 @@
 }
 
 int
-tctrlclose(dev, flags, mode, l)
+tctrlclose(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	int ctl = (minor(dev)&0x0f);
 	struct tctrl_softc *sc;
@@ -954,14 +954,13 @@
 }
 
 int
-tctrlioctl(dev, cmd, data, flags, l)
+tctrlioctl(dev, cmd, data, flags, p)
         dev_t dev;
         u_long cmd;
         caddr_t data;
         int flags;
-        struct lwp *l;
+        struct proc *p;
 {
-	struct proc *p = l->l_proc;
 	struct tctrl_req req, *reqn;
 	struct tctrl_pwr *pwrreq;  
 	envsys_range_t *envrange;
@@ -1195,10 +1194,10 @@
 }
 
 int
-tctrlpoll(dev, events, l)
+tctrlpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct tctrl_softc *sc = tctrl_cd.cd_devs[TCTRL_STD_DEV];
 	int revents = 0;
@@ -1207,7 +1206,7 @@
 		if (sc->sc_event_count)
 			revents |= events & (POLLIN | POLLRDNORM);
 		else
-			selrecord(l, &sc->sc_rsel);
+			selrecord(p, &sc->sc_rsel);
 	}
 
 	return (revents);
--- a/sys/arch/sparc/sparc/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/sparc/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.227 2003/06/29 09:56:26 darrenr Exp $ */
+/*	$NetBSD: machdep.c,v 1.228 2003/06/29 22:28:57 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -466,14 +466,14 @@
  * machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	char *cp;
 	struct btinfo_kernelfile *bi_file;
@@ -1226,8 +1226,8 @@
 }
 
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return (ENOEXEC);
--- a/sys/arch/sparc/sparc/openprom.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/sparc/openprom.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: openprom.c,v 1.15 2003/06/29 09:56:26 darrenr Exp $ */
+/*	$NetBSD: openprom.c,v 1.16 2003/06/29 22:28:58 fvdl Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -74,10 +74,10 @@
 static int openpromgetstr __P((int, char *, char **));
 
 int
-openpromopen(dev, flags, mode, l)
+openpromopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 #if defined(SUN4)
 	if (cputyp==CPU_SUN4)
@@ -122,12 +122,12 @@
 }
 
 int
-openpromioctl(dev, cmd, data, flags, l)
+openpromioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct opiocdesc *op;
 	int node, len, ok, error, s;
--- a/sys/arch/sparc/sparc/trap.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/sparc/trap.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.135 2003/06/28 14:21:07 darrenr Exp $ */
+/*	$NetBSD: trap.c,v 1.136 2003/06/29 22:28:58 fvdl Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -1449,7 +1449,7 @@
 	p = l->l_proc;
 	if (KTRPOINT(p, KTR_SYSRET)) {
 		KERNEL_PROC_LOCK(l);
-		ktrsysret(l,
+		ktrsysret(p,
 			  (p->p_flag & P_PPWAIT) ? SYS_vfork : SYS_fork, 0, 0);
 		KERNEL_PROC_UNLOCK(l);
 	}
--- a/sys/arch/sparc/sparc/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc/sparc/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.75 2003/06/29 09:56:27 darrenr Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.76 2003/06/29 22:28:59 fvdl Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -405,13 +405,13 @@
 	cseg.c_size = chdr->c_cpusize;
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (!error)
 		chdr->c_nseg++;
 
--- a/sys/arch/sparc64/dev/kd.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/dev/kd.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kd.c,v 1.25 2003/06/29 10:29:17 martin Exp $	*/
+/*	$NetBSD: kd.c,v 1.26 2003/06/29 22:28:59 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -176,10 +176,10 @@
 }
 
 int
-kdopen(dev, flag, mode, l)
+kdopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	int error, s, unit;
@@ -200,7 +200,7 @@
 	/* It's simpler to do this up here. */
 	if (((tp->t_state & (TS_ISOPEN | TS_XCLUDE))
 	     ==             (TS_ISOPEN | TS_XCLUDE))
-	    && (!suser(l->l_proc->p_ucred, &l->l_proc->p_acflag)) )
+	    && (p->p_ucred->cr_uid != 0) )
 	{
 		return (EBUSY);
 	}
@@ -239,10 +239,10 @@
 }
 
 int
-kdclose(dev, flag, mode, l)
+kdclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	struct tty *tp;
@@ -295,10 +295,10 @@
 }
 
 int
-kdpoll(dev, events, l)
+kdpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	struct tty *tp;
@@ -306,16 +306,16 @@
 	kd = &kd_softc; 	/* XXX */
 	tp = kd->kd_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
-kdioctl(dev, cmd, data, flag, l)
+kdioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct kd_softc *kd;
 	struct tty *tp;
@@ -324,11 +324,11 @@
 	kd = &kd_softc; 	/* XXX */
 	tp = kd->kd_tty;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
 
-	error = ttioctl(tp, cmd, data, flag, l);
+	error = ttioctl(tp, cmd, data, flag, p);
 	if (error != EPASSTHROUGH)
 		return error;
 
--- a/sys/arch/sparc64/dev/pcons.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/dev/pcons.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcons.c,v 1.15 2003/06/29 10:29:33 martin Exp $	*/
+/*	$NetBSD: pcons.c,v 1.16 2003/06/29 22:28:59 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 2000 Eduardo E. Horvath
@@ -119,10 +119,10 @@
 static void pcons_poll __P((void *));
 
 int
-pconsopen(dev, flag, mode, l)
+pconsopen(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct pconssoftc *sc;
 	int unit = minor(dev);
@@ -148,7 +148,7 @@
 		tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
 		pconsparam(tp, &tp->t_termios);
 		ttsetwater(tp);
-	} else if ((tp->t_state&TS_XCLUDE) && suser(l->l_proc->p_ucred, &l->l_proc->p_acflag))
+	} else if ((tp->t_state&TS_XCLUDE) && suser(p->p_ucred, &p->p_acflag))
 		return EBUSY;
 	tp->t_state |= TS_CARR_ON;
 	
@@ -161,10 +161,10 @@
 }
 
 int
-pconsclose(dev, flag, mode, l)
+pconsclose(dev, flag, mode, p)
 	dev_t dev;
 	int flag, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct pconssoftc *sc = pcons_cd.cd_devs[minor(dev)];
 	struct tty *tp = sc->of_tty;
@@ -201,32 +201,32 @@
 }
 
 int
-pconspoll(dev, events, l)
+pconspoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct pconssoftc *sc = pcons_cd.cd_devs[minor(dev)];
 	struct tty *tp = sc->of_tty;
  
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
-pconsioctl(dev, cmd, data, flag, l)
+pconsioctl(dev, cmd, data, flag, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flag;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct pconssoftc *sc = pcons_cd.cd_devs[minor(dev)];
 	struct tty *tp = sc->of_tty;
 	int error;
 	
-	if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l)) != EPASSTHROUGH)
+	if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p)) != EPASSTHROUGH)
 		return error;
-	return ttioctl(tp, cmd, data, flag, l);
+	return ttioctl(tp, cmd, data, flag, p);
 }
 
 struct tty *
--- a/sys/arch/sparc64/dev/sab.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/dev/sab.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: sab.c,v 1.12 2003/06/29 10:29:34 martin Exp $	*/
+/*	$NetBSD: sab.c,v 1.13 2003/06/29 22:29:00 fvdl Exp $	*/
 /*	$OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $	*/
 
 /*
@@ -625,10 +625,10 @@
 }
 
 int
-sabopen(dev, flags, mode, l)
+sabopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sabtty_softc *sc;
 	struct tty *tp;
@@ -685,7 +685,7 @@
 		else
 			tp->t_state &= ~TS_CARR_ON;
 	} else if ((tp->t_state & TS_XCLUDE) &&
-	    (!suser(l->l_proc->p_ucred, &l->l_proc->p_acflag))) {
+	    (!suser(p->p_ucred, &p->p_acflag))) {
 		return (EBUSY);
 	} else {
 		s = spltty();
@@ -727,10 +727,10 @@
 }
 
 int
-sabclose(dev, flags, mode, l)
+sabclose(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sabtty_softc *sc = device_lookup(&sabtty_cd, SABUNIT(dev));
 	struct sab_softc *bc = sc->sc_parent;
@@ -794,22 +794,22 @@
 }
 
 int
-sabioctl(dev, cmd, data, flags, l)
+sabioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sabtty_softc *sc = device_lookup(&sabtty_cd, SABUNIT(dev));
 	struct tty *tp = sc->sc_tty;
 	int error;
 
-	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flags, l);
+	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flags, p);
 	if (error >= 0)
 		return (error);
 
-	error = ttioctl(tp, cmd, data, flags, l);
+	error = ttioctl(tp, cmd, data, flags, p);
 	if (error >= 0)
 		return (error);
 
@@ -846,7 +846,7 @@
 		*((int *)data) = sc->sc_openflags;
 		break;
 	case TIOCSFLAGS:
-		if (suser(l->l_proc->p_ucred, &l->l_proc->p_acflag))
+		if (suser(p->p_ucred, &p->p_acflag))
 			error = EPERM;
 		else
 			sc->sc_openflags = *((int *)data) &
@@ -889,15 +889,15 @@
 }
 
 int
-sabpoll(dev, events, l)
+sabpoll(dev, events, p)
 	dev_t dev;
 	int events;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct sabtty_softc *sc = device_lookup(&sabtty_cd, SABUNIT(dev));
 	struct tty *tp = sc->sc_tty;
 
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return ((*tp->t_linesw->l_poll)(tp, events, p));
 }
 
 int
--- a/sys/arch/sparc64/include/netbsd32_machdep.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/include/netbsd32_machdep.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.h,v 1.13 2003/06/29 13:33:51 martin Exp $	*/
+/*	$NetBSD: netbsd32_machdep.h,v 1.14 2003/06/29 22:29:00 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -82,6 +82,6 @@
  * Need to plug into get sparc specific ioctl's.
  */
 #define	NETBSD32_MD_IOCTL	/* enable netbsd32_md_ioctl() */
-int netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct lwp *);
+int netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct proc *);
 
 #endif /* _MACHINE_NETBSD32_H_ */
--- a/sys/arch/sparc64/sparc64/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.144 2003/06/29 10:37:45 martin Exp $ */
+/*	$NetBSD: machdep.c,v 1.145 2003/06/29 22:29:01 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -458,14 +458,14 @@
  * machine dependent system variables.
  */
 int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, l)
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlenp;
 	void *newp;
 	size_t newlen;
-	struct lwp *l;
+	struct proc *p;
 {
 	u_int chosen;
 	char bootargs[256];
@@ -1178,8 +1178,8 @@
 
 
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return (ENOEXEC);
@@ -1443,7 +1443,7 @@
 	bus_dma_segment_t segs[MAX_DMA_SEGS];
 	int i, j;
 	size_t len;
-	struct proc *p = uio->uio_lwp->l_proc;
+	struct proc *p = uio->uio_procp;
 	struct pmap *pm;
 
 	/*
--- a/sys/arch/sparc64/sparc64/mem.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/sparc64/mem.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.26 2003/06/28 14:21:09 darrenr Exp $ */
+/*	$NetBSD: mem.c,v 1.27 2003/06/29 22:29:01 fvdl Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -144,7 +144,7 @@
 			/* However, we do need to partially re-implement uiomove() */
 			if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
 				panic("mmrw: uio mode");
-			if (uio->uio_segflg == UIO_USERSPACE && uio->uio_lwp != curlwp)
+			if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curlwp)
 				panic("mmrw: uio proc");
 			while (c > 0 && uio->uio_resid) {
 				struct iovec *iov;
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.33 2003/06/29 13:33:53 martin Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.34 2003/06/29 22:29:02 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -618,6 +618,7 @@
 	int i, error;
 	struct md_coredump32 md_core;
 	struct coreseg32 cseg;
+	struct proc *p = l->l_proc;
 
 	CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
 	chdr->c_hdrsize = ALIGN(sizeof(*chdr));
@@ -658,13 +659,13 @@
 	cseg.c_size = chdr->c_cpusize;
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, p);
 	if (!error)
 		chdr->c_nseg++;
 
@@ -1041,11 +1042,11 @@
 }
 
 int
-netbsd32_md_ioctl(fp, com, data32, l)
+netbsd32_md_ioctl(fp, com, data32, p)
 	struct file *fp;
 	netbsd32_u_long com;
 	void *data32;
-	struct lwp *l;
+	struct proc *p;
 {
 	u_int size;
 	caddr_t data, memp = NULL;
@@ -1071,7 +1072,7 @@
 	case OPIOCNEXTPROP32:
 		IOCTL_STRUCT_CONV_TO(OPIOCNEXTPROP, opiocdesc);
 	default:
-		error = (*fp->f_ops->fo_ioctl)(fp, com, data32, l);
+		error = (*fp->f_ops->fo_ioctl)(fp, com, data32, p);
 	}
 	if (memp)
 		free(memp, M_IOCTLOPS);
--- a/sys/arch/sparc64/sparc64/openprom.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/sparc64/openprom.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: openprom.c,v 1.10 2003/06/29 10:37:46 martin Exp $ */
+/*	$NetBSD: openprom.c,v 1.11 2003/06/29 22:29:02 fvdl Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -76,10 +76,10 @@
 static int openpromgetstr __P((int, char *, char **));
 
 int
-openpromopen(dev, flags, mode, l)
+openpromopen(dev, flags, mode, p)
 	dev_t dev;
 	int flags, mode;
-	struct lwp *l;
+	struct proc *p;
 {
 #if defined(SUN4)
 	if (cputyp==CPU_SUN4)
@@ -124,12 +124,12 @@
 }
 
 int
-openpromioctl(dev, cmd, data, flags, l)
+openpromioctl(dev, cmd, data, flags, p)
 	dev_t dev;
 	u_long cmd;
 	caddr_t data;
 	int flags;
-	struct lwp *l;
+	struct proc *p;
 {
 	struct opiocdesc *op;
 	int node, len, ok, error, s;
--- a/sys/arch/sparc64/sparc64/trap.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/sparc64/trap.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.90 2003/06/28 14:21:09 darrenr Exp $ */
+/*	$NetBSD: trap.c,v 1.91 2003/06/29 22:29:02 fvdl Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -1939,7 +1939,7 @@
 		
 #ifdef KTRACE
 		if (KTRPOINT(p, KTR_SYSCALL))
-			ktrsyscall(l, code, code, NULL, (register_t *)args.l);
+			ktrsyscall(p, code, code, NULL, (register_t *)args.l);
 #endif
 		if (error)
 			goto bad;
@@ -2012,9 +2012,9 @@
 			i = callp->sy_narg;
 			for (j = 0; j < i; j++) 
 				temp[j] = args.i[j];
-			ktrsyscall(l, code, code, NULL, (register_t *)temp);
+			ktrsyscall(p, code, code, NULL, (register_t *)temp);
 #else
-			ktrsyscall(l, code, code, NULL, (register_t *)&args.i);
+			ktrsyscall(p, code, code, NULL, (register_t *)&args.i);
 #endif
 		}
 #endif /* KTRACE */
@@ -2132,7 +2132,7 @@
 	userret(l, pc, sticks);
 #ifdef KTRACE
 	if (KTRPOINT(p, KTR_SYSRET))
-		ktrsysret(l, code, error, rval);
+		ktrsysret(p, code, error, rval);
 #endif
 	share_fpu(l, tf);
 #ifdef DEBUG
@@ -2165,7 +2165,7 @@
 	userret(l, l->l_md.md_tf->tf_pc, 0);
 #ifdef KTRACE
 	if (KTRPOINT(p, KTR_SYSRET))
-		ktrsysret(l,
+		ktrsysret(p,
 			  (p->p_flag & P_PPWAIT) ? SYS_vfork : SYS_fork, 0, 0);
 #endif
 }
--- a/sys/arch/sparc64/sparc64/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sparc64/sparc64/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.48 2003/06/29 10:37:46 martin Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.49 2003/06/29 22:29:03 fvdl Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -453,13 +453,13 @@
 	cseg.c_size = chdr->c_cpusize;
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
 	    (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, l->l_proc);
 	if (error)
 		return error;
 
 	error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
 	    (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
-	    IO_NODELOCKED|IO_UNIT, cred, NULL, l);
+	    IO_NODELOCKED|IO_UNIT, cred, NULL, l->l_proc);
 	if (!error)
 		chdr->c_nseg++;
 
--- a/sys/arch/sun2/sun2/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sun2/sun2/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.26 2003/06/28 14:21:10 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.27 2003/06/29 22:29:03 fvdl Exp $	*/
 
 /*
  * Copyright (c) 2001 Matthew Fredette.
@@ -842,8 +842,8 @@
  * understand and, if so, set up the vmcmds for it.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return ENOEXEC;
--- a/sys/arch/sun3/sun3/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sun3/sun3/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.164 2003/06/28 14:21:11 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.165 2003/06/29 22:29:04 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Gordon W. Ross
@@ -762,8 +762,8 @@
  * understand and, if so, set up the vmcmds for it.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return ENOEXEC;
--- a/sys/arch/sun3/sun3x/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/sun3/sun3x/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.88 2003/06/28 14:21:11 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.89 2003/06/29 22:29:05 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -764,8 +764,8 @@
  * understand and, if so, set up the vmcmds for it.
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return ENOEXEC;
--- a/sys/arch/vax/vax/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/vax/vax/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.18 2003/06/28 14:21:12 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.19 2003/06/29 22:29:06 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -269,7 +269,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/vax/vax/trap.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/vax/vax/trap.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.79 2003/06/28 14:21:12 darrenr Exp $     */
+/*	$NetBSD: trap.c,v 1.80 2003/06/29 22:29:06 fvdl Exp $     */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -466,7 +466,7 @@
 #ifdef KTRACE
 	if (KTRPOINT(l->l_proc, KTR_SYSRET)) {
 		KERNEL_PROC_LOCK(l);
-		ktrsysret(l, SYS_fork, 0, 0);
+		ktrsysret(l->l_proc, SYS_fork, 0, 0);
 		KERNEL_PROC_UNLOCK(l);
 	}
 #endif
--- a/sys/arch/vax/vax/vm_machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/vax/vax/vm_machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.81 2003/06/28 14:21:12 darrenr Exp $	     */
+/*	$NetBSD: vm_machdep.c,v 1.82 2003/06/29 22:29:07 fvdl Exp $	     */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -225,8 +225,8 @@
 }
 
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 	return ENOEXEC;
--- a/sys/arch/x68k/x68k/bus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/x68k/x68k/bus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.21 2003/06/28 14:21:13 darrenr Exp $	*/
+/*	$NetBSD: bus.c,v 1.22 2003/06/29 22:29:08 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -255,7 +255,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp->l_proc;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
--- a/sys/arch/x68k/x68k/machdep.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/x68k/x68k/machdep.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.116 2003/06/28 14:21:13 darrenr Exp $	*/
+/*	$NetBSD: machdep.c,v 1.117 2003/06/29 22:29:08 fvdl Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1059,8 +1059,8 @@
  *	done on little-endian machines...  -- cgd
  */
 int
-cpu_exec_aout_makecmds(l, epp)
-	struct lwp *l;
+cpu_exec_aout_makecmds(p, epp)
+	struct proc *p;
 	struct exec_package *epp;
 {
 #if defined(COMPAT_NOMID) || defined(COMPAT_44)
@@ -1078,12 +1078,12 @@
 	switch (midmag) {
 #ifdef COMPAT_NOMID
 	case (MID_ZERO << 16) | ZMAGIC:
-		error = exec_aout_prep_oldzmagic(l->l_proc, epp);
+		error = exec_aout_prep_oldzmagic(p, epp);
 		break;
 #endif
 #ifdef COMPAT_44
 	case (MID_HP300 << 16) | ZMAGIC:
-		error = exec_aout_prep_oldzmagic(l->l_proc, epp);
+		error = exec_aout_prep_oldzmagic(p, epp);
 		break;
 #endif
 	default:
--- a/sys/arch/x86/x86/bus_dma.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/arch/x86/x86/bus_dma.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.5 2003/06/28 14:21:13 darrenr Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.6 2003/06/29 22:29:09 fvdl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.5 2003/06/28 14:21:13 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.6 2003/06/29 22:29:09 fvdl Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -459,7 +459,7 @@
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		p = uio->uio_lwp ? uio->uio_lwp->l_proc : NULL;
+		p = uio->uio_procp;
 #ifdef DIAGNOSTIC
 		if (p == NULL)
 			panic("_bus_dmamap_load_uio: USERSPACE but no proc");
@@ -823,7 +823,7 @@
 	int i;
 
 	iov = uio->uio_iov;
-	p = uio->uio_lwp->l_proc;
+	p = uio->uio_procp;
 	cp = buf;
 	resid = n;
 
--- a/sys/coda/coda_psdev.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/coda/coda_psdev.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_psdev.c,v 1.25 2003/06/28 14:21:14 darrenr Exp $	*/
+/*	$NetBSD: coda_psdev.c,v 1.26 2003/06/29 22:29:09 fvdl Exp $	*/
 
 /*
  * 
@@ -54,7 +54,7 @@
 /* These routines are the device entry points for Venus. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_psdev.c,v 1.25 2003/06/28 14:21:14 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_psdev.c,v 1.26 2003/06/29 22:29:09 fvdl Exp $");
 
 extern int coda_nc_initialized;    /* Set if cache has been initialized */
 
@@ -137,11 +137,11 @@
  * These functions are written for NetBSD.
  */
 int 
-vc_nb_open(dev, flag, mode, l)    
+vc_nb_open(dev, flag, mode, p)    
     dev_t        dev;      
     int          flag;     
     int          mode;     
-    struct lwp *l;             /* NetBSD only */
+    struct proc *p;             /* NetBSD only */
 {
     struct vcomm *vcp;
     
@@ -169,11 +169,11 @@
 }
 
 int 
-vc_nb_close (dev, flag, mode, l)
+vc_nb_close (dev, flag, mode, p)    
     dev_t        dev;      
     int          flag;     
     int          mode;     
-    struct lwp *l;
+    struct proc *p;
 {
     struct vcomm *vcp;
     struct vmsg *vmp, *nvmp = NULL;
@@ -253,7 +253,7 @@
 #endif
     }
 
-    err = dounmount(mi->mi_vfsp, flag, l);
+    err = dounmount(mi->mi_vfsp, flag, p);
     if (err)
 	myprintf(("Error %d unmounting vfs in vcclose(%d)\n", 
 	           err, minor(dev)));
@@ -415,12 +415,12 @@
 }
 
 int
-vc_nb_ioctl(dev, cmd, addr, flag, l)
+vc_nb_ioctl(dev, cmd, addr, flag, p) 
     dev_t         dev;       
     u_long        cmd;       
     caddr_t       addr;      
     int           flag;      
-    struct lwp *l;
+    struct proc  *p;
 {
     ENTRY;
 
@@ -469,10 +469,10 @@
 }
 
 int
-vc_nb_poll(dev, events, l)
+vc_nb_poll(dev, events, p)         
     dev_t         dev;    
     int           events;   
-    struct lwp *l;
+    struct proc  *p;
 {
     struct vcomm *vcp;
     int event_msk = 0;
@@ -491,7 +491,7 @@
     if (!EMPTY(vcp->vc_requests))
 	return(events & (POLLIN|POLLRDNORM));
 
-    selrecord(l, &(vcp->vc_selproc));
+    selrecord(p, &(vcp->vc_selproc));
     
     return(0);
 }
@@ -574,11 +574,10 @@
 	struct vmsg *vmp;
 	int error;
 #ifdef	CTL_C
-	struct lwp *l = curlwp;
-	struct proc *p = l->l_proc;
+	struct proc *p = curproc;
 	sigset_t psig_omask;
 	int i;
-	psig_omask = l->l_proc->p_sigctx.ps_siglist;	/* array assignment */
+	psig_omask = p->p_sigctx.ps_siglist;	/* array assignment */
 #endif
 	if (mntinfo == NULL) {
 	    /* Unlikely, but could be a race condition with a dying warden */
--- a/sys/coda/coda_venus.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/coda/coda_venus.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_venus.c,v 1.14 2003/06/28 14:21:14 darrenr Exp $	*/
+/*	$NetBSD: coda_venus.c,v 1.15 2003/06/29 22:29:09 fvdl Exp $	*/
 
 /*
  * 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_venus.c,v 1.14 2003/06/28 14:21:14 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_venus.c,v 1.15 2003/06/29 22:29:09 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -167,14 +167,14 @@
 
 int
 venus_root(void *mdp,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid)
 {
     DECL_NO_IN(coda_root);		/* sets Isize & Osize */
     ALLOC_NO_IN(coda_root);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(inp, CODA_ROOT, cred, l->l_proc);
+    INIT_IN(inp, CODA_ROOT, cred, p);  
 
     error = coda_call(mdp, Isize, &Osize, (char *)inp);
     if (!error)
@@ -186,7 +186,7 @@
 
 int
 venus_open(void *mdp, ViceFid *fid, int flag,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	dev_t *dev, ino_t *inode)
 {
     int cflag;
@@ -194,7 +194,7 @@
     ALLOC(coda_open);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_OPEN, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_OPEN, cred, p);
     inp->VFid = *fid;
     CNV_OFLAG(cflag, flag);
     inp->flags = cflag;
@@ -211,13 +211,13 @@
 
 int
 venus_close(void *mdp, ViceFid *fid, int flag,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     int cflag;
     DECL_NO_OUT(coda_close);		/* sets Isize & Osize */
     ALLOC_NO_OUT(coda_close);		/* sets inp & outp */
 
-    INIT_IN(&inp->ih, CODA_CLOSE, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_CLOSE, cred, p);
     inp->VFid = *fid;
     CNV_OFLAG(cflag, flag);
     inp->flags = cflag;
@@ -249,7 +249,7 @@
 int
 venus_ioctl(void *mdp, ViceFid *fid,
 	int com, int flag, caddr_t data,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL(coda_ioctl);			/* sets Isize & Osize */
     struct PioctlData *iap = (struct PioctlData *)data;
@@ -258,7 +258,7 @@
     coda_ioctl_size = VC_MAXMSGSIZE;
     ALLOC(coda_ioctl);			/* sets inp & outp */
 
-    INIT_IN(&inp->ih, CODA_IOCTL, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_IOCTL, cred, p);
     inp->VFid = *fid;
 
     /* command was mutated by increasing its size field to reflect the  
@@ -302,14 +302,14 @@
 
 int
 venus_getattr(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	struct vattr *vap)
 {
     DECL(coda_getattr);			/* sets Isize & Osize */
     ALLOC(coda_getattr);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_GETATTR, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_GETATTR, cred, p);
     inp->VFid = *fid;
 
     error = coda_call(mdp, Isize, &Osize, (char *)inp);
@@ -323,13 +323,13 @@
 
 int
 venus_setattr(void *mdp, ViceFid *fid, struct vattr *vap,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_setattr);		/* sets Isize & Osize */
     ALLOC_NO_OUT(coda_setattr);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_SETATTR, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_SETATTR, cred, p);
     inp->VFid = *fid;
     CNV_V2VV_ATTR(&inp->attr, vap);
 
@@ -341,13 +341,13 @@
 
 int
 venus_access(void *mdp, ViceFid *fid, int mode,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_access);		/* sets Isize & Osize */
     ALLOC_NO_OUT(coda_access);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_ACCESS, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_ACCESS, cred, p);
     inp->VFid = *fid;
     inp->flags = mode;
 
@@ -359,7 +359,7 @@
 
 int
 venus_readlink(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	char **str, int *len)
 {
     DECL(coda_readlink);			/* sets Isize & Osize */
@@ -367,7 +367,7 @@
     ALLOC(coda_readlink);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_READLINK, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_READLINK, cred, p);
     inp->VFid = *fid;
 
     Osize += CODA_MAXPATHLEN;
@@ -384,13 +384,13 @@
 
 int
 venus_fsync(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_fsync);		/* sets Isize & Osize */
     ALLOC_NO_OUT(coda_fsync);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_FSYNC, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_FSYNC, cred, p);
     inp->VFid = *fid;
 
     error = coda_call(mdp, Isize, &Osize, (char *)inp);
@@ -402,7 +402,7 @@
 int
 venus_lookup(void *mdp, ViceFid *fid,
     	const char *nm, int len,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, int *vtype)
 {
     DECL(coda_lookup);			/* sets Isize & Osize */
@@ -410,7 +410,7 @@
     ALLOC(coda_lookup);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_LOOKUP, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_LOOKUP, cred, p);
     inp->VFid = *fid;
 
     /* NOTE:
@@ -439,7 +439,7 @@
 int
 venus_create(void *mdp, ViceFid *fid,
     	const char *nm, int len, int exclusive, int mode, struct vattr *va,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, struct vattr *attr)
 {
     DECL(coda_create);			/* sets Isize & Osize */
@@ -447,7 +447,7 @@
     ALLOC(coda_create);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_CREATE, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_CREATE, cred, p);
     inp->VFid = *fid;
     inp->excl = exclusive ? C_O_EXCL : 0;
     inp->mode = mode<<6;
@@ -469,14 +469,14 @@
 int
 venus_remove(void *mdp, ViceFid *fid,
         const char *nm, int len,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_remove);		/* sets Isize & Osize */
     coda_remove_size += len + 1;
     ALLOC_NO_OUT(coda_remove);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_REMOVE, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_REMOVE, cred, p);
     inp->VFid = *fid;
 
     inp->name = Isize;
@@ -491,14 +491,14 @@
 int
 venus_link(void *mdp, ViceFid *fid, ViceFid *tfid,
         const char *nm, int len,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_link);		/* sets Isize & Osize */
     coda_link_size += len + 1;
     ALLOC_NO_OUT(coda_link);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_LINK, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_LINK, cred, p);
     inp->sourceFid = *fid;
     inp->destFid = *tfid;
 
@@ -514,14 +514,14 @@
 int
 venus_rename(void *mdp, ViceFid *fid, ViceFid *tfid,
         const char *nm, int len, const char *tnm, int tlen,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_rename);		/* sets Isize & Osize */
     coda_rename_size += len + 1 + tlen + 1;
     ALLOC_NO_OUT(coda_rename);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_RENAME, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_RENAME, cred, p);
     inp->sourceFid = *fid;
     inp->destFid = *tfid;
 
@@ -540,7 +540,7 @@
 int
 venus_mkdir(void *mdp, ViceFid *fid,
     	const char *nm, int len, struct vattr *va,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, struct vattr *ova)
 {
     DECL(coda_mkdir);			/* sets Isize & Osize */
@@ -548,7 +548,7 @@
     ALLOC(coda_mkdir);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_MKDIR, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_MKDIR, cred, p);
     inp->VFid = *fid;
     CNV_V2VV_ATTR(&inp->attr, va);
 
@@ -568,14 +568,14 @@
 int
 venus_rmdir(void *mdp, ViceFid *fid,
     	const char *nm, int len,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_rmdir);		/* sets Isize & Osize */
     coda_rmdir_size += len + 1;
     ALLOC_NO_OUT(coda_rmdir);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_RMDIR, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_RMDIR, cred, p);
     inp->VFid = *fid;
 
     inp->name = Isize;
@@ -590,14 +590,14 @@
 int
 venus_symlink(void *mdp, ViceFid *fid,
         const char *lnm, int llen, const char *nm, int len, struct vattr *va,
-	struct ucred *cred, struct lwp *l)
+	struct ucred *cred, struct proc *p)
 {
     DECL_NO_OUT(coda_symlink);		/* sets Isize & Osize */
     coda_symlink_size += llen + 1 + len + 1;
     ALLOC_NO_OUT(coda_symlink);		/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_SYMLINK, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_SYMLINK, cred, p);
     inp->VFid = *fid;
     CNV_V2VV_ATTR(&inp->attr, va);
 
@@ -616,7 +616,7 @@
 int
 venus_readdir(void *mdp, ViceFid *fid,
     	int count, int offset,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	char *buffer, int *len)
 {
     DECL(coda_readdir);			/* sets Isize & Osize */
@@ -624,7 +624,7 @@
     ALLOC(coda_readdir);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_READDIR, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_READDIR, cred, p);
     inp->VFid = *fid;
     inp->count = count;
     inp->offset = offset;
@@ -641,14 +641,14 @@
 }
 
 int
-venus_statfs(void *mdp, struct ucred *cred, struct lwp *l,
+venus_statfs(void *mdp, struct ucred *cred, struct proc *p,
    /*out*/   struct coda_statfs *fsp)
 {
     DECL(coda_statfs);			/* sets Isize & Osize */
     ALLOC(coda_statfs);			/* sets inp & outp */
 
     /* send the open to venus. */
-    INIT_IN(&inp->ih, CODA_STATFS, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_STATFS, cred, p);
 
     error = coda_call(mdp, Isize, &Osize, (char *)inp);
     if (!error) {
@@ -661,14 +661,14 @@
 
 int
 venus_fhtovp(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, int *vtype)
 {
     DECL(coda_vget);			/* sets Isize & Osize */
     ALLOC(coda_vget);			/* sets inp & outp */
 
     /* Send the open to Venus. */
-    INIT_IN(&inp->ih, CODA_VGET, cred, l->l_proc);
+    INIT_IN(&inp->ih, CODA_VGET, cred, p);
     inp->VFid = *fid;
 
     error = coda_call(mdp, Isize, &Osize, (char *)inp);
--- a/sys/coda/coda_venus.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/coda/coda_venus.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_venus.h,v 1.5 2003/06/28 14:21:15 darrenr Exp $	*/
+/*	$NetBSD: coda_venus.h,v 1.6 2003/06/29 22:29:10 fvdl Exp $	*/
 
 /*
  * 
@@ -33,17 +33,17 @@
 
 int
 venus_root(void *mdp,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid);
 
 int
 venus_open(void *mdp, ViceFid *fid, int flag,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	dev_t *dev, ino_t *inode);
 
 int
 venus_close(void *mdp, ViceFid *fid, int flag,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 void
 venus_read(void);
@@ -54,84 +54,84 @@
 int
 venus_ioctl(void *mdp, ViceFid *fid,
 	int com, int flag, caddr_t data,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_getattr(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	struct vattr *vap);
 
 int
 venus_setattr(void *mdp, ViceFid *fid, struct vattr *vap,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_access(void *mdp, ViceFid *fid, int mode,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_readlink(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	char **str, int *len);
 
 int
 venus_fsync(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_lookup(void *mdp, ViceFid *fid,
     	const char *nm, int len,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, int *vtype);
 
 int
 venus_create(void *mdp, ViceFid *fid,
     	const char *nm, int len, int exclusive, int mode, struct vattr *va,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, struct vattr *attr);
 
 int
 venus_remove(void *mdp, ViceFid *fid,
         const char *nm, int len,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_link(void *mdp, ViceFid *fid, ViceFid *tfid,
         const char *nm, int len,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_rename(void *mdp, ViceFid *fid, ViceFid *tfid,
         const char *nm, int len, const char *tnm, int tlen,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_mkdir(void *mdp, ViceFid *fid,
     	const char *nm, int len, struct vattr *va,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, struct vattr *ova);
 
 int
 venus_rmdir(void *mdp, ViceFid *fid,
     	const char *nm, int len,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_symlink(void *mdp, ViceFid *fid,
         const char *lnm, int llen, const char *nm, int len, struct vattr *va,
-	struct ucred *cred, struct lwp *l);
+	struct ucred *cred, struct proc *p);
 
 int
 venus_readdir(void *mdp, ViceFid *fid,
     	int count, int offset,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	char *buffer, int *len);
 
 int
-venus_statfs(void *mdp, struct ucred *cred, struct lwp *l,
+venus_statfs(void *mdp, struct ucred *cred, struct proc *p,
    /*out*/   struct coda_statfs *fsp);
 
 int
 venus_fhtovp(void *mdp, ViceFid *fid,
-	struct ucred *cred, struct lwp *l,
+	struct ucred *cred, struct proc *p,
 /*out*/	ViceFid *VFid, int *vtype);
--- a/sys/coda/coda_vfsops.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/coda/coda_vfsops.c	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vfsops.c,v 1.25 2003/06/29 18:43:21 thorpej Exp $	*/
+/*	$NetBSD: coda_vfsops.c,v 1.26 2003/06/29 22:29:10 fvdl Exp $	*/
 
 /*
  * 
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.25 2003/06/29 18:43:21 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.26 2003/06/29 22:29:10 fvdl Exp $");
 
 #ifdef	_LKM
 #define	NVCODA 4
@@ -108,7 +108,7 @@
     coda_nb_statfs,
     coda_sync,
     coda_vget,
-    (int (*) (struct mount *, struct fid *, struct vnode **))
+    (int (*) (struct mount *, struct fid *, struct vnode ** ))
 	eopnotsupp,
     (int (*) (struct vnode *, struct fid *)) eopnotsupp,
     coda_init,
@@ -144,12 +144,12 @@
  */
 /*ARGSUSED*/
 int
-coda_mount(vfsp, path, data, ndp, l)
+coda_mount(vfsp, path, data, ndp, p)
     struct mount *vfsp;		/* Allocated and initialized by mount(2) */
     const char *path;		/* path covered: ignored by the fs-layer */
     void *data;			/* Need to define a data type for this in netbsd? */
     struct nameidata *ndp;	/* Clobber this to lookup the device name */
-    struct lwp *l;		/* The ever-famous lwp pointer */
+    struct proc *p;		/* The ever-famous proc pointer */
 {
     struct vnode *dvp;
     struct cnode *cp;
@@ -176,7 +176,7 @@
     
     /* Validate mount device.  Similar to getmdev(). */
 
-    NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, l);
+    NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, p);
     error = namei(ndp);
     dvp = ndp->ni_vp;
 
@@ -268,24 +268,24 @@
 	MARK_INT_SAT(CODA_MOUNT_STATS);
 
     return set_statfs_info("/coda", UIO_SYSSPACE, "CODA", UIO_SYSSPACE, vfsp,
-	l);
+	p);
 }
 
 int
-coda_start(vfsp, flags, l)
+coda_start(vfsp, flags, p)
     struct mount *vfsp;
     int flags;
-    struct lwp *l;
+    struct proc *p;
 {
     ENTRY;
     return (0);
 }
 
 int
-coda_unmount(vfsp, mntflags, l)
+coda_unmount(vfsp, mntflags, p)
     struct mount *vfsp;
     int mntflags;
-    struct lwp *l;
+    struct proc *p;
 {
     struct coda_mntinfo *mi = vftomi(vfsp);
     int active, error = 0;
@@ -342,8 +342,7 @@
     struct coda_mntinfo *mi = vftomi(vfsp);
     struct vnode **result;
     int error;
-    struct lwp *l = curlwp;	/* XXX */
-    struct proc *p = l->l_proc;	/* XXX */
+    struct proc *p = curproc;    /* XXX - bnoble */
     ViceFid VFid;
 
     ENTRY;
@@ -364,7 +363,7 @@
 	    }
     }
 
-    error = venus_root(vftomi(vfsp), p->p_cred->pc_ucred, l, &VFid);
+    error = venus_root(vftomi(vfsp), p->p_cred->pc_ucred, p, &VFid);
 
     if (!error) {
 	/*
@@ -407,12 +406,12 @@
 }
 
 int
-coda_quotactl(vfsp, cmd, uid, arg, l)
+coda_quotactl(vfsp, cmd, uid, arg, p)
     struct mount *vfsp;
     int cmd;
     uid_t uid;
     caddr_t arg;
-    struct lwp *l;
+    struct proc *p;
 {
     ENTRY;
     return (EOPNOTSUPP);
@@ -422,13 +421,12 @@
  * Get file system statistics.
  */
 int
-coda_nb_statfs(vfsp, sbp, l)
+coda_nb_statfs(vfsp, sbp, p)
     struct mount *vfsp;
     struct statfs *sbp;
-    struct lwp *l;
+    struct proc *p;
 {
     struct coda_statfs fsstat;
-    struct proc *p = l->l_proc;
     int error;
 
     ENTRY;
@@ -445,7 +443,7 @@
      */
     /* Note: Normal fs's have a bsize of 0x400 == 1024 */
 
-    error = venus_statfs(vftomi(vfsp), p->p_cred->pc_ucred, l, &fsstat);
+    error = venus_statfs(vftomi(vfsp), p->p_cred->pc_ucred, p, &fsstat);
 
     if (!error) {
 	sbp->f_type = 0;
@@ -467,11 +465,11 @@
  * Flush any pending I/O.
  */
 int
-coda_sync(vfsp, waitfor, cred, l)
+coda_sync(vfsp, waitfor, cred, p)
     struct mount *vfsp;
     int    waitfor;
     struct ucred *cred;
-    struct lwp *l;
+    struct proc *p;
 {
     ENTRY;
     MARK_ENTRY(CODA_SYNC_STATS);
@@ -506,8 +504,7 @@
     struct cfid *cfid = (struct cfid *)fhp;
     struct cnode *cp = 0;
     int error;
-    struct lwp *l = curlwp;	/* XXX */
-    struct proc *p = l->l_proc;	/* XXX */
+    struct proc *p = curproc; /* XXX -mach */
     ViceFid VFid;
     int vtype;
 
@@ -522,7 +519,7 @@
 	return(0);
     }
     
-    error = venus_fhtovp(vftomi(vfsp), &cfid->cfid_fid, p->p_cred->pc_ucred, l, &VFid, &vtype);
+    error = venus_fhtovp(vftomi(vfsp), &cfid->cfid_fid, p->p_cred->pc_ucred, p, &VFid, &vtype);
     
     if (error) {
 	CODADEBUG(CODA_VGET, myprintf(("vget error %d\n",error));)
@@ -560,14 +557,14 @@
 }
 
 int
-coda_sysctl(name, namelen, oldp, oldlp, newp, newl, l)
+coda_sysctl(name, namelen, oldp, oldlp, newp, newl, p)
 	int *name;
 	u_int namelen;
 	void *oldp;
 	size_t *oldlp;
 	void *newp;
 	size_t newl;
-	struct lwp *l;
+	struct proc *p;
 {
 
 	/* all sysctl names at this level are terminal */
--- a/sys/coda/coda_vfsops.h	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/coda/coda_vfsops.h	Sun Jun 29 22:28:00 2003 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vfsops.h,v 1.7 2003/06/29 18:43:21 thorpej Exp $	*/
+/*	$NetBSD: coda_vfsops.h,v 1.8 2003/06/29 22:29:10 fvdl Exp $	*/
 
 /*
  * 
@@ -47,13 +47,13 @@
 
 int coda_vfsopstats_init(void);
 int coda_mount(struct mount *, const char *, void *, struct nameidata *, 
-		       struct lwp *);
-int coda_start(struct mount *, int, struct lwp *);
-int coda_unmount(struct mount *, int, struct lwp *);
+		       struct proc *);
+int coda_start(struct mount *, int, struct proc *);
+int coda_unmount(struct mount *, int, struct proc *);
 int coda_root(struct mount *, struct vnode **);
-int coda_quotactl(struct mount *, int, uid_t, caddr_t, struct lwp *);
-int coda_nb_statfs(struct mount *, struct statfs *, struct lwp *);
-int coda_sync(struct mount *, int, struct ucred *, struct lwp *);
+int coda_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *);
+int coda_nb_statfs(struct mount *, struct statfs *, struct proc *);
+int coda_sync(struct mount *, int, struct ucred *, struct proc *);
 int coda_vget(struct mount *, ino_t, struct vnode **);
 int coda_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **,
 		       int *, struct ucred **);
@@ -61,5 +61,5 @@
 void coda_init(void);
 void coda_done(void);
 int coda_sysctl(int *, u_int, void *, size_t *, void *, size_t,
-		    struct lwp *);
+		    struct proc *);
 int getNewVnode(struct vnode **vpp);
--- a/sys/coda/coda_vnops.c	Sun Jun 29 19:28:16 2003 +0000
+++ b/sys/coda/coda_vnops.c	Sun Jun 29 22:28:00 2003 +0000
@@ -6,7 +6,7 @@
 rmdir
 symlink
 */
-/*	$NetBSD: coda_vnops.c,v 1.35 2003/06/29 18:43:22 thorpej Exp $	*/
+/*	$NetBSD: coda_vnops.c,v 1.36 2003/06/29 22:29:10 fvdl Exp $	*/
 
 /*
  * 
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.35 2003/06/29 18:43:22 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.36 2003/06/29 22:29:10 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -231,7 +231,7 @@
     struct cnode *cp = VTOC(*vpp);
     int flag = ap->a_mode & (~O_EXCL);
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_l;
+    struct proc *p = ap->a_p;
 /* locals */
     int error;
     struct vnode *vp;
@@ -252,7 +252,7 @@
 	return(0);
     }
 
-    error = venus_open(vtomi((*vpp)), &cp->c_fid, flag, cred, l, &dev, &inode);
+    error = venus_open(vtomi((*vpp)), &cp->c_fid, flag, cred, p, &dev, &inode);
     if (error)
 	return (error);
     if (!error) {
@@ -292,7 +292,7 @@
     cp->c_inode = inode;
 
     /* Open the cache file. */
-    error = VOP_OPEN(vp, flag, cred, l); 
+    error = VOP_OPEN(vp, flag, cred, p); 
     return(error);
 }
 
@@ -309,7 +309,7 @@
     struct cnode *cp = VTOC(vp);
     int flag = ap->a_fflag;
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_l;
+    struct proc *p = ap->a_p;
 /* locals */
     int error;
 
@@ -331,7 +331,7 @@
 	    vgone(cp->c_ovp);
 #else
 	    vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY);
-	    VOP_CLOSE(cp->c_ovp, flag, cred, l); /* Do errors matter here? */
+	    VOP_CLOSE(cp->c_ovp, flag, cred, p); /* Do errors matter here? */
 	    vput(cp->c_ovp);
 #endif
 	} else {
@@ -342,7 +342,7 @@
 	return ENODEV;
     } else {
 	vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY);
-	VOP_CLOSE(cp->c_ovp, flag, cred, l); /* Do errors matter here? */
+	VOP_CLOSE(cp->c_ovp, flag, cred, p); /* Do errors matter here? */
 	vput(cp->c_ovp);
     }
 
@@ -352,7 +352,7 @@
     if (flag & FWRITE)                    /* file was opened for write */
 	--cp->c_owrite;
 
-    error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, l);
+    error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, p);
     vrele(CTOV(cp));
 
     CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error)); )
@@ -367,7 +367,7 @@
 
     ENTRY;
     return(coda_rdwr(ap->a_vp, ap->a_uio, UIO_READ,
-		    ap->a_ioflag, ap->a_cred, ap->a_uio->uio_lwp));
+		    ap->a_ioflag, ap->a_cred, ap->a_uio->uio_procp));
 }
 
 int
@@ -378,24 +378,23 @@
 
     ENTRY;
     return(coda_rdwr(ap->a_vp, ap->a_uio, UIO_WRITE,
-		    ap->a_ioflag, ap->a_cred, ap->a_uio->uio_lwp));
+		    ap->a_ioflag, ap->a_cred, ap->a_uio->uio_procp));
 }
 
 int
-coda_rdwr(vp, uiop, rw, ioflag, cred, l)
+coda_rdwr(vp, uiop, rw, ioflag, cred, p)
     struct vnode *vp;
     struct uio *uiop;
     enum uio_rw rw;
     int ioflag;
     struct ucred *cred;
-    struct lwp *l;
+    struct proc *p;
 { 
 /* upcall decl */
   /* NOTE: container file operation!!! */
 /* locals */
     struct cnode *cp = VTOC(vp);
     struct vnode *cfvp = cp->c_ovp;
-    struct proc *p = l->l_proc;
     int igot_internally = 0;
     int opened_internally = 0;
     int error = 0;
@@ -445,7 +444,7 @@
 	    opened_internally = 1;
 	    MARK_INT_GEN(CODA_OPEN_STATS);
 	    error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), 
-			     cred, l);
+			     cred, p);
 #ifdef	CODA_VERBOSE
 printf("coda_rdwr: Internally Opening %p\n", vp);
 #endif
@@ -476,7 +475,7 @@
     /* Do an internal close if necessary. */
     if (opened_internally) {
 	MARK_INT_GEN(CODA_CLOSE_STATS);
-	(void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), cred, l);
+	(void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), cred, p);
     }
 
     /* Invalidate cached attributes if writing. */
@@ -496,7 +495,7 @@
     caddr_t data = ap->a_data;
     int flag = ap->a_fflag;
     struct ucred *cred = ap->a_cred;
-    struct lwp  *l = ap->a_l;
+    struct proc  *p = ap->a_p;
 /* locals */
     int error;
     struct vnode *tvp;
@@ -521,8 +520,7 @@
     /* Should we use the name cache here? It would get it from
        lookupname sooner or later anyway, right? */
 
-    NDINIT(&ndp, LOOKUP, (iap->follow ? FOLLOW : NOFOLLOW), UIO_USERSPACE,
-	   ((caddr_t)iap->path), l);
+    NDINIT(&ndp, LOOKUP, (iap->follow ? FOLLOW : NOFOLLOW), UIO_USERSPACE, ((caddr_t)iap->path), p);
     error = namei(&ndp);
     tvp = ndp.ni_vp;
 
@@ -551,7 +549,7 @@
 	vrele(tvp);
 	return(EINVAL);
     }
-    error = venus_ioctl(vtomi(tvp), &((VTOC(tvp))->c_fid), com, flag, data, cred, l);
+    error = venus_ioctl(vtomi(tvp), &((VTOC(tvp))->c_fid), com, flag, data, cred, p);
 
     if (error)
 	MARK_INT_FAIL(CODA_IOCTL_STATS);
@@ -581,7 +579,7 @@
     struct cnode *cp = VTOC(vp);
     struct vattr *vap = ap->a_vap;
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_l;
+    struct proc *p = ap->a_p;
 /* locals */
     int error;
 
@@ -607,7 +605,7 @@
 	return(0);
     }
 
-    error = venus_getattr(vtomi(vp), &cp->c_fid, cred, l, vap);
+    error = venus_getattr(vtomi(vp), &cp->c_fid, cred, p, vap);
 
     if (!error) {
 	CODADEBUG(CODA_GETATTR, myprintf(("getattr miss (%lx.%lx.%lx): result %d\n",
@@ -639,7 +637,7 @@
     struct cnode *cp = VTOC(vp);
     struct vattr *vap = ap->a_vap;
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_l;
+    struct proc *p = ap->a_p;
 /* locals */
     int error;
 
@@ -654,7 +652,7 @@
     if (codadebug & CODADBGMSK(CODA_SETATTR)) {
 	print_vattr(vap);
     }
-    error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, l);
+    error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, p);
 
     if (!error)
 	cp->c_flags &= ~C_VATTR;
@@ -673,7 +671,7 @@
     struct cnode *cp = VTOC(vp);
     int mode = ap->a_mode;
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_l;
+    struct proc *p = ap->a_p;
 /* locals */
     int error;
 
@@ -702,7 +700,7 @@
 	}
     }
 
-    error = venus_access(vtomi(vp), &cp->c_fid, mode, cred, l);
+    error = venus_access(vtomi(vp), &cp->c_fid, mode, cred, p);
 
     return(error);
 }
@@ -740,7 +738,7 @@
     struct cnode *cp = VTOC(vp);
     struct uio *uiop = ap->a_uio;
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_uio->uio_lwp;
+    struct proc *p = ap->a_uio->uio_procp;
 /* locals */
     int error;
     char *str;
@@ -764,7 +762,7 @@
 	return(error);
     }
 
-    error = venus_readlink(vtomi(vp), &cp->c_fid, cred, l, &str, &len);
+    error = venus_readlink(vtomi(vp), &cp->c_fid, cred, p, &str, &len);
 
     if (!error) {
 	uiop->uio_rw = UIO_READ;
@@ -791,7 +789,7 @@
     struct vnode *vp = ap->a_vp;
     struct cnode *cp = VTOC(vp);
     struct ucred *cred = ap->a_cred;
-    struct lwp *l = ap->a_l;
+    struct proc *p = ap->a_p;
 /* locals */
     struct vnode *convp = cp->c_ovp;
     int error;
@@ -814,7 +812,7 @@
     }
 
     if (convp)
-    	VOP_FSYNC(convp, cred, MNT_WAIT, 0, 0, l);
+    	VOP_FSYNC(convp, cred, MNT_WAIT, 0, 0, p);
 
     /*
      * We can expect fsync on any vnode at all if venus is pruging it.
@@ -827,7 +825,7 @@
 	return(0);
     }
 
-    error = venus_fsync(vtomi(vp), &cp->c_fid, cred, l);
+    error = venus_fsync(vtomi(vp), &cp->c_fid, cred, p);
 
     CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n",error)); );
     return(error);
@@ -844,7 +842,7 @@
     struct vnode *vp = ap->a_vp;
     struct cnode *cp = VTOC(vp);
     struct ucred *cred __attribute__((unused)) = NULL;
-    struct lwp *l __attribute__((unused)) = curlwp;
+    struct proc *p __attribute__((unused)) = curproc;
 /* upcall decl */
 /* locals */
 
@@ -926,7 +924,7 @@
      */
     struct componentname  *cnp = ap->a_cnp;
     struct ucred *cred = cnp->cn_cred;
-    struct lwp *l = cnp->cn_lwp;
+    struct proc *p = cnp->cn_proc;
 /* locals */
     struct cnode *cp;
     const char *nm = cnp->cn_nameptr;
@@ -971,7 +969,7 @@
     } else {
 	
 	/* The name wasn't cached, so we need to contact Venus */
-	error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred, l, &VFid, &vtype);
+	error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred, p, &VFid, &vtype);
 	
 	if (error) {
 	    MARK_INT_FAIL(CODA_LOOKUP_STATS);
@@ -1089,7 +1087,7 @@
     struct vnode **vpp = ap->a_vpp;
     struct componentname  *cnp = ap->a_cnp;
     struct ucred *cred = cnp->cn_cred;
-    struct lwp *l = cnp->cn_lwp;
+    struct proc *p = cnp->cn_proc;
 /* locals */
     int error;
     struct cnode *cp;
@@ -1110,7 +1108,7 @@
 	return(EACCES);
     }
 
-    error = venus_create(vtomi(dvp), &dcp->c_fid, nm, len, exclusive, mode, va, cred, l, &VFid, &attr);
+    error = venus_create(vtomi(dvp), &dcp->c_fid, nm, len, exclusive, mode, va, cred, p, &VFid, &attr);
 
     if (!error) {
 	
@@ -1190,7 +1188,7 @@
     struct cnode *cp = VTOC(dvp);
     struct componentname  *cnp = ap->a_cnp;
     struct ucred *cred = cnp->cn_cred;
-    struct lwp *l = cnp->cn_lwp;
+    struct proc *p = cnp->cn_proc;
 /* locals */
     int error;
     const char *nm = cnp->cn_nameptr;
@@ -1233,7 +1231,7 @@
 	return(ENOENT);
     }
 
-    error = venus_remove(vtomi(dvp), &cp->c_fid, nm, len, cred, l);
+    error = venus_remove(vtomi(dvp), &cp->c_fid, nm, len, cred, p);
 
     CODADEBUG(CODA_REMOVE, myprintf(("in remove result %d\n",error)); )
 
@@ -1267,7 +1265,7 @@
     struct cnode *tdcp = VTOC(tdvp);
     struct componentname *cnp = ap->a_cnp;
     struct ucred *cred = cnp->cn_cred;
-    struct lwp *l = cnp->cn_lwp;
+    struct proc *p = cnp->cn_proc;
 /* locals */
     int error;
     const char *nm = cnp->cn_nameptr;
@@ -1312,7 +1310,7 @@
 	goto exit;
     }
 	
-    error = venus_link(vtomi(vp), &cp->c_fid, &tdcp->c_fid, nm, len, cred, l);
+    error = venus_link(vtomi(vp), &cp->c_fid, &tdcp->c_fid, nm, len, cred, p);
 
     /* Invalidate the parent's attr cache, the modification time has changed */
     VTOC(tdvp)->c_flags &= ~C_VATTR;
@@ -1347,7 +1345,7 @@
     struct cnode *ndcp = VTOC(ndvp);
     struct componentname  *tcnp = ap->a_tcnp;
     struct ucred *cred = fcnp->cn_cred;
-    struct lwp *l = fcnp->cn_lwp;
+    struct proc *p = fcnp->cn_proc;
 /* true args */
     int error;
     const char *fnm = fcnp->cn_nameptr;
@@ -1361,7 +1359,7 @@
        This could be Bad. XXX */
 #ifdef OLD_DIAGNOSTIC
     if ((fcnp->cn_cred != tcnp->cn_cred)
-	|| (fcnp->cn_lwp != tcnp->cn_lwp))
+	|| (fcnp->cn_proc != tcnp->cn_proc))
     {
 	panic("coda_rename: component names don't agree");
     }
@@ -1404,7 +1402,7 @@
 	goto exit;
     }
 
-    error = venus_rename(vtomi(odvp), &odcp->c_fid, &ndcp->c_fid, fnm, flen, tnm, tlen, cred, l);
+    error = venus_rename(vtomi(odvp), &odcp->c_fid, &ndcp->c_fid, fnm, flen, tnm, tlen, cred, p);
 
  exit:
     CODADEBUG(CODA_RENAME, myprintf(("in rename result %d\n",error));)
@@ -1441,7 +1439,7 @@
     struct vattr *va = ap->a_vap;
     struct vnode **vpp = ap->a_vpp;
     struct ucred *cred = cnp->cn_cred;
-    struct lwp *l = cnp->cn_lwp;
+    struct proc *p = cnp->cn_proc;
 /* locals */
     int error;
     const char *nm = cnp->cn_nameptr;
@@ -1465,7 +1463,7 @@
 	return(EACCES);
     }
 
-    error = venus_mkdir(vtomi(dvp), &dcp->c_fid, nm, len, va, cred, l, &VFid, &ova);
+    error = venus_mkdir(vtomi(dvp), &dcp->c_fid, nm, len, va, cred, p, &VFid, &ova);
 
     if (!error) {
 	if (coda_find(&VFid) != NULL)
@@ -1531,7 +1529,7 @@
     struct cnode *dcp = VTOC(dvp);
     struct componentname  *cnp = ap->a_cnp;
     struct ucred *cred = cnp->cn_cred;
-    struct lwp *l = cnp->cn_lwp;
+    struct proc *p = cnp->cn_proc;
 /* true args */
     int error;
     const char *nm = cnp->cn_nameptr;
@@ -1563,7 +1561,7 @@
     /* Invalidate the parent's attr cache, the modification time has changed */