From 7b95be2a373262fc47d15dc15d119ed32b95aab9 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 21 Jul 2003 07:57:52 +0000 Subject: [PATCH] LINT build test. Aggregated source code adjustments to bring most of the rest of the kernel source up to date, using the LINT build. --- sys/bus/cam/scsi/scsi_pt.c | 8 +- sys/bus/cam/scsi/scsi_ses.c | 8 +- sys/bus/iicbus/iic.c | 8 +- sys/bus/isa/vga_isa.c | 14 +-- sys/bus/smbus/smb.c | 8 +- sys/contrib/dev/fla/fla.c | 16 +-- sys/dev/disk/mcd/mcd.c | 17 +-- sys/dev/disk/scd/scd.c | 12 +-- sys/dev/disk/wcd/wd_cd.c | 8 +- sys/dev/disk/wd/wd.c | 9 +- sys/dev/disk/wfd/wfd.c | 11 +- sys/dev/disk/wst/wst.c | 8 +- sys/dev/disk/wt/wt.c | 8 +- sys/dev/drm/drm_bufs.h | 6 +- sys/dev/drm/drm_fops.h | 10 +- sys/dev/drm/drm_os_freebsd.h | 8 +- sys/dev/misc/gpib/gpib.c | 12 +-- sys/dev/misc/labpc/labpc.c | 8 +- sys/dev/misc/mse/mse.c | 20 ++-- sys/dev/misc/pcfclock/pcfclock.c | 6 +- sys/dev/misc/pps/pps.c | 8 +- sys/dev/misc/spic/spic.c | 14 ++- sys/dev/misc/spigot/spigot.c | 14 +-- sys/dev/misc/tw/tw.c | 16 +-- sys/dev/misc/xrpu/xrpu.c | 8 +- sys/dev/netif/cx/cx.c | 4 +- sys/dev/netif/rdp/if_rdp.c | 6 +- sys/dev/serial/cy/cy.c | 20 ++-- sys/dev/serial/dgb/dgm.c | 4 +- sys/dev/serial/rc/rc.c | 61 +++++------ sys/dev/serial/rp2/rp.c | 18 ++-- sys/dev/serial/si/si.c | 8 +- sys/dev/serial/stl/stallion.c | 16 +-- sys/dev/serial/stli/istallion.c | 16 +-- sys/dev/sound/isa/i386/pca/pcaudio.c | 18 ++-- sys/dev/usbmisc/ucom/ucom.c | 4 +- sys/dev/video/ctx/ctx.c | 20 ++-- sys/dev/video/fb/fb.c | 20 ++-- sys/dev/video/fb/fbreg.h | 8 +- sys/dev/video/fb/vga.c | 14 +-- sys/dev/video/fb/vgareg.h | 8 +- sys/dev/video/gsc/gsc.c | 8 +- sys/dev/video/meteor/meteor.c | 10 +- sys/dev/video/pcvt/i386/pcvt_drv.c | 34 +++--- sys/dev/video/pcvt/i386/pcvt_ext.c | 4 +- sys/emulation/ibcs2/i386/ibcs2_fcntl.c | 4 +- sys/emulation/ibcs2/i386/ibcs2_other.c | 3 +- sys/emulation/linux/i386/linux.h | 6 +- sys/emulation/linux/linux_getcwd.c | 4 +- sys/emulation/linux/linux_ioctl.c | 4 +- sys/i386/gnu/isa/dgb.c | 42 ++++---- sys/i386/i386/elan-mmcr.c | 10 +- sys/i386/i386/initcpu.c | 6 +- sys/i386/i386/mp_machdep.c | 4 +- sys/i386/i386/sys_machdep.c | 4 +- sys/i386/isa/asc.c | 14 ++- sys/kern/kern_lock.c | 22 ++-- sys/kern/kern_poll.c | 8 +- sys/kern/kern_subr.c | 7 +- sys/kern/vfs_aio.c | 38 +++---- sys/net/i4b/driver/i4b_ctl.c | 10 +- sys/net/i4b/driver/i4b_ipr.c | 3 +- sys/net/i4b/driver/i4b_rbch.c | 14 +-- sys/net/i4b/driver/i4b_tel.c | 16 +-- sys/net/i4b/driver/i4b_trace.c | 10 +- sys/net/i4b/layer4/i4b_i4bdrv.c | 16 +-- sys/netinet/ip_output.c | 6 +- sys/netinet6/in6_pcb.h | 8 +- sys/netproto/atalk/at_control.c | 4 +- sys/netproto/atalk/at_extern.h | 5 +- sys/netproto/atalk/ddp_usrreq.c | 10 +- sys/netproto/ipx/ipx_ip.c | 6 +- sys/netproto/ipx/ipx_pcb.c | 4 +- sys/netproto/ipx/ipx_pcb.h | 8 +- sys/netproto/ipx/ipx_var.h | 6 +- sys/netproto/ipx/spx_usrreq.c | 52 +++++----- sys/netproto/key/keydb.c | 3 +- sys/netproto/key/keysock.c | 18 ++-- sys/netproto/natm/natm.c | 22 ++-- sys/platform/pc32/gnu/isa/dgb.c | 42 ++++---- sys/platform/pc32/i386/elan-mmcr.c | 10 +- sys/platform/pc32/i386/initcpu.c | 6 +- sys/platform/pc32/i386/mp_machdep.c | 4 +- sys/platform/pc32/i386/sys_machdep.c | 4 +- sys/platform/pc32/isa/asc.c | 14 ++- sys/sys/un.h | 3 +- sys/vfs/gnu/ext2fs/ext2_balloc.c | 10 +- sys/vfs/gnu/ext2fs/ext2_extern.h | 4 +- sys/vfs/gnu/ext2fs/ext2_inode.c | 10 +- sys/vfs/gnu/ext2fs/ext2_linux_balloc.c | 5 +- sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c | 6 +- sys/vfs/gnu/ext2fs/ext2_lookup.c | 32 +++--- sys/vfs/gnu/ext2fs/ext2_readwrite.c | 20 ++-- sys/vfs/gnu/ext2fs/ext2_subr.c | 4 +- sys/vfs/gnu/ext2fs/ext2_vfsops.c | 138 +++++++++++++------------ sys/vfs/gnu/ext2fs/ext2_vnops.c | 45 ++++---- sys/vfs/nfs/bootp_subr.c | 101 +++++++++--------- sys/vfs/nfs/krpc_subr.c | 18 ++-- sys/vfs/nfs/nfs_bio.c | 4 +- 99 files changed, 741 insertions(+), 702 deletions(-) diff --git a/sys/bus/cam/scsi/scsi_pt.c b/sys/bus/cam/scsi/scsi_pt.c index 8402d7ed96..b3e38718f1 100644 --- a/sys/bus/cam/scsi/scsi_pt.c +++ b/sys/bus/cam/scsi/scsi_pt.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/scsi/scsi_pt.c,v 1.17 2000/01/17 06:27:37 mjacob Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_pt.c,v 1.4 2003/07/21 05:50:24 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_pt.c,v 1.5 2003/07/21 07:57:36 dillon Exp $ */ #include @@ -145,7 +145,7 @@ static struct extend_array *ptperiphs; #endif static int -ptopen(dev_t dev, int flags, int fmt, struct proc *p) +ptopen(dev_t dev, int flags, int fmt, struct thread *td) { struct cam_periph *periph; struct pt_softc *softc; @@ -189,7 +189,7 @@ ptopen(dev_t dev, int flags, int fmt, struct proc *p) } static int -ptclose(dev_t dev, int flag, int fmt, struct proc *p) +ptclose(dev_t dev, int flag, int fmt, struct thread *td) { struct cam_periph *periph; struct pt_softc *softc; @@ -694,7 +694,7 @@ pterror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) } static int -ptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) +ptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { struct cam_periph *periph; struct pt_softc *softc; diff --git a/sys/bus/cam/scsi/scsi_ses.c b/sys/bus/cam/scsi/scsi_ses.c index 338dfde83a..3b797ba8c6 100644 --- a/sys/bus/cam/scsi/scsi_ses.c +++ b/sys/bus/cam/scsi/scsi_ses.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/cam/scsi/scsi_ses.c,v 1.8.2.2 2000/08/08 23:19:21 mjacob Exp $ */ -/* $DragonFly: src/sys/bus/cam/scsi/scsi_ses.c,v 1.4 2003/07/21 05:50:24 dillon Exp $ */ +/* $DragonFly: src/sys/bus/cam/scsi/scsi_ses.c,v 1.5 2003/07/21 07:57:36 dillon Exp $ */ /* * Copyright (c) 2000 Matthew Jacob * All rights reserved. @@ -426,7 +426,7 @@ sesregister(struct cam_periph *periph, void *arg) } static int -sesopen(dev_t dev, int flags, int fmt, struct proc *p) +sesopen(dev_t dev, int flags, int fmt, struct thread *td) { struct cam_periph *periph; struct ses_softc *softc; @@ -482,7 +482,7 @@ out: } static int -sesclose(dev_t dev, int flag, int fmt, struct proc *p) +sesclose(dev_t dev, int flag, int fmt, struct thread *td) { struct cam_periph *periph; struct ses_softc *softc; @@ -539,7 +539,7 @@ seserror(union ccb *ccb, u_int32_t cflags, u_int32_t sflags) } static int -sesioctl(dev_t dev, u_long cmd, caddr_t arg_addr, int flag, struct proc *p) +sesioctl(dev_t dev, u_long cmd, caddr_t arg_addr, int flag, struct thread *td) { struct cam_periph *periph; ses_encstat tmp; diff --git a/sys/bus/iicbus/iic.c b/sys/bus/iicbus/iic.c index fdeafc2061..2dd5b187a5 100644 --- a/sys/bus/iicbus/iic.c +++ b/sys/bus/iicbus/iic.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/iicbus/iic.c,v 1.18 1999/11/18 05:43:32 peter Exp $ - * $DragonFly: src/sys/bus/iicbus/iic.c,v 1.3 2003/07/21 05:50:31 dillon Exp $ + * $DragonFly: src/sys/bus/iicbus/iic.c,v 1.4 2003/07/21 07:57:41 dillon Exp $ * */ #include @@ -140,7 +140,7 @@ iic_attach(device_t dev) } static int -iicopen (dev_t dev, int flags, int fmt, struct proc *p) +iicopen (dev_t dev, int flags, int fmt, struct thread *td) { struct iic_softc *sc = IIC_SOFTC(minor(dev)); @@ -156,7 +156,7 @@ iicopen (dev_t dev, int flags, int fmt, struct proc *p) } static int -iicclose(dev_t dev, int flags, int fmt, struct proc *p) +iicclose(dev_t dev, int flags, int fmt, struct thread *td) { struct iic_softc *sc = IIC_SOFTC(minor(dev)); @@ -234,7 +234,7 @@ iicread(dev_t dev, struct uio * uio, int ioflag) } static int -iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { device_t iicdev = IIC_DEVICE(minor(dev)); struct iic_softc *sc = IIC_SOFTC(minor(dev)); diff --git a/sys/bus/isa/vga_isa.c b/sys/bus/isa/vga_isa.c index 5c051eaa13..f5be2b0767 100644 --- a/sys/bus/isa/vga_isa.c +++ b/sys/bus/isa/vga_isa.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/isa/vga_isa.c,v 1.17 2000/01/29 15:08:56 peter Exp $ - * $DragonFly: src/sys/bus/isa/vga_isa.c,v 1.3 2003/07/21 05:50:42 dillon Exp $ + * $DragonFly: src/sys/bus/isa/vga_isa.c,v 1.4 2003/07/21 07:57:47 dillon Exp $ */ #include "opt_vga.h" @@ -183,15 +183,15 @@ isavga_attach(device_t dev) #ifdef FB_INSTALL_CDEV static int -isavga_open(dev_t dev, int flag, int mode, struct proc *p) +isavga_open(dev_t dev, int flag, int mode, struct thread *td) { - return vga_open(dev, VGA_SOFTC(VGA_UNIT(dev)), flag, mode, p); + return vga_open(dev, VGA_SOFTC(VGA_UNIT(dev)), flag, mode, td); } static int -isavga_close(dev_t dev, int flag, int mode, struct proc *p) +isavga_close(dev_t dev, int flag, int mode, struct thread *td) { - return vga_close(dev, VGA_SOFTC(VGA_UNIT(dev)), flag, mode, p); + return vga_close(dev, VGA_SOFTC(VGA_UNIT(dev)), flag, mode, td); } static int @@ -207,9 +207,9 @@ isavga_write(dev_t dev, struct uio *uio, int flag) } static int -isavga_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p) +isavga_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) { - return vga_ioctl(dev, VGA_SOFTC(VGA_UNIT(dev)), cmd, arg, flag, p); + return vga_ioctl(dev, VGA_SOFTC(VGA_UNIT(dev)), cmd, arg, flag, td); } static int diff --git a/sys/bus/smbus/smb.c b/sys/bus/smbus/smb.c index b89ddcb1a6..90360c5fa8 100644 --- a/sys/bus/smbus/smb.c +++ b/sys/bus/smbus/smb.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/smbus/smb.c,v 1.20 1999/11/18 05:44:56 peter Exp $ - * $DragonFly: src/sys/bus/smbus/smb.c,v 1.3 2003/07/21 05:50:35 dillon Exp $ + * $DragonFly: src/sys/bus/smbus/smb.c,v 1.4 2003/07/21 07:57:42 dillon Exp $ * */ #include @@ -141,7 +141,7 @@ smb_attach(device_t dev) } static int -smbopen (dev_t dev, int flags, int fmt, struct proc *p) +smbopen (dev_t dev, int flags, int fmt, struct thread *td) { struct smb_softc *sc = IIC_SOFTC(minor(dev)); @@ -157,7 +157,7 @@ smbopen (dev_t dev, int flags, int fmt, struct proc *p) } static int -smbclose(dev_t dev, int flags, int fmt, struct proc *p) +smbclose(dev_t dev, int flags, int fmt, struct thread *td) { struct smb_softc *sc = IIC_SOFTC(minor(dev)); @@ -189,7 +189,7 @@ smbread(dev_t dev, struct uio * uio, int ioflag) } static int -smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { device_t smbdev = IIC_DEVICE(minor(dev)); struct smb_softc *sc = IIC_SOFTC(minor(dev)); diff --git a/sys/contrib/dev/fla/fla.c b/sys/contrib/dev/fla/fla.c index 543000175a..6ecb59b5db 100644 --- a/sys/contrib/dev/fla/fla.c +++ b/sys/contrib/dev/fla/fla.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/contrib/dev/fla/fla.c,v 1.16 1999/12/08 04:45:16 ken Exp $ - * $DragonFly: src/sys/contrib/dev/fla/Attic/fla.c,v 1.3 2003/07/21 05:50:25 dillon Exp $ + * $DragonFly: src/sys/contrib/dev/fla/Attic/fla.c,v 1.4 2003/07/21 07:57:39 dillon Exp $ * */ @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include #include +#include #include #include @@ -126,7 +128,7 @@ static struct fla_s { } softc[NFLA]; static int -flaopen(dev_t dev, int flag, int fmt, struct proc *p) +flaopen(dev_t dev, int flag, int fmt, struct thread *td) { struct fla_s *sc; int error; @@ -134,7 +136,7 @@ flaopen(dev_t dev, int flag, int fmt, struct proc *p) if (fla_debug) printf("flaopen(%s %x %x %p)\n", - devtoname(dev), flag, fmt, p); + devtoname(dev), flag, fmt, td); sc = dev->si_drv1; @@ -156,14 +158,14 @@ flaopen(dev_t dev, int flag, int fmt, struct proc *p) } static int -flaclose(dev_t dev, int flags, int fmt, struct proc *p) +flaclose(dev_t dev, int flags, int fmt, struct thread *td) { int error; struct fla_s *sc; if (fla_debug) printf("flaclose(%s %x %x %p)\n", - devtoname(dev), flags, fmt, p); + devtoname(dev), flags, fmt, td); sc = dev->si_drv1; @@ -176,12 +178,12 @@ flaclose(dev_t dev, int flags, int fmt, struct proc *p) } static int -flaioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) +flaioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { if (fla_debug) printf("flaioctl(%s %lx %p %x %p)\n", - devtoname(dev), cmd, addr, flags, p); + devtoname(dev), cmd, addr, flags, td); return (ENOIOCTL); } diff --git a/sys/dev/disk/mcd/mcd.c b/sys/dev/disk/mcd/mcd.c index 550595ef5e..5c3a40db68 100644 --- a/sys/dev/disk/mcd/mcd.c +++ b/sys/dev/disk/mcd/mcd.c @@ -41,13 +41,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/mcd.c,v 1.115 2000/01/29 16:17:34 peter Exp $ - * $DragonFly: src/sys/dev/disk/mcd/Attic/mcd.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/disk/mcd/Attic/mcd.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; #include "mcd.h" #include #include +#include #include #include #include @@ -266,7 +267,7 @@ int mcd_attach(struct isa_device *dev) return 1; } -int mcdopen(dev_t dev, int flags, int fmt, struct proc *p) +int mcdopen(dev_t dev, int flags, int fmt, struct thread *td) { int unit,part,phys,r,retry; struct mcd_data *cd; @@ -358,7 +359,7 @@ MCD_TRACE("open: partition=%d, disksize = %ld, blksize=%d\n", return ENXIO; } -int mcdclose(dev_t dev, int flags, int fmt, struct proc *p) +int mcdclose(dev_t dev, int flags, int fmt, struct thread *td) { int unit,part; struct mcd_data *cd; @@ -500,7 +501,7 @@ static void mcd_start(int unit) return; } -int mcdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) +int mcdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { struct mcd_data *cd; int unit,part,retry,r; @@ -1098,7 +1099,7 @@ nextblock: hsg2msf(blknum,rbuf.start_msf); retry_read: /* send the read command */ - disable_intr(); + cpu_disable_intr(); mcd_put(com_port,cd->read_command); mcd_put(com_port,rbuf.start_msf[0]); mcd_put(com_port,rbuf.start_msf[1]); @@ -1106,7 +1107,7 @@ retry_read: mcd_put(com_port,0); mcd_put(com_port,0); mcd_put(com_port,1); - enable_intr(); + cpu_enable_intr(); /* Spin briefly (<= 2ms) to avoid missing next block */ for (i = 0; i < 20; i++) { @@ -1756,7 +1757,7 @@ mcd_play(int unit, struct mcd_read2 *pb) cd->lastpb = *pb; for(retry=0; retrystart_msf[0]); outb(com_port, pb->start_msf[1]); @@ -1764,7 +1765,7 @@ mcd_play(int unit, struct mcd_read2 *pb) outb(com_port, pb->end_msf[0]); outb(com_port, pb->end_msf[1]); outb(com_port, pb->end_msf[2]); - enable_intr(); + cpu_enable_intr(); status=mcd_getstat(unit, 0); if (status == -1) diff --git a/sys/dev/disk/scd/scd.c b/sys/dev/disk/scd/scd.c index 37cdd0b9d3..8e23985e97 100644 --- a/sys/dev/disk/scd/scd.c +++ b/sys/dev/disk/scd/scd.c @@ -42,7 +42,7 @@ /* $FreeBSD: src/sys/i386/isa/scd.c,v 1.54 2000/01/29 16:00:30 peter Exp $ */ -/* $DragonFly: src/sys/dev/disk/scd/Attic/scd.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/scd/Attic/scd.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -229,7 +229,7 @@ scd_attach(struct isa_device *dev) } static int -scdopen(dev_t dev, int flags, int fmt, struct proc *p) +scdopen(dev_t dev, int flags, int fmt, struct thread *td) { int unit,part,phys; int rc; @@ -283,7 +283,7 @@ scdopen(dev_t dev, int flags, int fmt, struct proc *p) } static int -scdclose(dev_t dev, int flags, int fmt, struct proc *p) +scdclose(dev_t dev, int flags, int fmt, struct thread *td) { int unit,part,phys; struct scd_data *cd; @@ -415,7 +415,7 @@ scd_start(int unit) } static int -scdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) +scdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { struct scd_data *cd; int unit,part; @@ -920,7 +920,7 @@ writeparam: reg = port + OREG_WPARAMS; /* send the read command */ - disable_intr(); + cpu_disable_intr(); outb(reg, sdata[0]); outb(reg, sdata[1]); outb(reg, sdata[2]); @@ -928,7 +928,7 @@ writeparam: outb(reg, 0); outb(reg, 1); outb(port+OREG_COMMAND, CMD_READ); - enable_intr(); + cpu_enable_intr(); mbx->count = RDELAY_WAITREAD; for (i = 0; i < 50; i++) { diff --git a/sys/dev/disk/wcd/wd_cd.c b/sys/dev/disk/wcd/wd_cd.c index 3511ba7064..71fb27bef4 100644 --- a/sys/dev/disk/wcd/wd_cd.c +++ b/sys/dev/disk/wcd/wd_cd.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/wd_cd.c,v 1.29 2000/01/29 16:00:33 peter Exp $ - * $DragonFly: src/sys/dev/disk/wcd/Attic/wd_cd.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/disk/wcd/Attic/wd_cd.c,v 1.6 2003/07/21 07:57:45 dillon Exp $ */ #include @@ -382,7 +382,7 @@ acd_describe(struct acd *cdp) } static int -acdopen(dev_t dev, int flags, int fmt, struct proc *p) +acdopen(dev_t dev, int flags, int fmt, struct thread *td) { int lun = dkunit(dev); struct acd *cdp; @@ -408,7 +408,7 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p) } int -acdclose(dev_t dev, int flags, int fmt, struct proc *p) +acdclose(dev_t dev, int flags, int fmt, struct thread *td) { struct acd *cdp = acdtab[dkunit(dev)]; @@ -586,7 +586,7 @@ msf2lba(u_char m, u_char s, u_char f) } int -acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) +acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { int lun = dkunit(dev); struct acd *cdp = acdtab[lun]; diff --git a/sys/dev/disk/wd/wd.c b/sys/dev/disk/wd/wd.c index fca285c088..9cd8bb1689 100644 --- a/sys/dev/disk/wd/wd.c +++ b/sys/dev/disk/wd/wd.c @@ -35,7 +35,7 @@ * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/isa/wd.c,v 1.219.2.2 2000/08/04 22:31:07 peter Exp $ - * $DragonFly: src/sys/dev/disk/wd/Attic/wd.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/disk/wd/Attic/wd.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ */ /* TODO: @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -1116,7 +1117,7 @@ done: ; * Initialize a drive. */ int -wdopen(dev_t dev, int flags, int fmt, struct proc *p) +wdopen(dev_t dev, int flags, int fmt, struct thread *td) { register unsigned int lunit; register struct disk *du; @@ -1780,14 +1781,14 @@ failed: } int -wdclose(dev_t dev, int flags, int fmt, struct proc *p) +wdclose(dev_t dev, int flags, int fmt, struct thread *td) { dsclose(dev, fmt, wddrives[dkunit(dev)]->dk_slices); return (0); } int -wdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) +wdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { int lunit = dkunit(dev); register struct disk *du; diff --git a/sys/dev/disk/wfd/wfd.c b/sys/dev/disk/wfd/wfd.c index 31a70bfdf4..fe23583e1c 100644 --- a/sys/dev/disk/wfd/wfd.c +++ b/sys/dev/disk/wfd/wfd.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/wfd.c,v 1.35 2000/01/29 16:00:33 peter Exp $ - * $DragonFly: src/sys/dev/disk/wfd/Attic/wfd.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/disk/wfd/Attic/wfd.c,v 1.6 2003/07/21 07:57:45 dillon Exp $ */ /* @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -321,7 +322,7 @@ void wfd_describe (struct wfd *t) } } -int wfdopen (dev_t dev, int flags, int fmt, struct proc *p) +int wfdopen (dev_t dev, int flags, int fmt, struct thread *td) { int lun = UNIT(dev); struct wfd *t; @@ -376,7 +377,7 @@ int wfdopen (dev_t dev, int flags, int fmt, struct proc *p) * Close the device. Only called if we are the LAST * occurence of an open device. */ -int wfdclose (dev_t dev, int flags, int fmt, struct proc *p) +int wfdclose (dev_t dev, int flags, int fmt, struct thread *td) { int lun = UNIT(dev); struct wfd *t = wfdtab[lun]; @@ -605,7 +606,7 @@ static int wfd_request_wait (struct wfd *t, u_char cmd, u_char a1, u_char a2, * Perform special action on behalf of the user. * Knows about the internals of this device */ -int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) +int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { int lun = UNIT(dev); struct wfd *t = wfdtab[lun]; @@ -724,4 +725,4 @@ static void wfd_drvinit(void *unused) cdevsw_add(&wfd_cdevsw); } -SYSINIT(wfddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wfd_drvinit,NULL) +SYSINIT(wfddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+WFD_CDEV_MAJOR,wfd_drvinit,NULL) diff --git a/sys/dev/disk/wst/wst.c b/sys/dev/disk/wst/wst.c index afaaec5f58..e087001832 100644 --- a/sys/dev/disk/wst/wst.c +++ b/sys/dev/disk/wst/wst.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/wst.c,v 1.28 2000/01/29 16:00:34 peter Exp $ - * $DragonFly: src/sys/dev/disk/wst/Attic/wst.c,v 1.3 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/disk/wst/Attic/wst.c,v 1.4 2003/07/21 07:57:45 dillon Exp $ */ #include "wdc.h" @@ -335,7 +335,7 @@ wst_describe(struct wst *t) } int -wstopen(dev_t dev, int flags, int fmt, struct proc *p) +wstopen(dev_t dev, int flags, int fmt, struct thread *td) { int lun = UNIT(dev); struct wst *t; @@ -358,7 +358,7 @@ wstopen(dev_t dev, int flags, int fmt, struct proc *p) } int -wstclose(dev_t dev, int flags, int fmt, struct proc *p) +wstclose(dev_t dev, int flags, int fmt, struct thread *td) { int lun = UNIT(dev); struct wst *t = wsttab[lun]; @@ -573,7 +573,7 @@ wst_error(struct wst *t, struct atapires result) } int -wstioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) +wstioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { int lun = UNIT(dev); int error = 0; diff --git a/sys/dev/disk/wt/wt.c b/sys/dev/disk/wt/wt.c index 56b2b3cb80..702297b9c2 100644 --- a/sys/dev/disk/wt/wt.c +++ b/sys/dev/disk/wt/wt.c @@ -21,7 +21,7 @@ * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 * $FreeBSD: src/sys/i386/isa/wt.c,v 1.57.2.1 2000/08/08 19:49:53 peter Exp $ - * $DragonFly: src/sys/dev/disk/wt/wt.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/disk/wt/wt.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ * */ @@ -278,7 +278,7 @@ struct isa_driver wtdriver = { wtprobe, wtattach, "wt", }; * Open routine, called on every device open. */ static int -wtopen (dev_t dev, int flag, int fmt, struct proc *p) +wtopen (dev_t dev, int flag, int fmt, struct thread *td) { int u = minor (dev) & T_UNIT; wtinfo_t *t = wttab + u; @@ -360,7 +360,7 @@ wtopen (dev_t dev, int flag, int fmt, struct proc *p) * Close routine, called on last device close. */ static int -wtclose (dev_t dev, int flags, int fmt, struct proc *p) +wtclose (dev_t dev, int flags, int fmt, struct thread *td) { int u = minor (dev) & T_UNIT; wtinfo_t *t = wttab + u; @@ -409,7 +409,7 @@ done: * ioctl (int fd, MTIOCTOP, struct mtop *buf) -- do BSD-like op */ static int -wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p) +wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct thread *td) { int u = minor (dev) & T_UNIT; wtinfo_t *t = wttab + u; diff --git a/sys/dev/drm/drm_bufs.h b/sys/dev/drm/drm_bufs.h index d63e4a8818..9ccb7d3b3b 100644 --- a/sys/dev/drm/drm_bufs.h +++ b/sys/dev/drm/drm_bufs.h @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith * Gareth Hughes * $FreeBSD: src/sys/dev/drm/drm_bufs.h,v 1.5.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_bufs.h,v 1.2 2003/06/17 04:28:24 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_bufs.h,v 1.3 2003/07/21 07:57:40 dillon Exp $ */ #include "dev/drm/drmP.h" @@ -902,11 +902,7 @@ int DRM(mapbufs)( DRM_IOCTL_ARGS ) const int zero = 0; vm_offset_t virtual, address; #ifdef __FreeBSD__ -#if __FreeBSD_version >= 500000 struct vmspace *vms = p->td_proc->p_vmspace; -#else - struct vmspace *vms = p->p_vmspace; -#endif #endif /* __FreeBSD__ */ #ifdef __NetBSD__ struct vnode *vn; diff --git a/sys/dev/drm/drm_fops.h b/sys/dev/drm/drm_fops.h index 1abe393bfd..3f8251a228 100644 --- a/sys/dev/drm/drm_fops.h +++ b/sys/dev/drm/drm_fops.h @@ -30,7 +30,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_fops.h,v 1.7.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_fops.h,v 1.2 2003/06/17 04:28:24 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_fops.h,v 1.3 2003/07/21 07:57:40 dillon Exp $ */ #include "dev/drm/drmP.h" @@ -41,8 +41,8 @@ drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p) uid_t uid = p->td_ucred->cr_svuid; pid_t pid = p->td_proc->p_pid; #else - uid_t uid = p->p_cred->p_svuid; - pid_t pid = p->p_pid; + uid_t uid = p->td_proc->p_ucred->cr_svuid; + pid_t pid = p->td_proc->p_pid; #endif drm_file_t *priv; @@ -77,8 +77,8 @@ int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p, priv->uid = p->td_ucred->cr_svuid; priv->pid = p->td_proc->p_pid; #else - priv->uid = p->p_cred->p_svuid; - priv->pid = p->p_pid; + priv->uid = p->td_proc->p_ucred->cr_svuid; + priv->pid = p->td_proc->p_pid; #endif priv->refs = 1; diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h index 4af4aabdad..db8c6806f9 100644 --- a/sys/dev/drm/drm_os_freebsd.h +++ b/sys/dev/drm/drm_os_freebsd.h @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/dev/drm/drm_os_freebsd.h,v 1.10.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.5 2003/07/19 21:14:20 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.6 2003/07/21 07:57:40 dillon Exp $ */ #include #include @@ -92,14 +92,14 @@ #define DRM_SPINUNLOCK(u) mtx_unlock(u); #define DRM_CURRENTPID curthread->td_proc->p_pid #else -#define DRM_CURPROC curproc -#define DRM_STRUCTPROC struct proc +#define DRM_CURPROC curthread +#define DRM_STRUCTPROC struct thread #define DRM_SPINTYPE struct lwkt_token #define DRM_SPININIT(l,name) lwkt_inittoken(&l) #define DRM_SPINUNINIT(l) #define DRM_SPINLOCK(l) lwkt_gettoken(l) #define DRM_SPINUNLOCK(u) lwkt_reltoken(u); -#define DRM_CURRENTPID curproc->p_pid +#define DRM_CURRENTPID curthread->td_proc->p_pid #endif /* Currently our DRMFILE (filp) is a void * which is actually the pid diff --git a/sys/dev/misc/gpib/gpib.c b/sys/dev/misc/gpib/gpib.c index 29f094702b..c92b2fbf3d 100644 --- a/sys/dev/misc/gpib/gpib.c +++ b/sys/dev/misc/gpib/gpib.c @@ -17,7 +17,7 @@ * all derivative works or modified versions. * * $FreeBSD: src/sys/i386/isa/gpib.c,v 1.29 2000/01/29 16:17:32 peter Exp $ - * $DragonFly: src/sys/dev/misc/gpib/gpib.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/misc/gpib/gpib.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ * */ /*Please read the README file for usage information*/ @@ -155,11 +155,11 @@ gpattach(isdp) * i.e. even if gpib5 is open, we can't open another minor device */ static int -gpopen(dev, flags, fmt, p) +gpopen(dev, flags, fmt, td) dev_t dev; int flags; int fmt; - struct proc *p; + struct thread *td; { struct gpib_softc *sc = &gpib_sc; u_char unit; @@ -233,11 +233,11 @@ enableremote(unit); * Close gpib device. */ static int -gpclose(dev, flags, fmt, p) +gpclose(dev, flags, fmt, td) dev_t dev; int flags; int fmt; - struct proc *p; + struct thread *td; { struct gpib_softc *sc = &gpib_sc; unsigned char unit; @@ -389,7 +389,7 @@ gpwrite(dev, uio, ioflag) write to using a minor device = its GPIB address */ static int -gpioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +gpioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { struct gpibdata *gd = (struct gpibdata *)data; int error,result; diff --git a/sys/dev/misc/labpc/labpc.c b/sys/dev/misc/labpc/labpc.c index 40167397f0..7f6ef6655b 100644 --- a/sys/dev/misc/labpc/labpc.c +++ b/sys/dev/misc/labpc/labpc.c @@ -39,7 +39,7 @@ * dufault@hda.com * * $FreeBSD: src/sys/i386/isa/labpc.c,v 1.35 1999/09/25 18:24:08 phk Exp $ - * $DragonFly: src/sys/dev/misc/labpc/labpc.c,v 1.3 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/misc/labpc/labpc.c,v 1.4 2003/07/21 07:57:44 dillon Exp $ * */ @@ -717,7 +717,7 @@ lockout_multiple_open(dev_t current, dev_t next) } static int -labpcopen(dev_t dev, int flags, int fmt, struct proc *p) +labpcopen(dev_t dev, int flags, int fmt, struct thread *td) { u_short unit = UNIT(dev); @@ -754,7 +754,7 @@ labpcopen(dev_t dev, int flags, int fmt, struct proc *p) } static int -labpcclose(dev_t dev, int flags, int fmt, struct proc *p) +labpcclose(dev_t dev, int flags, int fmt, struct thread *td) { struct ctlr *ctlr = labpcs[UNIT(dev)]; @@ -1028,7 +1028,7 @@ labpcstrategy(struct buf *bp) } static int -labpcioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *p) +labpcioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct thread *td) { struct ctlr *ctlr = labpcs[UNIT(dev)]; diff --git a/sys/dev/misc/mse/mse.c b/sys/dev/misc/mse/mse.c index 5e25b312a7..2989dc13cb 100644 --- a/sys/dev/misc/mse/mse.c +++ b/sys/dev/misc/mse/mse.c @@ -12,7 +12,7 @@ * without express or implied warranty. * * $FreeBSD: src/sys/i386/isa/mse.c,v 1.49.2.1 2000/03/20 13:58:47 yokota Exp $ - * $DragonFly: src/sys/dev/misc/mse/mse.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/misc/mse/mse.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -396,11 +396,11 @@ mse_detach(dev) * Exclusive open the mouse, initialize it and enable interrupts. */ static int -mseopen(dev, flags, fmt, p) +mseopen(dev, flags, fmt, td) dev_t dev; int flags; int fmt; - struct proc *p; + struct thread *td; { mse_softc_t *sc; int s; @@ -436,11 +436,11 @@ mseopen(dev, flags, fmt, p) * mseclose: just turn off mouse innterrupts. */ static int -mseclose(dev, flags, fmt, p) +mseclose(dev, flags, fmt, td) dev_t dev; int flags; int fmt; - struct proc *p; + struct thread *td; { mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); int s; @@ -526,12 +526,12 @@ mseread(dev, uio, ioflag) * mseioctl: process ioctl commands. */ static int -mseioctl(dev, cmd, addr, flag, p) +mseioctl(dev, cmd, addr, flag, td) dev_t dev; u_long cmd; caddr_t addr; int flag; - struct proc *p; + struct thread *td; { mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); mousestatus_t status; @@ -643,10 +643,10 @@ mseioctl(dev, cmd, addr, flag, p) * msepoll: check for mouse input to be processed. */ static int -msepoll(dev, events, p) +msepoll(dev, events, td) dev_t dev; int events; - struct proc *p; + struct thread *td; { mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); int s; @@ -663,7 +663,7 @@ msepoll(dev, events, p) * Since this is an exclusive open device, any previous * proc pointer is trash now, so we can just assign it. */ - selrecord(p, &sc->sc_selp); + selrecord(td, &sc->sc_selp); } } splx(s); diff --git a/sys/dev/misc/pcfclock/pcfclock.c b/sys/dev/misc/pcfclock/pcfclock.c index 0b48cb774c..5cecb637c2 100644 --- a/sys/dev/misc/pcfclock/pcfclock.c +++ b/sys/dev/misc/pcfclock/pcfclock.c @@ -22,7 +22,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/pcfclock.c,v 1.3.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/dev/misc/pcfclock/pcfclock.c,v 1.3 2003/07/21 05:50:33 dillon Exp $ + * $DragonFly: src/sys/dev/misc/pcfclock/pcfclock.c,v 1.4 2003/07/21 07:57:41 dillon Exp $ * */ @@ -159,7 +159,7 @@ pcfclock_attach(device_t dev) } static int -pcfclock_open(dev_t dev, int flag, int fms, struct proc *p) +pcfclock_open(dev_t dev, int flag, int fms, struct thread *td) { u_int unit = minor(dev); struct pcfclock_data *sc = UNITOSOFTC(unit); @@ -180,7 +180,7 @@ pcfclock_open(dev_t dev, int flag, int fms, struct proc *p) } static int -pcfclock_close(dev_t dev, int flags, int fmt, struct proc *p) +pcfclock_close(dev_t dev, int flags, int fmt, struct thread *td) { u_int unit = minor(dev); struct pcfclock_data *sc = UNITOSOFTC(unit); diff --git a/sys/dev/misc/pps/pps.c b/sys/dev/misc/pps/pps.c index ae79843895..01d310cc82 100644 --- a/sys/dev/misc/pps/pps.c +++ b/sys/dev/misc/pps/pps.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/dev/ppbus/pps.c,v 1.24.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/dev/misc/pps/pps.c,v 1.3 2003/07/21 05:50:34 dillon Exp $ + * $DragonFly: src/sys/dev/misc/pps/pps.c,v 1.4 2003/07/21 07:57:41 dillon Exp $ * * This driver implements a draft-mogul-pps-api-02.txt PPS source. * @@ -129,7 +129,7 @@ ppsattach(device_t dev) } static int -ppsopen(dev_t dev, int flags, int fmt, struct proc *p) +ppsopen(dev_t dev, int flags, int fmt, struct thread *td) { u_int unit = minor(dev); struct pps_data *sc = UNITOSOFTC(unit); @@ -158,7 +158,7 @@ ppsopen(dev_t dev, int flags, int fmt, struct proc *p) } static int -ppsclose(dev_t dev, int flags, int fmt, struct proc *p) +ppsclose(dev_t dev, int flags, int fmt, struct thread *td) { u_int unit = minor(dev); struct pps_data *sc = UNITOSOFTC(unit); @@ -197,7 +197,7 @@ ppsintr(void *arg) } static int -ppsioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +ppsioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { u_int unit = minor(dev); struct pps_data *sc = UNITOSOFTC(unit); diff --git a/sys/dev/misc/spic/spic.c b/sys/dev/misc/spic/spic.c index de58a438ca..92e9a6aac8 100644 --- a/sys/dev/misc/spic/spic.c +++ b/sys/dev/misc/spic/spic.c @@ -48,7 +48,7 @@ * also provided sample code upon which this driver was based. * * $FreeBSD: src/sys/i386/isa/spic.c,v 1.4.2.1 2002/04/15 00:52:12 will Exp $ - * $DragonFly: src/sys/dev/misc/spic/spic.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/misc/spic/spic.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ */ #include @@ -450,7 +450,7 @@ spictimeout(void *arg) } static int -spicopen(dev_t dev, int flag, int fmt, struct proc *p) +spicopen(dev_t dev, int flag, int fmt, struct thread *td) { struct spic_softc *sc; @@ -468,7 +468,7 @@ spicopen(dev_t dev, int flag, int fmt, struct proc *p) } static int -spicclose(dev_t dev, int flag, int fmt, struct proc *p) +spicclose(dev_t dev, int flag, int fmt, struct thread *td) { struct spic_softc *sc; @@ -515,7 +515,7 @@ spicread(dev_t dev, struct uio *uio, int flag) } static int -spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) +spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { struct spic_softc *sc; @@ -525,12 +525,16 @@ spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) } static int -spicpoll(dev_t dev, int events, struct proc *p) +spicpoll(dev_t dev, int events, struct thread *td) { struct spic_softc *sc; + struct proc *p; struct proc *p1; int revents = 0, s; + p = td->td_proc; + KKASSERT(p); + sc = devclass_get_softc(spic_devclass, 0); s = spltty(); if (events & (POLLIN | POLLRDNORM)) { diff --git a/sys/dev/misc/spigot/spigot.c b/sys/dev/misc/spigot/spigot.c index aca5a05049..2f8c6a55ab 100644 --- a/sys/dev/misc/spigot/spigot.c +++ b/sys/dev/misc/spigot/spigot.c @@ -43,7 +43,7 @@ * Version 1.7, December 1995. * * $FreeBSD: src/sys/i386/isa/spigot.c,v 1.44 2000/01/29 16:17:36 peter Exp $ - * $DragonFly: src/sys/dev/misc/spigot/spigot.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/misc/spigot/spigot.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ * */ @@ -155,7 +155,7 @@ spigot_attach(struct isa_device *devp) } static int -spigot_open(dev_t dev, int flags, int fmt, struct proc *p) +spigot_open(dev_t dev, int flags, int fmt, struct thread *td) { int error; struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; @@ -188,7 +188,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; } static int -spigot_close(dev_t dev, int flags, int fmt, struct proc *p) +spigot_close(dev_t dev, int flags, int fmt, struct thread *td) { struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; @@ -215,7 +215,7 @@ spigot_read(dev_t dev, struct uio *uio, int ioflag) static int -spigot_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +spigot_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) { int error; struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; @@ -224,7 +224,7 @@ struct spigot_info *info; if(!data) return(EINVAL); switch(cmd){ case SPIGOT_SETINT: - ss->p = p; + ss->p = td->td_proc; ss->signal_num = *((int *)data); break; case SPIGOT_IOPL_ON: /* allow access to the IO PAGE */ @@ -235,10 +235,10 @@ struct spigot_info *info; if (securelevel > 0) return EPERM; #endif - p->p_md.md_regs->tf_eflags |= PSL_IOPL; + td->td_proc->p_md.md_regs->tf_eflags |= PSL_IOPL; break; case SPIGOT_IOPL_OFF: /* deny access to the IO PAGE */ - p->p_md.md_regs->tf_eflags &= ~PSL_IOPL; + td->td_proc->p_md.md_regs->tf_eflags &= ~PSL_IOPL; break; case SPIGOT_GET_INFO: info = (struct spigot_info *)data; diff --git a/sys/dev/misc/tw/tw.c b/sys/dev/misc/tw/tw.c index f0682beff4..8347c070a7 100644 --- a/sys/dev/misc/tw/tw.c +++ b/sys/dev/misc/tw/tw.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/tw.c,v 1.38 2000/01/29 16:00:32 peter Exp $ - * $DragonFly: src/sys/dev/misc/tw/tw.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/misc/tw/tw.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ * */ @@ -411,11 +411,11 @@ static int twattach(idp) return (1); } -int twopen(dev, flag, mode, p) +int twopen(dev, flag, mode, td) dev_t dev; int flag; int mode; - struct proc *p; + struct thread *td; { struct tw_sc *sc = &tw_sc[TWUNIT(dev)]; int s; @@ -431,11 +431,11 @@ int twopen(dev, flag, mode, p) return(0); } -int twclose(dev, flag, mode, p) +int twclose(dev, flag, mode, td) dev_t dev; int flag; int mode; - struct proc *p; + struct thread *td; { struct tw_sc *sc = &tw_sc[TWUNIT(dev)]; int s; @@ -537,10 +537,10 @@ int twwrite(dev, uio, ioflag) * Determine if there is data available for reading */ -int twpoll(dev, events, p) +int twpoll(dev, events, td) dev_t dev; int events; - struct proc *p; + struct thread *td; { struct tw_sc *sc; int s; @@ -553,7 +553,7 @@ int twpoll(dev, events, p) if(sc->sc_nextin != sc->sc_nextout) revents |= events & (POLLIN | POLLRDNORM); else - selrecord(p, &sc->sc_selp); + selrecord(td, &sc->sc_selp); } splx(s); return(revents); diff --git a/sys/dev/misc/xrpu/xrpu.c b/sys/dev/misc/xrpu/xrpu.c index b427296f49..0e7a82e0c5 100644 --- a/sys/dev/misc/xrpu/xrpu.c +++ b/sys/dev/misc/xrpu/xrpu.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/pci/xrpu.c,v 1.19.2.1 2000/08/02 22:19:57 peter Exp $ - * $DragonFly: src/sys/dev/misc/xrpu/Attic/xrpu.c,v 1.3 2003/07/21 05:50:46 dillon Exp $ + * $DragonFly: src/sys/dev/misc/xrpu/Attic/xrpu.c,v 1.4 2003/07/21 07:57:52 dillon Exp $ * * A very simple device driver for PCI cards based on Xilinx 6200 series * FPGA/RPU devices. Current Functionality is to allow you to open and @@ -118,7 +118,7 @@ xrpu_poll_pps(struct timecounter *tc) } static int -xrpu_open(dev_t dev, int flag, int mode, struct proc *p) +xrpu_open(dev_t dev, int flag, int mode, struct thread *td) { struct softc *sc = devclass_get_softc(xrpu_devclass, dev2unit(dev)); @@ -129,7 +129,7 @@ xrpu_open(dev_t dev, int flag, int mode, struct proc *p) } static int -xrpu_close(dev_t dev, int flag, int mode, struct proc *p) +xrpu_close(dev_t dev, int flag, int mode, struct thread *td) { return (0); } @@ -144,7 +144,7 @@ xrpu_mmap(dev_t dev, vm_offset_t offset, int nprot) } static int -xrpu_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr) +xrpu_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) { struct softc *sc = dev->si_drv1; int i, error; diff --git a/sys/dev/netif/cx/cx.c b/sys/dev/netif/cx/cx.c index 72b7d7ddf7..8f979e66c8 100644 --- a/sys/dev/netif/cx/cx.c +++ b/sys/dev/netif/cx/cx.c @@ -16,7 +16,7 @@ * Version 1.9, Wed Oct 4 18:58:15 MSK 1995 * * $FreeBSD: src/sys/i386/isa/cx.c,v 1.45.2.1 2001/02/26 04:23:09 jlemon Exp $ - * $DragonFly: src/sys/dev/netif/cx/cx.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/cx/cx.c,v 1.6 2003/07/21 07:57:44 dillon Exp $ * */ #undef DEBUG @@ -424,7 +424,7 @@ int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) if (! tp) return (EINVAL); #if __FreeBSD__ >= 2 - error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, flag, td); #else error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, flag); #endif diff --git a/sys/dev/netif/rdp/if_rdp.c b/sys/dev/netif/rdp/if_rdp.c index ebf8c4fa87..deb5eb6893 100644 --- a/sys/dev/netif/rdp/if_rdp.c +++ b/sys/dev/netif/rdp/if_rdp.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/if_rdp.c,v 1.6.2.2 2000/07/17 21:24:32 archie Exp $ - * $DragonFly: src/sys/dev/netif/rdp/if_rdp.c,v 1.2 2003/06/17 04:28:37 dillon Exp $ + * $DragonFly: src/sys/dev/netif/rdp/if_rdp.c,v 1.3 2003/07/21 07:57:44 dillon Exp $ */ /* @@ -495,7 +495,7 @@ rdp_probe(struct isa_device *isa_dev) * We have found something that could be a RTL 80[01]2, now * see whether we can generate an interrupt. */ - disable_intr(); + cpu_disable_intr(); /* * Test whether our configured IRQ is working. @@ -534,7 +534,7 @@ rdp_probe(struct isa_device *isa_dev) outb(sc->baseaddr + lpt_control, Ctrl_SelData); WrNib(sc, CMR2, CMR2_IRQINV); - enable_intr(); + cpu_enable_intr(); if (bootverbose) printf("rdp%d: irq maps / lpt status " diff --git a/sys/dev/serial/cy/cy.c b/sys/dev/serial/cy/cy.c index 0a8c67298e..09dee98757 100644 --- a/sys/dev/serial/cy/cy.c +++ b/sys/dev/serial/cy/cy.c @@ -28,7 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/cy.c,v 1.97.2.2 2001/08/22 13:04:58 bde Exp $ - * $DragonFly: src/sys/dev/serial/cy/cy.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/serial/cy/cy.c,v 1.6 2003/07/21 07:57:44 dillon Exp $ */ #include "opt_compat.h" @@ -91,8 +91,8 @@ #include #ifdef SMP -#define disable_intr() COM_DISABLE_INTR() -#define enable_intr() COM_ENABLE_INTR() +#define disable_intr() com_lock() +#define enable_intr() com_unlock() #endif /* SMP */ /* @@ -346,7 +346,7 @@ static void siointr1 __P((struct com_s *com)); #endif static int commctl __P((struct com_s *com, int bits, int how)); static int comparam __P((struct tty *tp, struct termios *t)); -static swihand_t siopoll; +static inthand2_t siopoll; static int sioprobe __P((struct isa_device *dev)); static void siosettimeout __P((void)); static int siosetwater __P((struct com_s *com, speed_t speed)); @@ -622,7 +622,7 @@ cyattach_common(cy_iobase, cy_align) if (!sio_registered) { cdevsw_add(&sio_cdevsw); - register_swi(SWI_TTY, siopoll); + register_swi(SWI_TTY, siopoll, NULL, "cy"); sio_registered = TRUE; } minorbase = UNIT_TO_MINOR(unit); @@ -654,7 +654,7 @@ cyattach_common(cy_iobase, cy_align) } static int -sioopen(dev_t dev; int flag; int mode; struct thread *td) +sioopen(dev_t dev, int flag, int mode, struct thread *td) { struct com_s *com; int error; @@ -1085,7 +1085,7 @@ siointr(unit) cy_addr iobase; u_char status; - COM_LOCK(); /* XXX could this be placed down lower in the loop? */ + com_lock(); /* XXX could this be placed down lower in the loop? */ baseu = unit * CY_MAX_PORTS; cy_align = com_addr(baseu)->cy_align; @@ -1550,7 +1550,7 @@ terminate_tx_service: schedsofttty(); - COM_UNLOCK(); + com_unlock(); } #if 0 @@ -1641,7 +1641,7 @@ sioioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) if (lt->c_ospeed != 0) dt->c_ospeed = tp->t_ospeed; } - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td); if (error != ENOIOCTL) return (error); s = spltty(); @@ -1717,7 +1717,7 @@ sioioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) } static void -siopoll() +siopoll(void *data) { int unit; diff --git a/sys/dev/serial/dgb/dgm.c b/sys/dev/serial/dgb/dgm.c index 001d913fcb..0310c2278a 100644 --- a/sys/dev/serial/dgb/dgm.c +++ b/sys/dev/serial/dgb/dgm.c @@ -1,6 +1,6 @@ /*- * $FreeBSD: src/sys/dev/dgb/dgm.c,v 1.31.2.3 2001/10/07 09:02:25 brian Exp $ - * $DragonFly: src/sys/dev/serial/dgb/dgm.c,v 1.5 2003/07/21 05:50:29 dillon Exp $ + * $DragonFly: src/sys/dev/serial/dgb/dgm.c,v 1.6 2003/07/21 07:57:40 dillon Exp $ * * This driver and the associated header files support the ISA PC/Xem * Digiboards. Its evolutionary roots are described below. @@ -1595,7 +1595,7 @@ dgmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) if (cmd == TIOCSETAW || cmd == TIOCSETAF) port->mustdrain = 1; - error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, p); + error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, td); if (error != ENOIOCTL) return error; s = spltty(); diff --git a/sys/dev/serial/rc/rc.c b/sys/dev/serial/rc/rc.c index a2c5541402..e2d5bd1e85 100644 --- a/sys/dev/serial/rc/rc.c +++ b/sys/dev/serial/rc/rc.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/rc.c,v 1.53.2.1 2001/02/26 04:23:10 jlemon Exp $ - * $DragonFly: src/sys/dev/serial/rc/rc.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/serial/rc/rc.c,v 1.6 2003/07/21 07:57:44 dillon Exp $ * */ @@ -181,7 +181,7 @@ static int rc_modctl __P((struct rc_chans *, int, int)); static void rc_start __P((struct tty *)); static void rc_stop __P((struct tty *, int rw)); static int rc_param __P((struct tty *, struct termios *)); -static swihand_t rcpoll; +static inthand2_t rcpoll; static void rc_reinit __P((struct rc_softc *)); #ifdef RCDEBUG static void printrcflags(); @@ -267,7 +267,7 @@ rcattach(dvp) rcb->rcb_probed = RC_ATTACHED; if (!rc_started) { cdevsw_add(&rc_cdevsw); - register_swi(SWI_TTY, rcpoll); + register_swi(SWI_TTY, rcpoll, NULL, "rcpoll"); rc_wakeup((void *)NULL); rc_started = 1; } @@ -502,7 +502,7 @@ register struct tty *tp; return; s = spltty(); rc->rc_flags |= RC_OSBUSY; - disable_intr(); + cpu_disable_intr(); if (tp->t_state & TS_TTSTOP) rc->rc_flags |= RC_OSUSP; else @@ -518,7 +518,7 @@ register struct tty *tp; rcout(CD180_CAR, rc->rc_chan); rcout(CD180_MSVR, rc->rc_msvr |= MSVR_RTS); } - enable_intr(); + cpu_enable_intr(); if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP)) goto out; #ifdef RCDEBUG @@ -537,10 +537,10 @@ register struct tty *tp; tp->t_state |= TS_BUSY; ocnt = q_to_b(&tp->t_outq, rc->rc_obuf, sizeof rc->rc_obuf); - disable_intr(); + cpu_disable_intr(); rc->rc_optr = rc->rc_obuf; rc->rc_obufend = rc->rc_optr + ocnt; - enable_intr(); + cpu_enable_intr(); if (!(rc->rc_ier & IER_TxRdy)) { #ifdef RCDEBUG printf("rc%d/%d: rcstart enable txint\n", rc->rc_rcb->rcb_unit, rc->rc_chan); @@ -555,7 +555,8 @@ out: } /* Handle delayed events. */ -void rcpoll() +void +rcpoll(void *dummy) { register struct rc_chans *rc; register struct rc_softc *rcb; @@ -578,30 +579,30 @@ repeat: printrcflags(rc, "rcevent"); #endif if (rc->rc_flags & RC_WAS_BUFOVFL) { - disable_intr(); + cpu_disable_intr(); rc->rc_flags &= ~RC_WAS_BUFOVFL; rc_scheduled_event--; - enable_intr(); + cpu_enable_intr(); printf("rc%d/%d: interrupt-level buffer overflow\n", unit, chan); } if (rc->rc_flags & RC_WAS_SILOVFL) { - disable_intr(); + cpu_disable_intr(); rc->rc_flags &= ~RC_WAS_SILOVFL; rc_scheduled_event--; - enable_intr(); + cpu_enable_intr(); printf("rc%d/%d: silo overflow\n", unit, chan); } if (rc->rc_flags & RC_MODCHG) { - disable_intr(); + cpu_disable_intr(); rc->rc_flags &= ~RC_MODCHG; rc_scheduled_event -= LOTS_OF_EVENTS; - enable_intr(); + cpu_enable_intr(); (*linesw[tp->t_line].l_modem)(tp, !!(rc->rc_msvr & MSVR_CD)); } if (rc->rc_flags & RC_DORXFER) { - disable_intr(); + cpu_disable_intr(); rc->rc_flags &= ~RC_DORXFER; eptr = rc->rc_iptr; if (rc->rc_bufend == &rc->rc_ibuf[2 * RC_IBUFSIZE]) @@ -631,7 +632,7 @@ repeat: } rc_scheduled_event -= icnt; } - enable_intr(); + cpu_enable_intr(); if (icnt <= 0 || !(tp->t_state & TS_ISOPEN)) goto done1; @@ -664,11 +665,11 @@ repeat: done1: ; } if (rc->rc_flags & RC_DOXXFER) { - disable_intr(); + cpu_disable_intr(); rc_scheduled_event -= LOTS_OF_EVENTS; rc->rc_flags &= ~RC_DOXXFER; rc->rc_tp->t_state &= ~TS_BUSY; - enable_intr(); + cpu_enable_intr(); (*linesw[tp->t_line].l_start)(tp); } } @@ -693,7 +694,7 @@ rc_stop(tp, rw) #endif if (rw & FWRITE) rc_discard_output(rc); - disable_intr(); + cpu_disable_intr(); if (rw & FREAD) { rc->rc_flags &= ~RC_DORXFER; eptr = rc->rc_iptr; @@ -710,14 +711,14 @@ rc_stop(tp, rw) rc->rc_flags |= RC_OSUSP; else rc->rc_flags &= ~RC_OSUSP; - enable_intr(); + cpu_enable_intr(); } static int -rcopen(dev, flag, mode, p) +rcopen(dev, flag, mode, td) dev_t dev; int flag, mode; - struct proc *p; + struct thread *td; { register struct rc_chans *rc; register struct tty *tp; @@ -808,10 +809,10 @@ out: } static int -rcclose(dev, flag, mode, p) +rcclose(dev, flag, mode, td) dev_t dev; int flag, mode; - struct proc *p; + struct thread *td; { register struct rc_chans *rc; register struct tty *tp; @@ -1062,18 +1063,18 @@ struct rc_softc *rcb; } static int -rcioctl(dev, cmd, data, flag, p) +rcioctl(dev, cmd, data, flag, td) dev_t dev; u_long cmd; int flag; caddr_t data; -struct proc *p; +struct thread *td; { register struct rc_chans *rc = &rc_chans[GET_UNIT(dev)]; register int s, error; struct tty *tp = rc->rc_tp; - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td); if (error != ENOIOCTL) return (error); error = ttioctl(tp, cmd, data, flag); @@ -1397,14 +1398,14 @@ static void rc_discard_output(rc) struct rc_chans *rc; { - disable_intr(); + cpu_disable_intr(); if (rc->rc_flags & RC_DOXXFER) { rc_scheduled_event -= LOTS_OF_EVENTS; rc->rc_flags &= ~RC_DOXXFER; } rc->rc_optr = rc->rc_obufend; rc->rc_tp->t_state &= ~TS_BUSY; - enable_intr(); + cpu_enable_intr(); ttwwakeup(rc->rc_tp); } @@ -1418,7 +1419,7 @@ rc_wakeup(chan) int s; s = splsofttty(); - rcpoll(); + rcpoll(NULL); splx(s); } } diff --git a/sys/dev/serial/rp2/rp.c b/sys/dev/serial/rp2/rp.c index 6191dc8162..93456e280f 100644 --- a/sys/dev/serial/rp2/rp.c +++ b/sys/dev/serial/rp2/rp.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/rp.c,v 1.33.2.2 2001/02/26 04:23:10 jlemon Exp $ - * $DragonFly: src/sys/dev/serial/rp2/Attic/rp.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/serial/rp2/Attic/rp.c,v 1.6 2003/07/21 07:57:44 dillon Exp $ */ /* @@ -1280,10 +1280,10 @@ struct isa_device *dev; } int -rpopen(dev, flag, mode, p) +rpopen(dev, flag, mode, td) dev_t dev; int flag, mode; - struct proc *p; + struct thread *td; { struct rp_port *rp; int unit, port, mynor, umynor, flags; /* SG */ @@ -1432,10 +1432,10 @@ out: } int -rpclose(dev, flag, mode, p) +rpclose(dev, flag, mode, td) dev_t dev; int flag, mode; - struct proc *p; + struct thread *td; { int oldspl, unit, mynor, umynor, port; /* SG */ struct rp_port *rp; @@ -1545,12 +1545,12 @@ rpdtrwakeup(void *chan) } int -rpioctl(dev, cmd, data, flag, p) +rpioctl(dev, cmd, data, flag, td) dev_t dev; u_long cmd; caddr_t data; int flag; - struct proc *p; + struct thread *td; { struct rp_port *rp; CHANNEL_t *cp; @@ -1640,7 +1640,7 @@ rpioctl(dev, cmd, data, flag, p) t = &tp->t_termios; - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td); if(error != ENOIOCTL) { return(error); } @@ -1755,7 +1755,7 @@ static struct speedtab baud_table[] = { {B38400, BRD38400}, {B7200, BRD7200}, {B14400, BRD14400}, {B57600, BRD57600}, {B76800, BRD76800}, {B115200, BRD115200}, {B230400, BRD230400}, - -1, -1 + { -1, -1 } }; static int diff --git a/sys/dev/serial/si/si.c b/sys/dev/serial/si/si.c index fb8c3d6635..28c53b8a14 100644 --- a/sys/dev/serial/si/si.c +++ b/sys/dev/serial/si/si.c @@ -31,7 +31,7 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/sys/dev/si/si.c,v 1.101.2.1 2001/02/26 04:23:06 jlemon Exp $ - * $DragonFly: src/sys/dev/serial/si/si.c,v 1.5 2003/07/21 05:50:35 dillon Exp $ + * $DragonFly: src/sys/dev/serial/si/si.c,v 1.6 2003/07/21 07:57:41 dillon Exp $ */ #ifndef lint @@ -801,7 +801,7 @@ siclose(dev_t dev, int flag, int mode, struct thread *td) tp = pp->sp_tty; DPRINT((pp, DBG_ENTRY|DBG_CLOSE, "siclose(%s,%x,%x,%x) sp_state:%x\n", - devtoname(dev), flag, mode, p, pp->sp_state)); + devtoname(dev), flag, mode, td, pp->sp_state)); /* did we sleep and loose a race? */ if (pp->sp_state & SS_CLOSING) { @@ -949,7 +949,7 @@ siioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) #endif if (IS_SI_IOCTL(cmd)) - return(si_Sioctl(dev, cmd, data, flag, p)); + return(si_Sioctl(dev, cmd, data, flag, td)); pp = MINOR2PP(mynor); tp = pp->sp_tty; @@ -1043,7 +1043,7 @@ siioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) si_write_enable(pp, 0); } - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td); if (error != ENOIOCTL) goto out; diff --git a/sys/dev/serial/stl/stallion.c b/sys/dev/serial/stl/stallion.c index 9dbb4def23..81ad3c64ca 100644 --- a/sys/dev/serial/stl/stallion.c +++ b/sys/dev/serial/stl/stallion.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/stallion.c,v 1.39.2.2 2001/08/30 12:29:57 murray Exp $ - * $DragonFly: src/sys/dev/serial/stl/stallion.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/serial/stl/stallion.c,v 1.6 2003/07/21 07:57:45 dillon Exp $ */ /*****************************************************************************/ @@ -504,7 +504,7 @@ static void stl_echmcaintr(stlbrd_t *brdp); static void stl_echpciintr(stlbrd_t *brdp); static void stl_echpci64intr(stlbrd_t *brdp); static int stl_memioctl(dev_t dev, unsigned long cmd, caddr_t data, - int flag, struct proc *p); + int flag, struct thread *td); static int stl_getbrdstats(caddr_t data); static int stl_getportstats(stlport_t *portp, caddr_t data); static int stl_clrportstats(stlport_t *portp, caddr_t data); @@ -1158,7 +1158,7 @@ void stlpciattach(pcici_t tag, int unit) /*****************************************************************************/ -STATIC int stlopen(dev_t dev, int flag, int mode, struct proc *p) +STATIC int stlopen(dev_t dev, int flag, int mode, struct thread *td) { struct tty *tp; stlport_t *portp; @@ -1276,7 +1276,7 @@ stlopen_end: /*****************************************************************************/ -STATIC int stlclose(dev_t dev, int flag, int mode, struct proc *p) +STATIC int stlclose(dev_t dev, int flag, int mode, struct thread *td) { struct tty *tp; stlport_t *portp; @@ -1336,7 +1336,7 @@ STATIC int stlstop(struct tty *tp, int rw) /*****************************************************************************/ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, - struct proc *p) + struct thread *td) { struct termios *newtios, *localtios; struct tty *tp; @@ -1349,7 +1349,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, #endif if (minor(dev) & STL_MEMDEV) - return(stl_memioctl(dev, cmd, data, flag, p)); + return(stl_memioctl(dev, cmd, data, flag, td)); portp = stl_dev2port(dev); if (portp == (stlport_t *) NULL) @@ -1439,7 +1439,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, * Call the line discipline and the common command processing to * process this command (if they can). */ - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td); if (error != ENOIOCTL) return(error); @@ -2740,7 +2740,7 @@ static int stl_clrportstats(stlport_t *portp, caddr_t data) */ static int stl_memioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, - struct proc *p) + struct thread *td) { int rc; diff --git a/sys/dev/serial/stli/istallion.c b/sys/dev/serial/stli/istallion.c index fd5ed828a1..56195360f1 100644 --- a/sys/dev/serial/stli/istallion.c +++ b/sys/dev/serial/stli/istallion.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/istallion.c,v 1.36.2.2 2001/08/30 12:29:57 murray Exp $ - * $DragonFly: src/sys/dev/serial/stli/istallion.c,v 1.5 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/serial/stli/istallion.c,v 1.6 2003/07/21 07:57:44 dillon Exp $ */ /*****************************************************************************/ @@ -576,7 +576,7 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp); static int stli_memrw(dev_t dev, struct uio *uiop, int flag); static int stli_memioctl(dev_t dev, unsigned long cmd, caddr_t data, - int flag, struct proc *p); + int flag, struct thread *td); static int stli_getbrdstats(caddr_t data); static int stli_getportstats(stliport_t *portp, caddr_t data); static int stli_clrportstats(stliport_t *portp, caddr_t data); @@ -928,7 +928,7 @@ static int stliattach(struct isa_device *idp) /*****************************************************************************/ -STATIC int stliopen(dev_t dev, int flag, int mode, struct proc *p) +STATIC int stliopen(dev_t dev, int flag, int mode, struct thread *td) { struct tty *tp; stliport_t *portp; @@ -1058,7 +1058,7 @@ stliopen_end: /*****************************************************************************/ -STATIC int stliclose(dev_t dev, int flag, int mode, struct proc *p) +STATIC int stliclose(dev_t dev, int flag, int mode, struct thread *td) { struct tty *tp; stliport_t *portp; @@ -1160,7 +1160,7 @@ STATIC int stliwrite(dev_t dev, struct uio *uiop, int flag) /*****************************************************************************/ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, - struct proc *p) + struct thread *td) { struct termios *newtios, *localtios; struct tty *tp; @@ -1175,7 +1175,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, #endif if (minor(dev) & STL_MEMDEV) - return(stli_memioctl(dev, cmd, data, flag, p)); + return(stli_memioctl(dev, cmd, data, flag, td)); portp = stli_dev2port(dev); if (portp == (stliport_t *) NULL) @@ -1267,7 +1267,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, * Call the line discipline and the common command processing to * process this command (if they can). */ - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td); if (error != ENOIOCTL) return(error); @@ -3776,7 +3776,7 @@ STATIC int stli_memrw(dev_t dev, struct uio *uiop, int flag) */ static int stli_memioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, - struct proc *p) + struct thread *td) { stlibrd_t *brdp; int brdnr, rc; diff --git a/sys/dev/sound/isa/i386/pca/pcaudio.c b/sys/dev/sound/isa/i386/pca/pcaudio.c index 89ee10e5e9..6ca8c3da2a 100644 --- a/sys/dev/sound/isa/i386/pca/pcaudio.c +++ b/sys/dev/sound/isa/i386/pca/pcaudio.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/pcaudio.c,v 1.58 2000/01/25 21:58:43 dfr Exp $ - * $DragonFly: src/sys/dev/sound/isa/i386/pca/Attic/pcaudio.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/i386/pca/Attic/pcaudio.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ #include @@ -368,7 +368,7 @@ DRIVER_MODULE(pca, isa, pca_driver, pca_devclass, 0, 0); static int -pcaopen(dev_t dev, int flags, int fmt, struct proc *p) +pcaopen(dev_t dev, int flags, int fmt, struct thread *td) { /* audioctl device can always be opened */ if (minor(dev) == 128) @@ -396,7 +396,7 @@ pcaopen(dev_t dev, int flags, int fmt, struct proc *p) static int -pcaclose(dev_t dev, int flags, int fmt, struct proc *p) +pcaclose(dev_t dev, int flags, int fmt, struct thread *td) { /* audioctl device can always be closed */ if (minor(dev) == 128) @@ -467,7 +467,7 @@ pcawrite(dev_t dev, struct uio *uio, int flag) static int -pcaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +pcaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) { audio_info_t *auptr; @@ -535,7 +535,7 @@ static void pcaintr(struct clockframe *frame) { if (pca_status.index < pca_status.in_use[pca_status.current]) { - disable_intr(); + cpu_disable_intr(); __asm__("outb %0,$0x61\n" "andb $0xFE,%0\n" "outb %0,$0x61" @@ -544,7 +544,7 @@ pcaintr(struct clockframe *frame) "outb %0,$0x42" : : "a" ((char)pca_status.buffer[pca_status.index]), "b" (volume_table) ); - enable_intr(); + cpu_enable_intr(); pca_status.counter += pca_status.scale; pca_status.index = (pca_status.counter >> 8); } @@ -567,12 +567,16 @@ pcaintr(struct clockframe *frame) static int -pcapoll(dev_t dev, int events, struct proc *p) +pcapoll(dev_t dev, int events, struct thread *td) { int s; + struct proc *p; struct proc *p1; int revents = 0; + p = td->td_proc; + KKASSERT(p); + s = spltty(); if (events & (POLLOUT | POLLWRNORM)) { diff --git a/sys/dev/usbmisc/ucom/ucom.c b/sys/dev/usbmisc/ucom/ucom.c index ae83b7afad..1b8576663a 100644 --- a/sys/dev/usbmisc/ucom/ucom.c +++ b/sys/dev/usbmisc/ucom/ucom.c @@ -1,6 +1,6 @@ /* $NetBSD: ucom.c,v 1.39 2001/08/16 22:31:24 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ucom.c,v 1.24.2.2 2003/01/17 17:32:10 joe Exp $ */ -/* $DragonFly: src/sys/dev/usbmisc/ucom/ucom.c,v 1.6 2003/07/21 05:50:37 dillon Exp $ */ +/* $DragonFly: src/sys/dev/usbmisc/ucom/ucom.c,v 1.7 2003/07/21 07:57:42 dillon Exp $ */ /*- * Copyright (c) 2001-2002, Shunsuke Akiyama . @@ -268,7 +268,7 @@ ucomopen(dev_t dev, int flag, int mode, usb_proc_ptr td) int s; int error; - KKASSERT(p != NULL); + KKASSERT(td != NULL); USB_GET_SC_OPEN(ucom, unit, sc); diff --git a/sys/dev/video/ctx/ctx.c b/sys/dev/video/ctx/ctx.c index 04d6325661..b13fcf3e5a 100644 --- a/sys/dev/video/ctx/ctx.c +++ b/sys/dev/video/ctx/ctx.c @@ -9,7 +9,7 @@ * for damages incurred with its use. * * $FreeBSD: src/sys/i386/isa/ctx.c,v 1.36 2000/01/29 16:17:31 peter Exp $ - * $DragonFly: src/sys/dev/video/ctx/ctx.c,v 1.3 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/video/ctx/ctx.c,v 1.4 2003/07/21 07:57:44 dillon Exp $ */ /* @@ -211,7 +211,7 @@ ctxattach(struct isa_device * devp) } static int -ctxopen(dev_t dev, int flags, int fmt, struct proc *p) +ctxopen(dev_t dev, int flags, int fmt, struct thread *td) { struct ctx_soft_registers *sr; u_char unit; @@ -266,7 +266,7 @@ ctxopen(dev_t dev, int flags, int fmt, struct proc *p) } static int -ctxclose(dev_t dev, int flags, int fmt, struct proc *p) +ctxclose(dev_t dev, int flags, int fmt, struct thread *td) { int unit; @@ -283,6 +283,7 @@ ctxwrite(dev_t dev, struct uio * uio, int ioflag) int unit, status = 0; int page, count, offset; struct ctx_soft_registers *sr; + u_long ef; unit = UNIT(minor(dev)); sr = &(ctx_sr[unit]); @@ -309,13 +310,14 @@ ctxwrite(dev_t dev, struct uio * uio, int ioflag) I should disable interrupts here, so I have done so. */ - disable_intr(); + ef = read_eflags(); + cpu_disable_intr(); sr->cp1 |= RAM_ENABLE; outb(sr->iobase + ctx_cp1, sr->cp1); status = uiomove(sr->maddr + offset, count, uio); sr->cp1 &= ~RAM_ENABLE; outb(sr->iobase + ctx_cp1, sr->cp1); - enable_intr(); + write_eflags(ef); page = (u_int)uio->uio_offset / PAGESIZE; offset = (u_int)uio->uio_offset % PAGESIZE; @@ -333,6 +335,7 @@ ctxread(dev_t dev, struct uio * uio, int ioflag) int unit, status = 0; int page, count, offset; struct ctx_soft_registers *sr; + u_long ef; unit = UNIT(minor(dev)); sr = &(ctx_sr[unit]); @@ -357,13 +360,14 @@ ctxread(dev_t dev, struct uio * uio, int ioflag) is actually being read or written. All my instincts tell me that I should disable interrupts here, so I have done so. */ - disable_intr(); + ef = read_eflags(); + cpu_disable_intr(); sr->cp1 |= RAM_ENABLE; outb(sr->iobase + ctx_cp1, sr->cp1); status = uiomove(sr->maddr + offset, count, uio); sr->cp1 &= ~RAM_ENABLE; outb(sr->iobase + ctx_cp1, sr->cp1); - enable_intr(); + write_eflags(ef); page = (u_int)uio->uio_offset / PAGESIZE; offset = (u_int)uio->uio_offset % PAGESIZE; @@ -376,7 +380,7 @@ ctxread(dev_t dev, struct uio * uio, int ioflag) } static int -ctxioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +ctxioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { int error; int unit, i; diff --git a/sys/dev/video/fb/fb.c b/sys/dev/video/fb/fb.c index 7735a3afbf..bb50038269 100644 --- a/sys/dev/video/fb/fb.c +++ b/sys/dev/video/fb/fb.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/fb.c,v 1.11.2.2 2000/08/02 22:35:22 peter Exp $ - * $DragonFly: src/sys/dev/video/fb/fb.c,v 1.3 2003/07/21 05:50:30 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/fb.c,v 1.4 2003/07/21 07:57:40 dillon Exp $ */ #include "opt_fb.h" @@ -429,7 +429,7 @@ fb_detach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) } static int -fbopen(dev_t dev, int flag, int mode, struct proc *p) +fbopen(dev_t dev, int flag, int mode, struct thread *td) { int unit; @@ -439,11 +439,11 @@ fbopen(dev_t dev, int flag, int mode, struct proc *p) if (vidcdevsw[unit] == NULL) return ENXIO; return (*vidcdevsw[unit]->d_open)(makedev(0, adapter[unit]->va_minor), - flag, mode, p); + flag, mode, td); } static int -fbclose(dev_t dev, int flag, int mode, struct proc *p) +fbclose(dev_t dev, int flag, int mode, struct thread *td) { int unit; @@ -451,7 +451,7 @@ fbclose(dev_t dev, int flag, int mode, struct proc *p) if (vidcdevsw[unit] == NULL) return ENXIO; return (*vidcdevsw[unit]->d_close)(makedev(0, adapter[unit]->va_minor), - flag, mode, p); + flag, mode, td); } static int @@ -479,7 +479,7 @@ fbwrite(dev_t dev, struct uio *uio, int flag) } static int -fbioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p) +fbioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) { int unit; @@ -487,7 +487,7 @@ fbioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p) if (vidcdevsw[unit] == NULL) return ENXIO; return (*vidcdevsw[unit]->d_ioctl)(makedev(0, adapter[unit]->va_minor), - cmd, arg, flag, p); + cmd, arg, flag, td); } static int @@ -513,7 +513,7 @@ DEV_DRIVER_MODULE(fb, ???, fb_driver, fb_devclass, fb_cdevsw, 0, 0); */ int genfbopen(genfb_softc_t *sc, video_adapter_t *adp, int flag, int mode, - struct proc *p) + struct thread *td) { int s; @@ -525,7 +525,7 @@ int genfbopen(genfb_softc_t *sc, video_adapter_t *adp, int flag, int mode, } int genfbclose(genfb_softc_t *sc, video_adapter_t *adp, int flag, int mode, - struct proc *p) + struct thread *td) { int s; @@ -568,7 +568,7 @@ int genfbwrite(genfb_softc_t *sc, video_adapter_t *adp, struct uio *uio, } int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp, u_long cmd, - caddr_t arg, int flag, struct proc *p) + caddr_t arg, int flag, struct thread *td) { int error; diff --git a/sys/dev/video/fb/fbreg.h b/sys/dev/video/fb/fbreg.h index 58114df188..160dfb8941 100644 --- a/sys/dev/video/fb/fbreg.h +++ b/sys/dev/video/fb/fbreg.h @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/fbreg.h,v 1.6 1999/12/29 04:35:36 peter Exp $ - * $DragonFly: src/sys/dev/video/fb/fbreg.h,v 1.2 2003/06/17 04:28:25 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/fbreg.h,v 1.3 2003/07/21 07:57:40 dillon Exp $ */ #ifndef _DEV_FB_FBREG_H_ @@ -184,15 +184,15 @@ typedef struct genfb_softc { } genfb_softc_t; int genfbopen(genfb_softc_t *sc, video_adapter_t *adp, - int flag, int mode, struct proc *p); + int flag, int mode, struct thread *td); int genfbclose(genfb_softc_t *sc, video_adapter_t *adp, - int flag, int mode, struct proc *p); + int flag, int mode, struct thread *td); int genfbread(genfb_softc_t *sc, video_adapter_t *adp, struct uio *uio, int flag); int genfbwrite(genfb_softc_t *sc, video_adapter_t *adp, struct uio *uio, int flag); int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp, - u_long cmd, caddr_t arg, int flag, struct proc *p); + u_long cmd, caddr_t arg, int flag, struct thread *td); int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_offset_t offset, int prot); diff --git a/sys/dev/video/fb/vga.c b/sys/dev/video/fb/vga.c index f6ad8702b9..cb70c9fbad 100644 --- a/sys/dev/video/fb/vga.c +++ b/sys/dev/video/fb/vga.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/vga.c,v 1.9.2.1 2001/08/11 02:58:44 yokota Exp $ - * $DragonFly: src/sys/dev/video/fb/vga.c,v 1.2 2003/06/17 04:28:25 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/vga.c,v 1.3 2003/07/21 07:57:40 dillon Exp $ */ #include "opt_vga.h" @@ -97,20 +97,20 @@ vga_attach_unit(int unit, vga_softc_t *sc, int flags) #ifdef FB_INSTALL_CDEV int -vga_open(dev_t dev, vga_softc_t *sc, int flag, int mode, struct proc *p) +vga_open(dev_t dev, vga_softc_t *sc, int flag, int mode, struct thread *td) { if (sc == NULL) return ENXIO; if (mode & (O_CREAT | O_APPEND | O_TRUNC)) return ENODEV; - return genfbopen(&sc->gensc, sc->adp, flag, mode, p); + return genfbopen(&sc->gensc, sc->adp, flag, mode, td); } int -vga_close(dev_t dev, vga_softc_t *sc, int flag, int mode, struct proc *p) +vga_close(dev_t dev, vga_softc_t *sc, int flag, int mode, struct thread *td) { - return genfbclose(&sc->gensc, sc->adp, flag, mode, p); + return genfbclose(&sc->gensc, sc->adp, flag, mode, td); } int @@ -127,9 +127,9 @@ vga_write(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag) int vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg, int flag, - struct proc *p) + struct thread *td) { - return genfbioctl(&sc->gensc, sc->adp, cmd, arg, flag, p); + return genfbioctl(&sc->gensc, sc->adp, cmd, arg, flag, td); } int diff --git a/sys/dev/video/fb/vgareg.h b/sys/dev/video/fb/vgareg.h index 22a3d0bfd4..9c26df889e 100644 --- a/sys/dev/video/fb/vgareg.h +++ b/sys/dev/video/fb/vgareg.h @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/vgareg.h,v 1.4 1999/12/29 04:35:37 peter Exp $ - * $DragonFly: src/sys/dev/video/fb/vgareg.h,v 1.2 2003/06/17 04:28:25 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/vgareg.h,v 1.3 2003/07/21 07:57:40 dillon Exp $ */ #ifndef _DEV_FB_VGAREG_H_ @@ -80,13 +80,13 @@ int vga_attach_unit(int unit, vga_softc_t *sc, int flags); #ifdef FB_INSTALL_CDEV int vga_open(dev_t dev, vga_softc_t *sc, int flag, int mode, - struct proc *p); + struct thread *td); int vga_close(dev_t dev, vga_softc_t *sc, int flag, int mode, - struct proc *p); + struct thread *td); int vga_read(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag); int vga_write(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag); int vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg, - int flag, struct proc *p); + int flag, struct thread *td); int vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, int prot); #endif diff --git a/sys/dev/video/gsc/gsc.c b/sys/dev/video/gsc/gsc.c index 56eb5e8e33..758833af60 100644 --- a/sys/dev/video/gsc/gsc.c +++ b/sys/dev/video/gsc/gsc.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/gsc.c,v 1.35.2.1 2000/08/08 19:49:53 peter Exp $ - * $DragonFly: src/sys/dev/video/gsc/gsc.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/dev/video/gsc/gsc.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ * */ @@ -556,7 +556,7 @@ gscattach(struct isa_device *isdp) */ static int -gscopen (dev_t dev, int flags, int fmt, struct proc *p) +gscopen (dev_t dev, int flags, int fmt, struct thread *td) { struct gsc_unit *scu; int unit; @@ -623,7 +623,7 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p) */ static int -gscclose (dev_t dev, int flags, int fmt, struct proc *p) +gscclose (dev_t dev, int flags, int fmt, struct thread *td) { int unit = UNIT(minor(dev)); struct gsc_unit *scu = unittab + unit; @@ -746,7 +746,7 @@ gscread (dev_t dev, struct uio *uio, int ioflag) */ static int -gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) { int unit = UNIT(minor(dev)); struct gsc_unit *scu = unittab + unit; diff --git a/sys/dev/video/meteor/meteor.c b/sys/dev/video/meteor/meteor.c index c80bb7c03f..c2e781d0c3 100644 --- a/sys/dev/video/meteor/meteor.c +++ b/sys/dev/video/meteor/meteor.c @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/meteor.c,v 1.49 1999/09/25 18:24:41 phk Exp $ - * $DragonFly: src/sys/dev/video/meteor/meteor.c,v 1.4 2003/07/21 05:50:46 dillon Exp $ + * $DragonFly: src/sys/dev/video/meteor/meteor.c,v 1.5 2003/07/21 07:57:52 dillon Exp $ */ /* Change History: @@ -1159,7 +1159,7 @@ struct saa7116_regs *m; int -meteor_open(dev_t dev, int flags, int fmt, struct proc *p) +meteor_open(dev_t dev, int flags, int fmt, struct thread *td) { meteor_reg_t *mtr; int unit; @@ -1203,7 +1203,7 @@ meteor_open(dev_t dev, int flags, int fmt, struct proc *p) } int -meteor_close(dev_t dev, int flags, int fmt, struct proc *p) +meteor_close(dev_t dev, int flags, int fmt, struct thread *td) { meteor_reg_t *mtr; int unit; @@ -1326,7 +1326,7 @@ meteor_write(dev_t dev, struct uio *uio, int ioflag) } int -meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr) +meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) { int error; int unit; @@ -1390,7 +1390,7 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr) case METEORSSIGNAL: mtr->signal = *(int *) arg; if (mtr->signal) { - mtr->proc = pr; + mtr->proc = td->td_proc; /* might be NULL */ } else { mtr->proc = (struct proc *)0; } diff --git a/sys/dev/video/pcvt/i386/pcvt_drv.c b/sys/dev/video/pcvt/i386/pcvt_drv.c index f78c1bf81a..4e3e1c5b01 100644 --- a/sys/dev/video/pcvt/i386/pcvt_drv.c +++ b/sys/dev/video/pcvt/i386/pcvt_drv.c @@ -51,7 +51,7 @@ * Last Edit-Date: [Mon Dec 27 14:03:36 1999] * * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_drv.c,v 1.63.2.1 2001/02/26 04:23:13 jlemon Exp $ - * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_drv.c,v 1.4 2003/07/21 05:50:41 dillon Exp $ + * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_drv.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ * *---------------------------------------------------------------------------*/ @@ -78,7 +78,7 @@ extern int getchar __P((void)); static void vgapelinit(void); /* read initial VGA DAC palette */ #if defined XSERVER && !PCVT_USL_VT_COMPAT -static int pcvt_xmode_set(int on, struct proc *p); /* initialize for X mode */ +static int pcvt_xmode_set(int on, struct thread *td); /* initialize for X mode */ #endif /* XSERVER && !PCVT_USL_VT_COMPAT */ #ifdef _DEV_KBD_KBDREG_H_ @@ -417,7 +417,7 @@ get_pccons(Dev_t dev) * /dev/ttyc0, /dev/ttyc1, etc. *---------------------------------------------------------------------------*/ int -pcopen(Dev_t dev, int flag, int mode, struct proc *p) +pcopen(Dev_t dev, int flag, int mode, struct thread *td) { register struct tty *tp; register struct video_state *vsx; @@ -507,7 +507,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) } int -pcclose(Dev_t dev, int flag, int mode, struct proc *p) +pcclose(Dev_t dev, int flag, int mode, struct thread *td) { register struct tty *tp; register struct video_state *vsx; @@ -551,7 +551,7 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p) } int -pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) { register int error; register struct tty *tp; @@ -577,7 +577,7 @@ pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) #ifdef XSERVER #if PCVT_USL_VT_COMPAT - if((error = usl_vt_ioctl(dev, cmd, data, flag, p)) >= 0) + if((error = usl_vt_ioctl(dev, cmd, data, flag, td->td_proc)) >= 0) return error; /* @@ -596,16 +596,16 @@ pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) { int i; - if((error = usl_vt_ioctl(dev, KDENABIO, 0, flag, p)) > 0) + if((error = usl_vt_ioctl(dev, KDENABIO, 0, flag, td->td_proc)) > 0) return error; i = KD_GRAPHICS; - if((error = usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, p)) + if((error = usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, td->td_proc)) > 0) return error; i = K_RAW; - error = usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, p); + error = usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, td->td_proc); return error; } @@ -613,13 +613,13 @@ pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) { int i; - (void)usl_vt_ioctl(dev, KDDISABIO, 0, flag, p); + (void)usl_vt_ioctl(dev, KDDISABIO, 0, flag, td->td_proc); i = KD_TEXT; - (void)usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, p); + (void)usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, td->td_proc); i = K_XLATE; - (void)usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, p); + (void)usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, td->td_proc); return 0; } @@ -658,10 +658,10 @@ pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) switch(cmd) { case CONSOLE_X_MODE_ON: - return pcvt_xmode_set(1, p); + return pcvt_xmode_set(1, td->td_proc); case CONSOLE_X_MODE_OFF: - return pcvt_xmode_set(0, p); + return pcvt_xmode_set(0, td->td_proc); case CONSOLE_X_BELL: @@ -706,7 +706,7 @@ do_standard: #endif #if PCVT_NETBSD > 9 || PCVT_FREEBSD >= 200 - if((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p)) + if((error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td)) != ENOIOCTL) return (error); #else @@ -715,7 +715,7 @@ do_standard: #endif /* PCVT_NETBSD > 9 || PCVT_FREEBSD >= 200 */ #if PCVT_NETBSD > 9 - if((error = ttioctl(tp, cmd, data, flag, p)) >= 0) + if((error = ttioctl(tp, cmd, data, flag, td)) >= 0) return (error); #else if((error = ttioctl(tp, cmd, data, flag)) != ENOIOCTL) @@ -1392,7 +1392,7 @@ vgapelinit(void) * if parameter `on' is false, the same procedure is done reverse. *----------------------------------------------------------------------*/ static int -pcvt_xmode_set(int on, struct proc *p) +pcvt_xmode_set(int on, struct thread *td) { static unsigned char *saved_fonts[NVGAFONTS]; diff --git a/sys/dev/video/pcvt/i386/pcvt_ext.c b/sys/dev/video/pcvt/i386/pcvt_ext.c index 91aa5fd127..44e1bdb5dd 100644 --- a/sys/dev/video/pcvt/i386/pcvt_ext.c +++ b/sys/dev/video/pcvt/i386/pcvt_ext.c @@ -45,7 +45,7 @@ * Last Edit-Date: [Mon Dec 27 14:05:16 1999] * * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_ext.c,v 1.17 1999/12/30 16:17:09 hm Exp $ - * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_ext.c,v 1.4 2003/07/19 21:14:35 dillon Exp $ + * $DragonFly: src/sys/dev/video/pcvt/i386/Attic/pcvt_ext.c,v 1.5 2003/07/21 07:57:45 dillon Exp $ * *---------------------------------------------------------------------------*/ @@ -2667,7 +2667,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) struct syscframe *fp = (struct syscframe *)p->p_regs; #endif - error = suser(td); + error = suser(p->p_thread); if (error != 0) return (error); if (securelevel > 0) diff --git a/sys/emulation/ibcs2/i386/ibcs2_fcntl.c b/sys/emulation/ibcs2/i386/ibcs2_fcntl.c index 111e0c9129..6a35e0447d 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_fcntl.c +++ b/sys/emulation/ibcs2/i386/ibcs2_fcntl.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/ibcs2_fcntl.c,v 1.14 1999/09/19 17:00:14 green Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_fcntl.c,v 1.4 2003/06/25 03:55:53 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_fcntl.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ #include "opt_spx_hack.h" @@ -185,13 +185,13 @@ ibcs2_open(struct ibcs2_open_args *uap) CHECKALTEXIST(&sg, SCARG(uap, path)); ret = open((struct open_args *)uap); + p = td->td_proc; #ifdef SPX_HACK if (ret == ENXIO) { if (!strcmp(SCARG(uap, path), "/compat/ibcs2/dev/spx")) ret = spx_open(uap); } else #endif /* SPX_HACK */ - p = td->td_proc; if (!ret && !noctty && p && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp = fdp->fd_ofiles[p->p_retval[0]]; diff --git a/sys/emulation/ibcs2/i386/ibcs2_other.c b/sys/emulation/ibcs2/i386/ibcs2_other.c index 9678c4c398..9012448a2b 100644 --- a/sys/emulation/ibcs2/i386/ibcs2_other.c +++ b/sys/emulation/ibcs2/i386/ibcs2_other.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/ibcs2/ibcs2_other.c,v 1.10 1999/08/28 00:43:59 peter Exp $ - * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_other.c,v 1.3 2003/06/23 17:55:38 dillon Exp $ + * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_other.c,v 1.4 2003/07/21 07:57:44 dillon Exp $ */ /* @@ -86,6 +86,7 @@ spx_open(void *uap) struct sockaddr_un *Xaddr; int fd, error; caddr_t sg = stackgap_init(); + struct proc *p = curproc; /* obtain a socket. */ DPRINTF(("SPX: open socket\n")); diff --git a/sys/emulation/linux/i386/linux.h b/sys/emulation/linux/i386/linux.h index c584c567e6..48dfc7774a 100644 --- a/sys/emulation/linux/i386/linux.h +++ b/sys/emulation/linux/i386/linux.h @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/linux.h,v 1.41.2.4 2003/01/06 09:19:43 fjoe Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linux.h,v 1.3 2003/06/25 03:55:55 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linux.h,v 1.4 2003/07/21 07:57:46 dillon Exp $ */ #ifndef _I386_LINUX_LINUX_H_ @@ -41,8 +41,8 @@ */ extern u_char linux_debug_map[]; #define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) -#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)p->p_pid -#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)p->p_pid +#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)(curthread->td_proc ? curthread->td_proc->p_pid : -1) +#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)(curthread->td_proc ? curthread->td_proc->p_pid : -1) #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_LINUX); diff --git a/sys/emulation/linux/linux_getcwd.c b/sys/emulation/linux/linux_getcwd.c index 74b160d8f6..9c8a6bd8ba 100644 --- a/sys/emulation/linux/linux_getcwd.c +++ b/sys/emulation/linux/linux_getcwd.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/compat/linux/linux_getcwd.c,v 1.2.2.3 2001/11/05 19:08:22 marcel Exp $ */ -/* $DragonFly: src/sys/emulation/linux/linux_getcwd.c,v 1.5 2003/06/26 05:55:10 dillon Exp $ */ +/* $DragonFly: src/sys/emulation/linux/linux_getcwd.c,v 1.6 2003/07/21 07:57:39 dillon Exp $ */ /* $OpenBSD: linux_getcwd.c,v 1.2 2001/05/16 12:50:21 ho Exp $ */ /* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ @@ -424,7 +424,7 @@ linux_getcwd(struct linux_getcwd_args *args) KKASSERT(p); #ifdef DEBUG - printf("Linux-emul(%ld): getcwd(%p, %ld)\n", (long)p->p_pid, + printf("Linux-emul(%ld): getcwd(%p, %d)\n", (long)p->p_pid, args->buf, args->bufsize); #endif diff --git a/sys/emulation/linux/linux_ioctl.c b/sys/emulation/linux/linux_ioctl.c index 3daea27c5c..065c5ebfb0 100644 --- a/sys/emulation/linux/linux_ioctl.c +++ b/sys/emulation/linux/linux_ioctl.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.55.2.11 2003/05/01 20:16:09 anholt Exp $ - * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.4 2003/06/25 03:55:44 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.5 2003/07/21 07:57:39 dillon Exp $ */ #include @@ -1866,7 +1866,7 @@ linux_ioctl(struct linux_ioctl_args *args) #ifdef DEBUG if (ldebug(ioctl)) - printf(ARGS(ioctl, "%d, %04lx, *"), args->fd, args->cmd); + printf(ARGS(ioctl, "%d, %04x, *"), args->fd, args->cmd); #endif fdp = p->p_fd; diff --git a/sys/i386/gnu/isa/dgb.c b/sys/i386/gnu/isa/dgb.c index 2168bbd9d1..6a9500fea3 100644 --- a/sys/i386/gnu/isa/dgb.c +++ b/sys/i386/gnu/isa/dgb.c @@ -1,6 +1,6 @@ /*- * dgb.c $FreeBSD: src/sys/gnu/i386/isa/dgb.c,v 1.56.2.1 2001/02/26 04:23:09 jlemon Exp $ - * dgb.c $DragonFly: src/sys/i386/gnu/isa/Attic/dgb.c,v 1.5 2003/07/21 05:50:39 dillon Exp $ + * dgb.c $DragonFly: src/sys/i386/gnu/isa/Attic/dgb.c,v 1.6 2003/07/21 07:57:43 dillon Exp $ * * Digiboard driver. * @@ -229,25 +229,25 @@ static struct cdevsw dgb_cdevsw = { static speed_t dgbdefaultrate = TTYDEF_SPEED; static struct speedtab dgbspeedtab[] = { - 0, FEP_B0, /* old (sysV-like) Bx codes */ - 50, FEP_B50, - 75, FEP_B75, - 110, FEP_B110, - 134, FEP_B134, - 150, FEP_B150, - 200, FEP_B200, - 300, FEP_B300, - 600, FEP_B600, - 1200, FEP_B1200, - 1800, FEP_B1800, - 2400, FEP_B2400, - 4800, FEP_B4800, - 9600, FEP_B9600, - 19200, FEP_B19200, - 38400, FEP_B38400, - 57600, (FEP_FASTBAUD|FEP_B50), /* B50 & fast baud table */ - 115200, (FEP_FASTBAUD|FEP_B110), /* B100 & fast baud table */ - -1, -1 + { 0, FEP_B0 }, /* old (sysV-like) Bx codes */ + { 50, FEP_B50 }, + { 75, FEP_B75 }, + { 110, FEP_B110 }, + { 134, FEP_B134 }, + { 150, FEP_B150 }, + { 200, FEP_B200 }, + { 300, FEP_B300 }, + { 600, FEP_B600 }, + { 1200, FEP_B1200 }, + { 1800, FEP_B1800 }, + { 2400, FEP_B2400 }, + { 4800, FEP_B4800 }, + { 9600, FEP_B9600 }, + { 19200, FEP_B19200 }, + { 38400, FEP_B38400 }, + { 57600, (FEP_FASTBAUD|FEP_B50) }, /* B50 & fast baud table */ + { 115200, (FEP_FASTBAUD|FEP_B110) }, /* B100 & fast baud table */ + { -1, -1 } }; static struct dbgflagtbl @@ -1575,7 +1575,7 @@ dgbioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) if(cmd==TIOCSETAW || cmd==TIOCSETAF) port->mustdrain=1; - error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, p); + error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, td); if (error != ENOIOCTL) return error; s = spltty(); diff --git a/sys/i386/i386/elan-mmcr.c b/sys/i386/i386/elan-mmcr.c index bb09b44e0c..a9dc5d169e 100644 --- a/sys/i386/i386/elan-mmcr.c +++ b/sys/i386/i386/elan-mmcr.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/i386/i386/elan-mmcr.c,v 1.6.2.1 2002/09/17 22:39:53 sam Exp $ - * $DragonFly: src/sys/i386/i386/Attic/elan-mmcr.c,v 1.3 2003/07/21 05:50:39 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/elan-mmcr.c,v 1.4 2003/07/21 07:57:43 dillon Exp $ * The AMD Elan sc520 is a system-on-chip gadget which is used in embedded * kind of things, see www.soekris.com for instance, and it has a few quirks * we need to deal with. @@ -67,7 +67,7 @@ init_AMD_Elan_sc520(void) */ new = 1189161; - i = kernel_sysctlbyname(curproc, "machdep.i8254_freq", + i = kernel_sysctlbyname("machdep.i8254_freq", NULL, 0, &new, sizeof new, NULL); @@ -110,13 +110,13 @@ static struct cdevsw elan_cdevsw = { }; static int -elan_open(dev_t dev, int flag, int mode, struct proc *p) +elan_open(dev_t dev, int flag, int mode, struct thread *td) { return (0); } static int -elan_close(dev_t dev, int flag, int mode, struct proc *p) +elan_close(dev_t dev, int flag, int mode, struct thread *td) { return (0); } @@ -130,7 +130,7 @@ elan_mmap(dev_t dev, vm_offset_t offset, int nprot) } static int -elan_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p) +elan_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) { return(ENOENT); } diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c index dddbd08c43..1d03e7929c 100644 --- a/sys/i386/i386/initcpu.c +++ b/sys/i386/i386/initcpu.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/initcpu.c,v 1.19.2.9 2003/04/05 13:47:19 dwmalone Exp $ - * $DragonFly: src/sys/i386/i386/Attic/initcpu.c,v 1.3 2003/07/06 21:23:48 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/initcpu.c,v 1.4 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_cpu.h" @@ -689,7 +689,7 @@ enable_K5_wt_alloc(void) msr=rdmsr(0x83); wrmsr(0x83, msr|0x10); /* enable write allocate */ - enable_intr(); + cpu_enable_intr(); } } @@ -752,7 +752,6 @@ enable_K6_wt_alloc(void) wrmsr(0x0c0000082, whcr); write_eflags(eflags); - enable_intr(); } void @@ -814,7 +813,6 @@ enable_K6_2_wt_alloc(void) wrmsr(0x0c0000082, whcr); write_eflags(eflags); - enable_intr(); } #endif /* I585_CPU && CPU_WT_ALLOC */ diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 419a8fc5e5..44d020e2ce 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.115.2.15 2003/03/14 21:22:35 jhb Exp $ - * $DragonFly: src/sys/i386/i386/Attic/mp_machdep.c,v 1.12 2003/07/11 01:23:21 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/mp_machdep.c,v 1.13 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_cpu.h" @@ -458,7 +458,7 @@ init_secondary(void) lldt(_default_ldt); #ifdef USER_LDT - currentldt = _default_ldt; + mdcpu->gd_currentldt = _default_ldt; #endif gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 0ee62ea128..c7b4f0d9e0 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -32,7 +32,7 @@ * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 * $FreeBSD: src/sys/i386/i386/sys_machdep.c,v 1.47.2.3 2002/10/07 17:20:00 jhb Exp $ - * $DragonFly: src/sys/i386/i386/Attic/sys_machdep.c,v 1.7 2003/06/28 04:16:02 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/sys_machdep.c,v 1.8 2003/07/21 07:57:43 dillon Exp $ * */ @@ -252,7 +252,7 @@ set_user_ldt(struct pcb *pcb) pcb_ldt = pcb->pcb_ldt; #ifdef SMP - gdt[cpuid * NGDT + GUSERLDT_SEL].sd = pcb_ldt->ldt_sd; + gdt[mycpu->gd_cpuid * NGDT + GUSERLDT_SEL].sd = pcb_ldt->ldt_sd; #else gdt[GUSERLDT_SEL].sd = pcb_ldt->ldt_sd; #endif diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c index 82b9d27bd6..6650f232cf 100644 --- a/sys/i386/isa/asc.c +++ b/sys/i386/isa/asc.c @@ -35,7 +35,7 @@ */ /* * $FreeBSD: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - * $DragonFly: src/sys/i386/isa/Attic/asc.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/i386/isa/Attic/asc.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ #include "asc.h" @@ -544,7 +544,7 @@ ascintr(int unit) ***/ STATIC int -ascopen(dev_t dev, int flags, int fmt, struct proc *p) +ascopen(dev_t dev, int flags, int fmt, struct thread *td) { struct asc_unit *scu; int unit; @@ -639,7 +639,7 @@ asc_startread(struct asc_unit *scu) ***/ STATIC int -ascclose(dev_t dev, int flags, int fmt, struct proc *p) +ascclose(dev_t dev, int flags, int fmt, struct thread *td) { int unit = UNIT(minor(dev)); struct asc_unit *scu = unittab + unit; @@ -786,7 +786,7 @@ ascread(dev_t dev, struct uio *uio, int ioflag) ***/ STATIC int -ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { int unit = UNIT(minor(dev)); struct asc_unit *scu = unittab + unit; @@ -851,14 +851,18 @@ ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) } STATIC int -ascpoll(dev_t dev, int events, struct proc *p) +ascpoll(dev_t dev, int events, struct thread *td) { int unit = UNIT(minor(dev)); struct asc_unit *scu = unittab + unit; int sps; + struct proc *p; struct proc *p1; int revents = 0; + p = td->td_proc; + KKASSERT(p); + sps=spltty(); if (events & (POLLIN | POLLRDNORM)) { diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index cad6b789ad..7682a95385 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -39,7 +39,7 @@ * * @(#)kern_lock.c 8.18 (Berkeley) 5/21/95 * $FreeBSD: src/sys/kern/kern_lock.c,v 1.31.2.3 2001/12/25 01:44:44 dillon Exp $ - * $DragonFly: src/sys/kern/kern_lock.c,v 1.4 2003/07/06 21:23:51 dillon Exp $ + * $DragonFly: src/sys/kern/kern_lock.c,v 1.5 2003/07/21 07:57:47 dillon Exp $ */ #include "opt_lint.h" @@ -195,7 +195,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, if (error) break; sharelock(lkp, 1); - COUNT(p, 1); + COUNT(td, 1); break; } /* @@ -203,7 +203,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, * An alternative would be to fail with EDEADLK. */ sharelock(lkp, 1); - COUNT(p, 1); + COUNT(td, 1); /* fall into downgrade */ case LK_DOWNGRADE: @@ -225,7 +225,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, */ if (lkp->lk_flags & LK_WANT_UPGRADE) { shareunlock(lkp, 1); - COUNT(p, -1); + COUNT(td, -1); error = EBUSY; break; } @@ -243,7 +243,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, if ((lkp->lk_lockholder == td) || (lkp->lk_sharecount <= 0)) panic("lockmgr: upgrade exclusive lock"); shareunlock(lkp, 1); - COUNT(p, -1); + COUNT(td, -1); /* * If we are just polling, check to see if we will block. */ @@ -275,7 +275,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, lkp->lk_lineno = line; lkp->lk_lockername = name; #endif - COUNT(p, 1); + COUNT(td, 1); break; } /* @@ -297,7 +297,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, panic("lockmgr: locking against myself"); if ((extflags & LK_CANRECURSE) != 0) { lkp->lk_exclusivecount++; - COUNT(p, 1); + COUNT(td, 1); break; } } @@ -333,7 +333,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, lkp->lk_lineno = line; lkp->lk_lockername = name; #endif - COUNT(p, 1); + COUNT(td, 1); break; case LK_RELEASE: @@ -346,7 +346,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, lkp->lk_lockholder); } if (lkp->lk_lockholder != LK_KERNTHREAD) { - COUNT(p, -1); + COUNT(td, -1); } if (lkp->lk_exclusivecount == 1) { lkp->lk_flags &= ~LK_HAVE_EXCL; @@ -357,7 +357,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, } } else if (lkp->lk_flags & LK_SHARE_NONZERO) { shareunlock(lkp, 1); - COUNT(p, -1); + COUNT(td, -1); } if (lkp->lk_flags & LK_WAIT_NONZERO) wakeup((void *)lkp); @@ -384,7 +384,7 @@ debuglockmgr(struct lock *lkp, u_int flags, struct lwkt_token *interlkp, lkp->lk_lineno = line; lkp->lk_lockername = name; #endif - COUNT(p, 1); + COUNT(td, 1); break; default: diff --git a/sys/kern/kern_poll.c b/sys/kern/kern_poll.c index 54bbc54b14..299073f37a 100644 --- a/sys/kern/kern_poll.c +++ b/sys/kern/kern_poll.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_poll.c,v 1.2.2.4 2002/06/27 23:26:33 luigi Exp $ - * $DragonFly: src/sys/kern/kern_poll.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/kern_poll.c,v 1.3 2003/07/21 07:57:47 dillon Exp $ */ #include @@ -260,16 +260,16 @@ ether_poll(int count) /* * idle_poll is replaces the body of the idle loop when DEVICE_POLLING - * is used. + * is used. YYY not currently implemented. */ int idle_poll(void) { if (poll_in_idle_loop && poll_handlers > 0) { int s = splimp(); - enable_intr(); + cpu_enable_intr(); ether_poll(poll_each_burst); - disable_intr(); + cpu_disable_intr(); splx(s); vm_page_zero_idle(); return 1; diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 06d4931a38..c0acb5a7eb 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -37,7 +37,7 @@ * * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/kern_subr.c,v 1.31.2.2 2002/04/21 08:09:37 bde Exp $ - * $DragonFly: src/sys/kern/kern_subr.c,v 1.6 2003/06/30 19:50:31 dillon Exp $ + * $DragonFly: src/sys/kern/kern_subr.c,v 1.7 2003/07/21 07:57:47 dillon Exp $ */ #include @@ -212,6 +212,7 @@ uioread(n, uio, obj, nread) struct iovec *iov; u_int cnt, tcnt; int error; + int baseticks = ticks; *nread = 0; if (vfs_ioopt < 2) @@ -239,8 +240,10 @@ uioread(n, uio, obj, nread) cnt &= ~PAGE_MASK; - if (ticks - mycpu->gd_switchticks >= hogticks) + if (ticks - baseticks >= hogticks) { uio_yield(); + baseticks = ticks; + } error = vm_uiomove(&curproc->p_vmspace->vm_map, obj, uio->uio_offset, cnt, (vm_offset_t) iov->iov_base, &npagesmoved); diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 6f3ec150ee..2b8d3a30aa 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -14,7 +14,7 @@ * of the author. This software is distributed AS-IS. * * $FreeBSD: src/sys/kern/vfs_aio.c,v 1.70.2.28 2003/05/29 06:15:35 alc Exp $ - * $DragonFly: src/sys/kern/vfs_aio.c,v 1.7 2003/07/19 21:14:39 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_aio.c,v 1.8 2003/07/21 07:57:47 dillon Exp $ */ /* @@ -47,6 +47,8 @@ #include #include #include +#include +#include #include #include "opt_vfs_aio.h" @@ -345,7 +347,7 @@ aio_free_entry(struct aiocblist *aiocbe) } /* aiocbe is going away, we need to destroy any knotes */ - knote_remove(p, &aiocbe->klist); + knote_remove(p->p_thread, &aiocbe->klist); if ((ki->kaio_flags & KAIO_WAKEUP) || ((ki->kaio_flags & KAIO_RUNDOWN) && ((ki->kaio_buffer_count == 0) && (ki->kaio_queue_count == 0)))) { @@ -384,7 +386,7 @@ aio_free_entry(struct aiocblist *aiocbe) } aiocbe->jobstate = JOBST_NULL; untimeout(process_signal, aiocbe, aiocbe->timeouthandle); - fdrop(aiocbe->fd_file, curproc); + fdrop(aiocbe->fd_file, curthread); TAILQ_INSERT_HEAD(&aio_freejobs, aiocbe, list); return 0; } @@ -551,7 +553,7 @@ aio_selectjob(struct aioproclist *aiop) static void aio_process(struct aiocblist *aiocbe) { - struct proc *mycp; + struct thread *mytd; struct aiocb *cb; struct file *fp; struct uio auio; @@ -561,7 +563,7 @@ aio_process(struct aiocblist *aiocbe) int oublock_st, oublock_end; int inblock_st, inblock_end; - mycp = curproc; + mytd = curthread; cb = &aiocbe->uaiocb; fp = aiocbe->fd_file; @@ -574,23 +576,23 @@ aio_process(struct aiocblist *aiocbe) auio.uio_resid = cb->aio_nbytes; cnt = cb->aio_nbytes; auio.uio_segflg = UIO_USERSPACE; - auio.uio_procp = mycp; + auio.uio_td = mytd; - inblock_st = mycp->p_stats->p_ru.ru_inblock; - oublock_st = mycp->p_stats->p_ru.ru_oublock; + inblock_st = mytd->td_proc->p_stats->p_ru.ru_inblock; + oublock_st = mytd->td_proc->p_stats->p_ru.ru_oublock; /* * _aio_aqueue() acquires a reference to the file that is * released in aio_free_entry(). */ if (cb->aio_lio_opcode == LIO_READ) { auio.uio_rw = UIO_READ; - error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET, mycp); + error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET, mytd); } else { auio.uio_rw = UIO_WRITE; - error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET, mycp); + error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET, mytd); } - inblock_end = mycp->p_stats->p_ru.ru_inblock; - oublock_end = mycp->p_stats->p_ru.ru_oublock; + inblock_end = mytd->td_proc->p_stats->p_ru.ru_inblock; + oublock_end = mytd->td_proc->p_stats->p_ru.ru_oublock; aiocbe->inputcharge = inblock_end - inblock_st; aiocbe->outputcharge = oublock_end - oublock_st; @@ -861,7 +863,7 @@ aio_daemon(void *uproc) mycp->p_vmspace->vm_refcnt); } #endif - exit1(mycp, 0); + exit1(0); } } splx(s); @@ -1135,7 +1137,7 @@ aio_swake(struct socket *so, struct sockbuf *sb) static int _aio_aqueue(struct aiocb *job, struct aio_liojob *lj, int type) { - struct proc *p = curprpoc; + struct proc *p = curproc; struct filedesc *fdp; struct file *fp; unsigned int fd; @@ -1225,7 +1227,7 @@ _aio_aqueue(struct aiocb *job, struct aio_liojob *lj, int type) jobrefid++; if (opcode == LIO_NOP) { - fdrop(fp, p); + fdrop(fp, p->p_thread); TAILQ_INSERT_HEAD(&aio_freejobs, aiocbe, list); if (type == 0) { suword(&job->_aiocb_private.error, 0); @@ -1272,10 +1274,10 @@ _aio_aqueue(struct aiocb *job, struct aio_liojob *lj, int type) kev.filter = EVFILT_AIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; kev.data = (intptr_t)aiocbe; - error = kqueue_register(kq, &kev, p); + error = kqueue_register(kq, &kev, p->p_thread); aqueue_fail: if (error) { - fdrop(fp, p); + fdrop(fp, p->p_thread); TAILQ_INSERT_HEAD(&aio_freejobs, aiocbe, list); if (type == 0) suword(&job->_aiocb_private.error, error); @@ -1380,7 +1382,7 @@ done: static int aio_aqueue(struct aiocb *job, int type) { - struct proc *p = curprpoc; + struct proc *p = curproc; struct kaioinfo *ki; if (p->p_aioinfo == NULL) diff --git a/sys/net/i4b/driver/i4b_ctl.c b/sys/net/i4b/driver/i4b_ctl.c index 2e021e283b..e48118fe38 100644 --- a/sys/net/i4b/driver/i4b_ctl.c +++ b/sys/net/i4b/driver/i4b_ctl.c @@ -30,7 +30,7 @@ * $Id: i4b_ctl.c,v 1.37 2000/05/31 08:04:43 hm Exp $ * * $FreeBSD: src/sys/i4b/driver/i4b_ctl.c,v 1.10.2.3 2001/08/12 16:22:48 hm Exp $ - * $DragonFly: src/sys/net/i4b/driver/i4b_ctl.c,v 1.3 2003/07/21 05:50:42 dillon Exp $ + * $DragonFly: src/sys/net/i4b/driver/i4b_ctl.c,v 1.4 2003/07/21 07:57:46 dillon Exp $ * * last edit-date: [Sat Aug 11 18:06:38 2001] * @@ -234,7 +234,7 @@ i4bctlattach() * i4bctlopen - device driver open routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4bctlopen(dev_t dev, int flag, int fmt, struct proc *p) +i4bctlopen(dev_t dev, int flag, int fmt, struct thread *td) { if(minor(dev)) return (ENXIO); @@ -251,7 +251,7 @@ i4bctlopen(dev_t dev, int flag, int fmt, struct proc *p) * i4bctlclose - device driver close routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4bctlclose(dev_t dev, int flag, int fmt, struct proc *p) +i4bctlclose(dev_t dev, int flag, int fmt, struct thread *td) { openflag = 0; return (0); @@ -262,7 +262,7 @@ i4bctlclose(dev_t dev, int flag, int fmt, struct proc *p) *---------------------------------------------------------------------------*/ PDEVSTATIC int #if defined (__FreeBSD_version) && __FreeBSD_version >= 300003 -i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) #elif defined(__bsdi__) i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) #else @@ -364,7 +364,7 @@ i4bctlioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) * i4bctlpoll - device driver poll routine *---------------------------------------------------------------------------*/ static int -i4bctlpoll (dev_t dev, int events, struct proc *p) +i4bctlpoll (dev_t dev, int events, struct thread *td) { return (ENODEV); } diff --git a/sys/net/i4b/driver/i4b_ipr.c b/sys/net/i4b/driver/i4b_ipr.c index ecdd665952..df6b20fd2e 100644 --- a/sys/net/i4b/driver/i4b_ipr.c +++ b/sys/net/i4b/driver/i4b_ipr.c @@ -28,7 +28,7 @@ * --------------------------------------------------------- * * $FreeBSD: src/sys/i4b/driver/i4b_ipr.c,v 1.8.2.3 2001/10/27 15:48:17 hm Exp $ - * $DragonFly: src/sys/net/i4b/driver/i4b_ipr.c,v 1.3 2003/06/25 03:55:55 dillon Exp $ + * $DragonFly: src/sys/net/i4b/driver/i4b_ipr.c,v 1.4 2003/07/21 07:57:46 dillon Exp $ * * last edit-date: [Fri Oct 26 19:32:38 2001] * @@ -619,7 +619,6 @@ i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct thread *td = curthread; /* XXX */ -#if defined(__FreeBSD_version) && __FreeBSD_version >= 400005 if ((error = suser(td)) != 0) return (error); sl_compress_setup(sc->sc_compr, *(int *)data); diff --git a/sys/net/i4b/driver/i4b_rbch.c b/sys/net/i4b/driver/i4b_rbch.c index 412796ccea..f2bafc79c8 100644 --- a/sys/net/i4b/driver/i4b_rbch.c +++ b/sys/net/i4b/driver/i4b_rbch.c @@ -28,7 +28,7 @@ * --------------------------------------------------- * * $FreeBSD: src/sys/i4b/driver/i4b_rbch.c,v 1.10.2.3 2001/08/12 16:22:48 hm Exp $ - * $DragonFly: src/sys/net/i4b/driver/i4b_rbch.c,v 1.4 2003/07/21 05:50:42 dillon Exp $ + * $DragonFly: src/sys/net/i4b/driver/i4b_rbch.c,v 1.5 2003/07/21 07:57:46 dillon Exp $ * * last edit-date: [Sat Aug 11 18:06:57 2001] * @@ -307,7 +307,7 @@ i4brbchattach() * open rbch device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4brbchopen(dev_t dev, int flag, int fmt, struct proc *p) +i4brbchopen(dev_t dev, int flag, int fmt, struct thread *td) { int unit = minor(dev); @@ -332,7 +332,7 @@ i4brbchopen(dev_t dev, int flag, int fmt, struct proc *p) * close rbch device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4brbchclose(dev_t dev, int flag, int fmt, struct proc *p) +i4brbchclose(dev_t dev, int flag, int fmt, struct thread *td) { int unit = minor(dev); struct rbch_softc *sc = &rbch_softc[unit]; @@ -575,7 +575,7 @@ i4brbchwrite(dev_t dev, struct uio * uio, int ioflag) * rbch device ioctl handlibg *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4brbchioctl(dev_t dev, IOCTL_CMD_T cmd, caddr_t data, int flag, struct proc *p) +i4brbchioctl(dev_t dev, IOCTL_CMD_T cmd, caddr_t data, int flag, struct thread *td) { int error = 0; int unit = minor(dev); @@ -674,7 +674,7 @@ i4brbchioctl(dev_t dev, IOCTL_CMD_T cmd, caddr_t data, int flag, struct proc *p) * device driver poll *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4brbchpoll(dev_t dev, int events, struct proc *p) +i4brbchpoll(dev_t dev, int events, struct thread *td) { int revents = 0; /* Events we found */ int s; @@ -720,7 +720,7 @@ i4brbchpoll(dev_t dev, int events, struct proc *p) } if(revents == 0) - selrecord(p, &sc->selp); + selrecord(td, &sc->selp); splx(s); return(revents); @@ -732,7 +732,7 @@ i4brbchpoll(dev_t dev, int events, struct proc *p) * device driver select *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4brbchselect(dev_t dev, int rw, struct proc *p) +i4brbchselect(dev_t dev, int rw, struct thread *td) { int unit = minor(dev); struct rbch_softc *sc = &rbch_softc[unit]; diff --git a/sys/net/i4b/driver/i4b_tel.c b/sys/net/i4b/driver/i4b_tel.c index c4e1d16615..9f29bc8e83 100644 --- a/sys/net/i4b/driver/i4b_tel.c +++ b/sys/net/i4b/driver/i4b_tel.c @@ -28,7 +28,7 @@ * -------------------------------------------- * * $FreeBSD: src/sys/i4b/driver/i4b_tel.c,v 1.10.2.4 2001/12/16 15:12:57 hm Exp $ - * $DragonFly: src/sys/net/i4b/driver/i4b_tel.c,v 1.4 2003/07/21 05:50:42 dillon Exp $ + * $DragonFly: src/sys/net/i4b/driver/i4b_tel.c,v 1.5 2003/07/21 07:57:46 dillon Exp $ * * last edit-date: [Sat Aug 11 18:07:05 2001] * @@ -236,7 +236,7 @@ i4btelattach(void *dummy) * open tel device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btelopen(dev_t dev, int flag, int fmt, struct proc *p) +i4btelopen(dev_t dev, int flag, int fmt, struct thread *td) { int unit = UNIT(dev); int func = FUNC(dev); @@ -265,7 +265,7 @@ i4btelopen(dev_t dev, int flag, int fmt, struct proc *p) * close tel device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btelclose(dev_t dev, int flag, int fmt, struct proc *p) +i4btelclose(dev_t dev, int flag, int fmt, struct thread *td) { int unit = UNIT(dev); int func = FUNC(dev); @@ -308,7 +308,7 @@ i4btelclose(dev_t dev, int flag, int fmt, struct proc *p) * i4btelioctl - device driver ioctl routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) { int unit = UNIT(dev); int func = FUNC(dev); @@ -736,7 +736,7 @@ tel_tone(tel_sc_t *sc) * device driver poll *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btelpoll(dev_t dev, int events, struct proc *p) +i4btelpoll(dev_t dev, int events, struct thread *td) { int revents = 0; /* Events we found */ int s; @@ -784,7 +784,7 @@ i4btelpoll(dev_t dev, int events, struct proc *p) if(revents == 0) { NDBGL4(L4_TELDBG, "i4btel%d, selrecord", unit); - selrecord(p, &sc->selp); + selrecord(td, &sc->selp); } } else if(func == FUNCDIAL) @@ -805,7 +805,7 @@ i4btelpoll(dev_t dev, int events, struct proc *p) if(revents == 0) { NDBGL4(L4_TELDBG, "i4bteld%d, selrecord", unit); - selrecord(p, &sc->selp); + selrecord(td, &sc->selp); } } splx(s); @@ -818,7 +818,7 @@ i4btelpoll(dev_t dev, int events, struct proc *p) * device driver select *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btelsel(dev_t dev, int rw, struct proc *p) +i4btelsel(dev_t dev, int rw, struct thread *td) { int s; int unit = UNIT(dev); diff --git a/sys/net/i4b/driver/i4b_trace.c b/sys/net/i4b/driver/i4b_trace.c index d25a9ef3d7..cc610aa9a1 100644 --- a/sys/net/i4b/driver/i4b_trace.c +++ b/sys/net/i4b/driver/i4b_trace.c @@ -30,7 +30,7 @@ * last edit-date: [Sat Aug 11 18:07:15 2001] * * $FreeBSD: src/sys/i4b/driver/i4b_trace.c,v 1.9.2.3 2001/08/12 16:22:48 hm Exp $ - * $DragonFly: src/sys/net/i4b/driver/i4b_trace.c,v 1.4 2003/07/21 05:50:42 dillon Exp $ + * $DragonFly: src/sys/net/i4b/driver/i4b_trace.c,v 1.5 2003/07/21 07:57:46 dillon Exp $ * * NOTE: the code assumes that SPLI4B >= splimp ! * @@ -337,7 +337,7 @@ get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf) * open trace device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btrcopen(dev_t dev, int flag, int fmt, struct proc *p) +i4btrcopen(dev_t dev, int flag, int fmt, struct thread *td) { int x; int unit = minor(dev); @@ -364,7 +364,7 @@ i4btrcopen(dev_t dev, int flag, int fmt, struct proc *p) * close trace device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btrcclose(dev_t dev, int flag, int fmt, struct proc *p) +i4btrcclose(dev_t dev, int flag, int fmt, struct thread *td) { int unit = minor(dev); int i, x; @@ -465,7 +465,7 @@ i4btrcread(dev_t dev, struct uio * uio, int ioflag) * poll device *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4btrcpoll(dev_t dev, int events, struct proc *p) +i4btrcpoll(dev_t dev, int events, struct thread *td) { return(ENODEV); } @@ -476,7 +476,7 @@ i4btrcpoll(dev_t dev, int events, struct proc *p) *---------------------------------------------------------------------------*/ PDEVSTATIC int #if defined (__FreeBSD_version) && __FreeBSD_version >= 300003 -i4btrcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +i4btrcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) #elif defined(__bsdi__) i4btrcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) #else diff --git a/sys/net/i4b/layer4/i4b_i4bdrv.c b/sys/net/i4b/layer4/i4b_i4bdrv.c index f39a63676f..b4fda927b3 100644 --- a/sys/net/i4b/layer4/i4b_i4bdrv.c +++ b/sys/net/i4b/layer4/i4b_i4bdrv.c @@ -28,7 +28,7 @@ * -------------------------------------------- * * $FreeBSD: src/sys/i4b/layer4/i4b_i4bdrv.c,v 1.11.2.5 2001/12/16 15:12:59 hm Exp $ - * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.4 2003/07/21 05:50:42 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.5 2003/07/21 07:57:47 dillon Exp $ * * last edit-date: [Sat Aug 11 18:08:10 2001] * @@ -279,7 +279,7 @@ i4battach() * i4bopen - device driver open routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4bopen(dev_t dev, int flag, int fmt, struct proc *p) +i4bopen(dev_t dev, int flag, int fmt, struct thread *td) { int x; @@ -301,7 +301,7 @@ i4bopen(dev_t dev, int flag, int fmt, struct proc *p) * i4bclose - device driver close routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4bclose(dev_t dev, int flag, int fmt, struct proc *p) +i4bclose(dev_t dev, int flag, int fmt, struct thread *td) { int x = splimp(); openflag = 0; @@ -363,7 +363,7 @@ i4bread(dev_t dev, struct uio *uio, int ioflag) *---------------------------------------------------------------------------*/ PDEVSTATIC int #if defined (__FreeBSD_version) && __FreeBSD_version >= 300003 -i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) +i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) #elif defined(__bsdi__) i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) #else @@ -929,7 +929,7 @@ diag_done: * i4bselect - device driver select routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4bselect(dev_t dev, int rw, struct proc *p) +i4bselect(dev_t dev, int rw, struct thread *td) { int x; @@ -942,7 +942,7 @@ i4bselect(dev_t dev, int rw, struct proc *p) if(!IF_QEMPTY(&i4b_rdqueue)) return(1); x = splimp(); - selrecord(p, &select_rd_info); + selrecord(td, &select_rd_info); selflag = 1; splx(x); return(0); @@ -961,7 +961,7 @@ i4bselect(dev_t dev, int rw, struct proc *p) * i4bpoll - device driver poll routine *---------------------------------------------------------------------------*/ PDEVSTATIC int -i4bpoll(dev_t dev, int events, struct proc *p) +i4bpoll(dev_t dev, int events, struct thread *td) { int x; @@ -974,7 +974,7 @@ i4bpoll(dev_t dev, int events, struct proc *p) return(1); x = splimp(); - selrecord(p, &select_rd_info); + selrecord(td, &select_rd_info); selflag = 1; splx(x); return(0); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index f453153671..cc83352fa0 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -32,7 +32,7 @@ * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/netinet/ip_output.c,v 1.99.2.37 2003/04/15 06:44:45 silby Exp $ - * $DragonFly: src/sys/netinet/ip_output.c,v 1.3 2003/06/25 03:56:04 dillon Exp $ + * $DragonFly: src/sys/netinet/ip_output.c,v 1.4 2003/07/21 07:57:48 dillon Exp $ */ #define _IP_VHL @@ -1459,8 +1459,8 @@ ip_ctloutput(so, sopt) break; if ((error = soopt_mcopyin(sopt, m)) != 0) /* XXX */ break; - priv = (sopt->sopt_p != NULL && - suser(sopt->sopt_p->p_thread) != 0) ? 0 : 1; + priv = (sopt->sopt_td != NULL && + suser(sopt->sopt_td) != 0) ? 0 : 1; req = mtod(m, caddr_t); len = m->m_len; optname = sopt->sopt_name; diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h index 28a9281051..6d7a5002f3 100644 --- a/sys/netinet6/in6_pcb.h +++ b/sys/netinet6/in6_pcb.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/in6_pcb.h,v 1.2.2.3 2001/08/13 16:26:17 ume Exp $ */ -/* $DragonFly: src/sys/netinet6/in6_pcb.h,v 1.3 2003/06/25 05:22:32 dillon Exp $ */ +/* $DragonFly: src/sys/netinet6/in6_pcb.h,v 1.4 2003/07/21 07:57:50 dillon Exp $ */ /* $KAME: in6_pcb.h,v 1.13 2001/02/06 09:16:53 itojun Exp $ */ /* @@ -75,6 +75,12 @@ #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) +struct in6pcb; +struct inpcbinfo; +struct inpcbhead; +struct ip6_moptions; +struct ip6_pktopts; + void in6_pcbpurgeif0 __P((struct in6pcb *, struct ifnet *)); void in6_losing __P((struct inpcb *)); int in6_pcballoc __P((struct socket *, struct inpcbinfo *, struct thread *)); diff --git a/sys/netproto/atalk/at_control.c b/sys/netproto/atalk/at_control.c index dae2cb90ce..61bc3e0a96 100644 --- a/sys/netproto/atalk/at_control.c +++ b/sys/netproto/atalk/at_control.c @@ -2,7 +2,7 @@ * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * - * $DragonFly: src/sys/netproto/atalk/at_control.c,v 1.3 2003/07/19 21:14:44 dillon Exp $ + * $DragonFly: src/sys/netproto/atalk/at_control.c,v 1.4 2003/07/21 07:57:48 dillon Exp $ */ #include @@ -44,7 +44,7 @@ static int aa_claim_addr(struct ifaddr *ifa, struct sockaddr *gw); int at_control(struct socket *so, u_long cmd, caddr_t data, - struct ifnet *ifp, struct proc *p ) + struct ifnet *ifp, struct thread *td ) { struct ifreq *ifr = (struct ifreq *)data; struct sockaddr_at *sat; diff --git a/sys/netproto/atalk/at_extern.h b/sys/netproto/atalk/at_extern.h index 8191d4f8a8..096acb8228 100644 --- a/sys/netproto/atalk/at_extern.h +++ b/sys/netproto/atalk/at_extern.h @@ -1,3 +1,6 @@ +/* + * $DragonFly: src/sys/netproto/atalk/at_extern.h,v 1.2 2003/07/21 07:57:48 dillon Exp $ + */ struct mbuf; struct sockaddr_at; @@ -24,7 +27,7 @@ extern int at_control __P(( struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, - struct proc *p )); + struct thread *td )); extern u_short at_cksum __P(( struct mbuf *m, int skip)); extern void ddp_init __P((void )); extern struct at_ifaddr *at_ifawithnet __P((struct sockaddr_at *)); diff --git a/sys/netproto/atalk/ddp_usrreq.c b/sys/netproto/atalk/ddp_usrreq.c index da15521816..0e58ce85b5 100644 --- a/sys/netproto/atalk/ddp_usrreq.c +++ b/sys/netproto/atalk/ddp_usrreq.c @@ -1,6 +1,8 @@ /* * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. + * + * $DragonFly: src/sys/netproto/atalk/ddp_usrreq.c,v 1.3 2003/07/21 07:57:48 dillon Exp $ */ #include @@ -84,7 +86,7 @@ ddp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) return( EINVAL); } s = splnet(); - error = at_pcbsetaddr(ddp, nam, p); + error = at_pcbsetaddr(ddp, nam, td); splx(s); return (error); } @@ -106,7 +108,7 @@ ddp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) } s = splnet(); - error = at_pcbconnect( ddp, nam, p ); + error = at_pcbconnect( ddp, nam, td ); splx(s); if ( error == 0 ) soisconnected( so ); @@ -172,7 +174,7 @@ ddp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, } s = splnet(); - error = at_pcbconnect(ddp, addr, p); + error = at_pcbconnect(ddp, addr, td); splx( s ); if ( error ) { return(error); @@ -400,7 +402,7 @@ at_pcbconnect(struct ddpcb *ddp, struct sockaddr *addr, struct thread *td) ddp->ddp_fsat = *sat; if ( ddp->ddp_lsat.sat_port == ATADDR_ANYPORT ) { - return(at_pcbsetaddr(ddp, (struct sockaddr *)0, p)); + return(at_pcbsetaddr(ddp, (struct sockaddr *)0, td)); } return( 0 ); } diff --git a/sys/netproto/ipx/ipx_ip.c b/sys/netproto/ipx/ipx_ip.c index eb85c0a3f0..4c7efc17c5 100644 --- a/sys/netproto/ipx/ipx_ip.c +++ b/sys/netproto/ipx/ipx_ip.c @@ -34,7 +34,7 @@ * @(#)ipx_ip.c * * $FreeBSD: src/sys/netipx/ipx_ip.c,v 1.24.2.2 2003/01/23 21:06:48 sam Exp $ - * $DragonFly: src/sys/netproto/ipx/ipx_ip.c,v 1.2 2003/06/17 04:28:53 dillon Exp $ + * $DragonFly: src/sys/netproto/ipx/ipx_ip.c,v 1.3 2003/07/21 07:57:50 dillon Exp $ */ /* @@ -393,14 +393,14 @@ ipxip_route(so, sopt) ifr_ipxip.ifr_name[4] = '0' + ipxipif.if_unit - 1; ifr_ipxip.ifr_dstaddr = *(struct sockaddr *)ipx_dst; ipx_control(so, (int)SIOCSIFDSTADDR, (caddr_t)&ifr_ipxip, - (struct ifnet *)ifn, sopt->sopt_p); + (struct ifnet *)ifn, sopt->sopt_td); /* use any of our addresses */ satoipx_addr(ifr_ipxip.ifr_addr).x_host = ipx_ifaddr->ia_addr.sipx_addr.x_host; return (ipx_control(so, (int)SIOCSIFADDR, (caddr_t)&ifr_ipxip, - (struct ifnet *)ifn, sopt->sopt_p)); + (struct ifnet *)ifn, sopt->sopt_td)); } static int diff --git a/sys/netproto/ipx/ipx_pcb.c b/sys/netproto/ipx/ipx_pcb.c index ccb9bbf622..3e5ebf158a 100644 --- a/sys/netproto/ipx/ipx_pcb.c +++ b/sys/netproto/ipx/ipx_pcb.c @@ -34,7 +34,7 @@ * @(#)ipx_pcb.c * * $FreeBSD: src/sys/netipx/ipx_pcb.c,v 1.18.2.1 2001/02/22 09:44:18 bp Exp $ - * $DragonFly: src/sys/netproto/ipx/ipx_pcb.c,v 1.3 2003/06/25 03:56:05 dillon Exp $ + * $DragonFly: src/sys/netproto/ipx/ipx_pcb.c,v 1.4 2003/07/21 07:57:50 dillon Exp $ */ #include @@ -95,7 +95,7 @@ ipx_pcbbind(struct ipxpcb *ipxp, struct sockaddr *nam, struct thread *td) int error; if (aport < IPXPORT_RESERVED && - p != NULL && (error = suser(td)) != 0) + td != NULL && (error = suser(td)) != 0) return (error); if (ipx_pcblookup(&zeroipx_addr, lport, 0)) return (EADDRINUSE); diff --git a/sys/netproto/ipx/ipx_pcb.h b/sys/netproto/ipx/ipx_pcb.h index 65ff15fed2..97dae63dd4 100644 --- a/sys/netproto/ipx/ipx_pcb.h +++ b/sys/netproto/ipx/ipx_pcb.h @@ -34,7 +34,7 @@ * @(#)ipx_pcb.h * * $FreeBSD: src/sys/netipx/ipx_pcb.h,v 1.15 1999/12/29 04:46:08 peter Exp $ - * $DragonFly: src/sys/netproto/ipx/ipx_pcb.h,v 1.2 2003/06/17 04:28:53 dillon Exp $ + * $DragonFly: src/sys/netproto/ipx/ipx_pcb.h,v 1.3 2003/07/21 07:57:50 dillon Exp $ */ #ifndef _NETIPX_IPX_PCB_H_ @@ -84,11 +84,11 @@ struct ipxpcb { extern struct ipxpcb ipxpcb; /* head of list */ int ipx_pcballoc __P((struct socket *so, struct ipxpcb *head, - struct proc *p)); + struct thread *td)); int ipx_pcbbind __P((struct ipxpcb *ipxp, struct sockaddr *nam, - struct proc *p)); + struct thread *td)); int ipx_pcbconnect __P((struct ipxpcb *ipxp, struct sockaddr *nam, - struct proc *p)); + struct thread *td)); void ipx_pcbdetach __P((struct ipxpcb *ipxp)); void ipx_pcbdisconnect __P((struct ipxpcb *ipxp)); struct ipxpcb * diff --git a/sys/netproto/ipx/ipx_var.h b/sys/netproto/ipx/ipx_var.h index e6b46ed4bd..33c1f81a24 100644 --- a/sys/netproto/ipx/ipx_var.h +++ b/sys/netproto/ipx/ipx_var.h @@ -34,7 +34,7 @@ * @(#)ipx_var.h * * $FreeBSD: src/sys/netipx/ipx_var.h,v 1.14 1999/12/29 04:46:09 peter Exp $ - * $DragonFly: src/sys/netproto/ipx/ipx_var.h,v 1.2 2003/06/17 04:28:53 dillon Exp $ + * $DragonFly: src/sys/netproto/ipx/ipx_var.h,v 1.3 2003/07/21 07:57:50 dillon Exp $ */ #ifndef _NETIPX_IPX_VAR_H_ @@ -81,7 +81,7 @@ extern union ipx_host ipx_broadhost; struct ifnet; struct ipx_addr; struct mbuf; -struct proc; +struct thread; struct route; struct sockaddr; struct socket; @@ -90,7 +90,7 @@ struct sockopt; void ipx_abort __P((struct ipxpcb *ipxp)); u_short ipx_cksum __P((struct mbuf *m, int len)); int ipx_control __P((struct socket *so, u_long cmd, caddr_t data, - struct ifnet *ifp, struct proc *p)); + struct ifnet *ifp, struct thread *td)); void ipx_ctlinput __P((int cmd, struct sockaddr *arg_as_sa, void *dummy)); int ipx_ctloutput __P((struct socket *so, struct sockopt *sopt)); void ipx_drop __P((struct ipxpcb *ipxp, int errno)); diff --git a/sys/netproto/ipx/spx_usrreq.c b/sys/netproto/ipx/spx_usrreq.c index 6adc7d66cc..5cf8672bcb 100644 --- a/sys/netproto/ipx/spx_usrreq.c +++ b/sys/netproto/ipx/spx_usrreq.c @@ -34,7 +34,7 @@ * @(#)spx_usrreq.h * * $FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.27.2.1 2001/02/22 09:44:18 bp Exp $ - * $DragonFly: src/sys/netproto/ipx/spx_usrreq.c,v 1.2 2003/06/17 04:28:53 dillon Exp $ + * $DragonFly: src/sys/netproto/ipx/spx_usrreq.c,v 1.3 2003/07/21 07:57:50 dillon Exp $ */ #include @@ -88,20 +88,20 @@ static struct spxpcb *spx_usrclosed(struct spxpcb *cb); static int spx_usr_abort(struct socket *so); static int spx_accept(struct socket *so, struct sockaddr **nam); -static int spx_attach(struct socket *so, int proto, struct proc *p); -static int spx_bind(struct socket *so, struct sockaddr *nam, struct proc *p); +static int spx_attach(struct socket *so, int proto, struct thread *td); +static int spx_bind(struct socket *so, struct sockaddr *nam, struct thread *td); static int spx_connect(struct socket *so, struct sockaddr *nam, - struct proc *p); + struct thread *td); static int spx_detach(struct socket *so); static int spx_usr_disconnect(struct socket *so); -static int spx_listen(struct socket *so, struct proc *p); +static int spx_listen(struct socket *so, struct thread *td); static int spx_rcvd(struct socket *so, int flags); static int spx_rcvoob(struct socket *so, struct mbuf *m, int flags); static int spx_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, - struct proc *p); + struct thread *td); static int spx_shutdown(struct socket *so); -static int spx_sp_attach(struct socket *so, int proto, struct proc *p); +static int spx_sp_attach(struct socket *so, int proto, struct thread *td); struct pr_usrreqs spx_usrreqs = { spx_usr_abort, spx_accept, spx_attach, spx_bind, @@ -222,7 +222,7 @@ spx_input(m, ipxp) laddr = ipxp->ipxp_laddr; if (ipx_nullhost(laddr)) ipxp->ipxp_laddr = si->si_dna; - if (ipx_pcbconnect(ipxp, (struct sockaddr *)sipx, &proc0)) { + if (ipx_pcbconnect(ipxp, (struct sockaddr *)sipx, &thread0)) { ipxp->ipxp_laddr = laddr; spx_istat.noconn++; goto drop; @@ -1303,10 +1303,10 @@ spx_accept(so, nam) } static int -spx_attach(so, proto, p) +spx_attach(so, proto, td) struct socket *so; int proto; - struct proc *p; + struct thread *td; { int error; int s; @@ -1321,7 +1321,7 @@ spx_attach(so, proto, p) if (ipxp != NULL) return (EISCONN); s = splnet(); - error = ipx_pcballoc(so, &ipxpcb, p); + error = ipx_pcballoc(so, &ipxpcb, td); if (error) goto spx_attach_end; if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { @@ -1369,16 +1369,16 @@ spx_attach_end: } static int -spx_bind(so, nam, p) +spx_bind(so, nam, td) struct socket *so; struct sockaddr *nam; - struct proc *p; + struct thread *td; { struct ipxpcb *ipxp; ipxp = sotoipxpcb(so); - return (ipx_pcbbind(ipxp, nam, p)); + return (ipx_pcbbind(ipxp, nam, td)); } /* @@ -1388,10 +1388,10 @@ spx_bind(so, nam, p) * Send initial system packet requesting connection. */ static int -spx_connect(so, nam, p) +spx_connect(so, nam, td) struct socket *so; struct sockaddr *nam; - struct proc *p; + struct thread *td; { int error; int s; @@ -1403,11 +1403,11 @@ spx_connect(so, nam, p) s = splnet(); if (ipxp->ipxp_lport == 0) { - error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, p); + error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td); if (error) goto spx_connect_end; } - error = ipx_pcbconnect(ipxp, nam, p); + error = ipx_pcbconnect(ipxp, nam, td); if (error) goto spx_connect_end; soisconnecting(so); @@ -1477,9 +1477,9 @@ spx_usr_disconnect(so) } static int -spx_listen(so, p) +spx_listen(so, td) struct socket *so; - struct proc *p; + struct thread *td; { int error; struct ipxpcb *ipxp; @@ -1490,7 +1490,7 @@ spx_listen(so, p) cb = ipxtospxpcb(ipxp); if (ipxp->ipxp_lport == 0) - error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, p); + error = ipx_pcbbind(ipxp, (struct sockaddr *)NULL, td); if (error == 0) cb->s_state = TCPS_LISTEN; return (error); @@ -1542,13 +1542,13 @@ spx_rcvoob(so, m, flags) } static int -spx_send(so, flags, m, addr, controlp, p) +spx_send(so, flags, m, addr, controlp, td) struct socket *so; int flags; struct mbuf *m; struct sockaddr *addr; struct mbuf *controlp; - struct proc *p; + struct thread *td; { int error; int s; @@ -1611,15 +1611,15 @@ spx_shutdown(so) } static int -spx_sp_attach(so, proto, p) +spx_sp_attach(so, proto, td) struct socket *so; int proto; - struct proc *p; + struct thread *td; { int error; struct ipxpcb *ipxp; - error = spx_attach(so, proto, p); + error = spx_attach(so, proto, td); if (error == 0) { ipxp = sotoipxpcb(so); ((struct spxpcb *)ipxp->ipxp_pcb)->s_flags |= diff --git a/sys/netproto/key/keydb.c b/sys/netproto/key/keydb.c index 88e6c4a37a..5692fef16a 100644 --- a/sys/netproto/key/keydb.c +++ b/sys/netproto/key/keydb.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netkey/keydb.c,v 1.1.2.1 2000/07/15 07:14:42 kris Exp $ */ -/* $DragonFly: src/sys/netproto/key/keydb.c,v 1.2 2003/06/17 04:28:53 dillon Exp $ */ +/* $DragonFly: src/sys/netproto/key/keydb.c,v 1.3 2003/07/21 07:57:51 dillon Exp $ */ /* $KAME: keydb.c,v 1.64 2000/05/11 17:02:30 itojun Exp $ */ /* @@ -34,6 +34,7 @@ #include "opt_inet.h" #include "opt_inet6.h" +#include #include #include #include diff --git a/sys/netproto/key/keysock.c b/sys/netproto/key/keysock.c index 857cebd12e..0ede95e8a5 100644 --- a/sys/netproto/key/keysock.c +++ b/sys/netproto/key/keysock.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netkey/keysock.c,v 1.1.2.4 2003/01/11 19:10:59 ume Exp $ */ -/* $DragonFly: src/sys/netproto/key/keysock.c,v 1.2 2003/06/17 04:28:53 dillon Exp $ */ +/* $DragonFly: src/sys/netproto/key/keysock.c,v 1.3 2003/07/21 07:57:51 dillon Exp $ */ /* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */ /* @@ -393,7 +393,7 @@ key_abort(struct socket *so) * derived from net/rtsock.c:rts_attach() */ static int -key_attach(struct socket *so, int proto, struct proc *p) +key_attach(struct socket *so, int proto, struct thread *td) { struct keycb *kp; int s, error; @@ -414,7 +414,7 @@ key_attach(struct socket *so, int proto, struct proc *p) */ s = splnet(); so->so_pcb = (caddr_t)kp; - error = raw_usrreqs.pru_attach(so, proto, p); + error = raw_usrreqs.pru_attach(so, proto, td); kp = (struct keycb *)sotorawcb(so); if (error) { free(kp, M_PCB); @@ -442,11 +442,11 @@ key_attach(struct socket *so, int proto, struct proc *p) * derived from net/rtsock.c:rts_bind() */ static int -key_bind(struct socket *so, struct sockaddr *nam, struct proc *p) +key_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { int s, error; s = splnet(); - error = raw_usrreqs.pru_bind(so, nam, p); /* xxx just EINVAL */ + error = raw_usrreqs.pru_bind(so, nam, td); /* xxx just EINVAL */ splx(s); return error; } @@ -456,11 +456,11 @@ key_bind(struct socket *so, struct sockaddr *nam, struct proc *p) * derived from net/rtsock.c:rts_connect() */ static int -key_connect(struct socket *so, struct sockaddr *nam, struct proc *p) +key_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { int s, error; s = splnet(); - error = raw_usrreqs.pru_connect(so, nam, p); /* XXX just EINVAL */ + error = raw_usrreqs.pru_connect(so, nam, td); /* XXX just EINVAL */ splx(s); return error; } @@ -523,11 +523,11 @@ key_peeraddr(struct socket *so, struct sockaddr **nam) */ static int key_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, - struct mbuf *control, struct proc *p) + struct mbuf *control, struct thread *td) { int s, error; s = splnet(); - error = raw_usrreqs.pru_send(so, flags, m, nam, control, p); + error = raw_usrreqs.pru_send(so, flags, m, nam, control, td); splx(s); return error; } diff --git a/sys/netproto/natm/natm.c b/sys/netproto/natm/natm.c index d738d20f8a..930575fb78 100644 --- a/sys/netproto/natm/natm.c +++ b/sys/netproto/natm/natm.c @@ -1,6 +1,6 @@ /* $NetBSD: natm.c,v 1.5 1996/11/09 03:26:26 chuck Exp $ */ /* $FreeBSD: src/sys/netnatm/natm.c,v 1.12 2000/02/13 03:32:03 peter Exp $ */ -/* $DragonFly: src/sys/netproto/natm/natm.c,v 1.2 2003/06/17 04:28:53 dillon Exp $ */ +/* $DragonFly: src/sys/netproto/natm/natm.c,v 1.3 2003/07/21 07:57:51 dillon Exp $ */ /* * @@ -69,25 +69,25 @@ static u_long natm0_recvspace = 16*1024; /* * FreeBSD new usrreqs supersedes pr_usrreq. */ -static int natm_usr_attach __P((struct socket *, int, struct proc *)); +static int natm_usr_attach __P((struct socket *, int, struct thread *)); static int natm_usr_detach __P((struct socket *)); static int natm_usr_connect __P((struct socket *, struct sockaddr *, - struct proc *)); + struct thread *)); static int natm_usr_disconnect __P((struct socket *)); static int natm_usr_shutdown __P((struct socket *)); static int natm_usr_send __P((struct socket *, int, struct mbuf *, struct sockaddr *, struct mbuf *, - struct proc *)); + struct thread *)); static int natm_usr_peeraddr __P((struct socket *, struct sockaddr **)); static int natm_usr_control __P((struct socket *, u_long, caddr_t, - struct ifnet *, struct proc *)); + struct ifnet *, struct thread *)); static int natm_usr_abort __P((struct socket *)); static int natm_usr_bind __P((struct socket *, struct sockaddr *, - struct proc *)); + struct thread *)); static int natm_usr_sockaddr __P((struct socket *, struct sockaddr **)); static int -natm_usr_attach(struct socket *so, int proto, struct proc *p) +natm_usr_attach(struct socket *so, int proto, struct thread *td) { struct natmpcb *npcb; int error = 0; @@ -141,7 +141,7 @@ natm_usr_detach(struct socket *so) } static int -natm_usr_connect(struct socket *so, struct sockaddr *nam, struct proc *p) +natm_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { struct natmpcb *npcb; struct sockaddr_natm *snatm; @@ -275,7 +275,7 @@ natm_usr_shutdown(struct socket *so) static int natm_usr_send(struct socket *so, int flags, struct mbuf *m, - struct sockaddr *nam, struct mbuf *control, struct proc *p) + struct sockaddr *nam, struct mbuf *control, struct thread *td) { struct natmpcb *npcb; struct atm_pseudohdr *aph; @@ -348,7 +348,7 @@ natm_usr_peeraddr(struct socket *so, struct sockaddr **nam) static int natm_usr_control(struct socket *so, u_long cmd, caddr_t arg, - struct ifnet *ifp, struct proc *p) + struct ifnet *ifp, struct thread *td) { struct natmpcb *npcb; struct atm_rawioctl ario; @@ -396,7 +396,7 @@ natm_usr_abort(struct socket *so) } static int -natm_usr_bind(struct socket *so, struct sockaddr *nam, struct proc *p) +natm_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { return EOPNOTSUPP; } diff --git a/sys/platform/pc32/gnu/isa/dgb.c b/sys/platform/pc32/gnu/isa/dgb.c index e611dfd89c..388cc510e7 100644 --- a/sys/platform/pc32/gnu/isa/dgb.c +++ b/sys/platform/pc32/gnu/isa/dgb.c @@ -1,6 +1,6 @@ /*- * dgb.c $FreeBSD: src/sys/gnu/i386/isa/dgb.c,v 1.56.2.1 2001/02/26 04:23:09 jlemon Exp $ - * dgb.c $DragonFly: src/sys/platform/pc32/gnu/isa/dgb.c,v 1.5 2003/07/21 05:50:39 dillon Exp $ + * dgb.c $DragonFly: src/sys/platform/pc32/gnu/isa/dgb.c,v 1.6 2003/07/21 07:57:43 dillon Exp $ * * Digiboard driver. * @@ -229,25 +229,25 @@ static struct cdevsw dgb_cdevsw = { static speed_t dgbdefaultrate = TTYDEF_SPEED; static struct speedtab dgbspeedtab[] = { - 0, FEP_B0, /* old (sysV-like) Bx codes */ - 50, FEP_B50, - 75, FEP_B75, - 110, FEP_B110, - 134, FEP_B134, - 150, FEP_B150, - 200, FEP_B200, - 300, FEP_B300, - 600, FEP_B600, - 1200, FEP_B1200, - 1800, FEP_B1800, - 2400, FEP_B2400, - 4800, FEP_B4800, - 9600, FEP_B9600, - 19200, FEP_B19200, - 38400, FEP_B38400, - 57600, (FEP_FASTBAUD|FEP_B50), /* B50 & fast baud table */ - 115200, (FEP_FASTBAUD|FEP_B110), /* B100 & fast baud table */ - -1, -1 + { 0, FEP_B0 }, /* old (sysV-like) Bx codes */ + { 50, FEP_B50 }, + { 75, FEP_B75 }, + { 110, FEP_B110 }, + { 134, FEP_B134 }, + { 150, FEP_B150 }, + { 200, FEP_B200 }, + { 300, FEP_B300 }, + { 600, FEP_B600 }, + { 1200, FEP_B1200 }, + { 1800, FEP_B1800 }, + { 2400, FEP_B2400 }, + { 4800, FEP_B4800 }, + { 9600, FEP_B9600 }, + { 19200, FEP_B19200 }, + { 38400, FEP_B38400 }, + { 57600, (FEP_FASTBAUD|FEP_B50) }, /* B50 & fast baud table */ + { 115200, (FEP_FASTBAUD|FEP_B110) }, /* B100 & fast baud table */ + { -1, -1 } }; static struct dbgflagtbl @@ -1575,7 +1575,7 @@ dgbioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) if(cmd==TIOCSETAW || cmd==TIOCSETAF) port->mustdrain=1; - error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, p); + error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, td); if (error != ENOIOCTL) return error; s = spltty(); diff --git a/sys/platform/pc32/i386/elan-mmcr.c b/sys/platform/pc32/i386/elan-mmcr.c index 362d5f047e..5f548c6820 100644 --- a/sys/platform/pc32/i386/elan-mmcr.c +++ b/sys/platform/pc32/i386/elan-mmcr.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/i386/i386/elan-mmcr.c,v 1.6.2.1 2002/09/17 22:39:53 sam Exp $ - * $DragonFly: src/sys/platform/pc32/i386/elan-mmcr.c,v 1.3 2003/07/21 05:50:39 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/elan-mmcr.c,v 1.4 2003/07/21 07:57:43 dillon Exp $ * The AMD Elan sc520 is a system-on-chip gadget which is used in embedded * kind of things, see www.soekris.com for instance, and it has a few quirks * we need to deal with. @@ -67,7 +67,7 @@ init_AMD_Elan_sc520(void) */ new = 1189161; - i = kernel_sysctlbyname(curproc, "machdep.i8254_freq", + i = kernel_sysctlbyname("machdep.i8254_freq", NULL, 0, &new, sizeof new, NULL); @@ -110,13 +110,13 @@ static struct cdevsw elan_cdevsw = { }; static int -elan_open(dev_t dev, int flag, int mode, struct proc *p) +elan_open(dev_t dev, int flag, int mode, struct thread *td) { return (0); } static int -elan_close(dev_t dev, int flag, int mode, struct proc *p) +elan_close(dev_t dev, int flag, int mode, struct thread *td) { return (0); } @@ -130,7 +130,7 @@ elan_mmap(dev_t dev, vm_offset_t offset, int nprot) } static int -elan_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p) +elan_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) { return(ENOENT); } diff --git a/sys/platform/pc32/i386/initcpu.c b/sys/platform/pc32/i386/initcpu.c index 3ff84682f3..ca38f4c56e 100644 --- a/sys/platform/pc32/i386/initcpu.c +++ b/sys/platform/pc32/i386/initcpu.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/initcpu.c,v 1.19.2.9 2003/04/05 13:47:19 dwmalone Exp $ - * $DragonFly: src/sys/platform/pc32/i386/initcpu.c,v 1.3 2003/07/06 21:23:48 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/initcpu.c,v 1.4 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_cpu.h" @@ -689,7 +689,7 @@ enable_K5_wt_alloc(void) msr=rdmsr(0x83); wrmsr(0x83, msr|0x10); /* enable write allocate */ - enable_intr(); + cpu_enable_intr(); } } @@ -752,7 +752,6 @@ enable_K6_wt_alloc(void) wrmsr(0x0c0000082, whcr); write_eflags(eflags); - enable_intr(); } void @@ -814,7 +813,6 @@ enable_K6_2_wt_alloc(void) wrmsr(0x0c0000082, whcr); write_eflags(eflags); - enable_intr(); } #endif /* I585_CPU && CPU_WT_ALLOC */ diff --git a/sys/platform/pc32/i386/mp_machdep.c b/sys/platform/pc32/i386/mp_machdep.c index 9b3a387079..a4f4e22d13 100644 --- a/sys/platform/pc32/i386/mp_machdep.c +++ b/sys/platform/pc32/i386/mp_machdep.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.115.2.15 2003/03/14 21:22:35 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/i386/mp_machdep.c,v 1.12 2003/07/11 01:23:21 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/mp_machdep.c,v 1.13 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_cpu.h" @@ -458,7 +458,7 @@ init_secondary(void) lldt(_default_ldt); #ifdef USER_LDT - currentldt = _default_ldt; + mdcpu->gd_currentldt = _default_ldt; #endif gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); diff --git a/sys/platform/pc32/i386/sys_machdep.c b/sys/platform/pc32/i386/sys_machdep.c index 79d6300c67..a5e8bb5a78 100644 --- a/sys/platform/pc32/i386/sys_machdep.c +++ b/sys/platform/pc32/i386/sys_machdep.c @@ -32,7 +32,7 @@ * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 * $FreeBSD: src/sys/i386/i386/sys_machdep.c,v 1.47.2.3 2002/10/07 17:20:00 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/i386/sys_machdep.c,v 1.7 2003/06/28 04:16:02 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/sys_machdep.c,v 1.8 2003/07/21 07:57:43 dillon Exp $ * */ @@ -252,7 +252,7 @@ set_user_ldt(struct pcb *pcb) pcb_ldt = pcb->pcb_ldt; #ifdef SMP - gdt[cpuid * NGDT + GUSERLDT_SEL].sd = pcb_ldt->ldt_sd; + gdt[mycpu->gd_cpuid * NGDT + GUSERLDT_SEL].sd = pcb_ldt->ldt_sd; #else gdt[GUSERLDT_SEL].sd = pcb_ldt->ldt_sd; #endif diff --git a/sys/platform/pc32/isa/asc.c b/sys/platform/pc32/isa/asc.c index e763396235..306129dd14 100644 --- a/sys/platform/pc32/isa/asc.c +++ b/sys/platform/pc32/isa/asc.c @@ -35,7 +35,7 @@ */ /* * $FreeBSD: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.4 2003/07/21 05:50:40 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.5 2003/07/21 07:57:44 dillon Exp $ */ #include "asc.h" @@ -544,7 +544,7 @@ ascintr(int unit) ***/ STATIC int -ascopen(dev_t dev, int flags, int fmt, struct proc *p) +ascopen(dev_t dev, int flags, int fmt, struct thread *td) { struct asc_unit *scu; int unit; @@ -639,7 +639,7 @@ asc_startread(struct asc_unit *scu) ***/ STATIC int -ascclose(dev_t dev, int flags, int fmt, struct proc *p) +ascclose(dev_t dev, int flags, int fmt, struct thread *td) { int unit = UNIT(minor(dev)); struct asc_unit *scu = unittab + unit; @@ -786,7 +786,7 @@ ascread(dev_t dev, struct uio *uio, int ioflag) ***/ STATIC int -ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) +ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) { int unit = UNIT(minor(dev)); struct asc_unit *scu = unittab + unit; @@ -851,14 +851,18 @@ ascioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) } STATIC int -ascpoll(dev_t dev, int events, struct proc *p) +ascpoll(dev_t dev, int events, struct thread *td) { int unit = UNIT(minor(dev)); struct asc_unit *scu = unittab + unit; int sps; + struct proc *p; struct proc *p1; int revents = 0; + p = td->td_proc; + KKASSERT(p); + sps=spltty(); if (events & (POLLIN | POLLRDNORM)) { diff --git a/sys/sys/un.h b/sys/sys/un.h index 2b19429fe0..8602241346 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -32,7 +32,7 @@ * * @(#)un.h 8.3 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/un.h,v 1.17.2.1 2002/03/09 05:22:23 dd Exp $ - * $DragonFly: src/sys/sys/un.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/sys/un.h,v 1.3 2003/07/21 07:57:52 dillon Exp $ */ #ifndef _SYS_UN_H_ @@ -53,6 +53,7 @@ struct sockaddr_un { #ifdef _KERNEL struct mbuf; struct socket; +struct sockopt; int uipc_usrreq __P((struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control)); diff --git a/sys/vfs/gnu/ext2fs/ext2_balloc.c b/sys/vfs/gnu/ext2fs/ext2_balloc.c index e87c7e5190..681ef36640 100644 --- a/sys/vfs/gnu/ext2fs/ext2_balloc.c +++ b/sys/vfs/gnu/ext2fs/ext2_balloc.c @@ -38,7 +38,7 @@ * * @(#)ffs_balloc.c 8.4 (Berkeley) 9/23/93 * $FreeBSD: src/sys/gnu/ext2fs/ext2_balloc.c,v 1.9.2.1 2000/08/03 00:52:57 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_balloc.c,v 1.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_balloc.c,v 1.3 2003/07/21 07:57:42 dillon Exp $ */ #include @@ -106,7 +106,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", /* no new block is to be allocated, and no need to expand the file */ if (nb != 0 && ip->i_size >= (bn + 1) * fs->s_blocksize) { - error = bread(vp, bn, fs->s_blocksize, NOCRED, &bp); + error = bread(vp, bn, fs->s_blocksize, &bp); if (error) { brelse(bp); return (error); @@ -121,7 +121,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", osize = fragroundup(fs, blkoff(fs, ip->i_size)); nsize = fragroundup(fs, size); if (nsize <= osize) { - error = bread(vp, bn, osize, NOCRED, &bp); + error = bread(vp, bn, osize, &bp); if (error) { brelse(bp); return (error); @@ -214,7 +214,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", */ for (i = 1;;) { error = bread(vp, - indirs[i].in_lbn, (int)fs->s_blocksize, NOCRED, &bp); + indirs[i].in_lbn, (int)fs->s_blocksize, &bp); if (error) { brelse(bp); return (error); @@ -301,7 +301,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", } brelse(bp); if (flags & B_CLRBUF) { - error = bread(vp, lbn, (int)fs->s_blocksize, NOCRED, &nbp); + error = bread(vp, lbn, (int)fs->s_blocksize, &nbp); if (error) { brelse(nbp); return (error); diff --git a/sys/vfs/gnu/ext2fs/ext2_extern.h b/sys/vfs/gnu/ext2fs/ext2_extern.h index 63c928dbb3..56e2f39a45 100644 --- a/sys/vfs/gnu/ext2fs/ext2_extern.h +++ b/sys/vfs/gnu/ext2fs/ext2_extern.h @@ -38,7 +38,7 @@ * * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_extern.h,v 1.22.6.1 2000/11/05 19:17:40 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_extern.h,v 1.2 2003/06/17 04:28:33 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_extern.h,v 1.3 2003/07/21 07:57:43 dillon Exp $ */ #ifndef _SYS_GNU_EXT2FS_EXT2_EXTERN_H_ @@ -63,7 +63,7 @@ int ext2_init __P((struct vfsconf *)); int ext2_reallocblks __P((struct vop_reallocblks_args *)); int ext2_reclaim __P((struct vop_reclaim_args *)); void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t)); -int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); +int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct thread *)); int ext2_update __P((struct vnode *, int)); int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **)); int ext2_vfree __P((struct vnode *, ino_t, int)); diff --git a/sys/vfs/gnu/ext2fs/ext2_inode.c b/sys/vfs/gnu/ext2fs/ext2_inode.c index ae8aa0216f..30c51728f7 100644 --- a/sys/vfs/gnu/ext2fs/ext2_inode.c +++ b/sys/vfs/gnu/ext2fs/ext2_inode.c @@ -38,7 +38,7 @@ * * @(#)ext2_inode.c 8.5 (Berkeley) 12/30/93 * $FreeBSD: src/sys/gnu/ext2fs/ext2_inode.c,v 1.24.2.1 2000/08/03 00:52:57 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode.c,v 1.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode.c,v 1.3 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_quota.h" @@ -101,7 +101,7 @@ ext2_update(vp, waitfor) fs = ip->i_e2fs; if ((error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->s_blocksize, NOCRED, &bp)) != 0) { + (int)fs->s_blocksize, &bp)) != 0) { brelse(bp); return (error); } @@ -127,12 +127,12 @@ ext2_update(vp, waitfor) * disk blocks. */ int -ext2_truncate(vp, length, flags, cred, p) +ext2_truncate(vp, length, flags, cred, td) struct vnode *vp; off_t length; int flags; struct ucred *cred; - struct proc *p; + struct thread *td; { register struct vnode *ovp = vp; register daddr_t lastblock; @@ -266,7 +266,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks); bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks); oip->i_size = osize; - error = vtruncbuf(ovp, cred, p, length, (int)fs->s_blocksize); + error = vtruncbuf(ovp, td, length, (int)fs->s_blocksize); if (error && (allerror == 0)) allerror = error; diff --git a/sys/vfs/gnu/ext2fs/ext2_linux_balloc.c b/sys/vfs/gnu/ext2fs/ext2_linux_balloc.c index 6e053bfef1..174fca5bce 100644 --- a/sys/vfs/gnu/ext2fs/ext2_linux_balloc.c +++ b/sys/vfs/gnu/ext2fs/ext2_linux_balloc.c @@ -5,7 +5,7 @@ * University of Utah, Department of Computer Science * * $FreeBSD: src/sys/gnu/ext2fs/ext2_linux_balloc.c,v 1.11.2.3 2001/08/14 18:03:19 gallatin Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_linux_balloc.c,v 1.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_linux_balloc.c,v 1.3 2003/07/21 07:57:43 dillon Exp $ */ /* * linux/fs/ext2/balloc.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -68,7 +69,7 @@ static void read_block_bitmap (struct mount * mp, gdp = get_group_desc (mp, block_group, NULL); if ((error = bread (VFSTOUFS(mp)->um_devvp, - fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh)) != 0) + fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, &bh)) != 0) panic ( "read_block_bitmap: " "Cannot read block bitmap - " "block_group = %d, block_bitmap = %lu", diff --git a/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c b/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c index a9b29c0e7f..c076ef506d 100644 --- a/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c +++ b/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c @@ -5,7 +5,7 @@ * University of Utah, Department of Computer Science * * $FreeBSD: src/sys/gnu/ext2fs/ext2_linux_ialloc.c,v 1.13.2.2 2001/08/14 18:03:19 gallatin Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c,v 1.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c,v 1.3 2003/07/21 07:57:43 dillon Exp $ */ /* * linux/fs/ext2/ialloc.c @@ -45,6 +45,7 @@ #include #include #include +#include #ifdef __i386__ #include @@ -106,8 +107,7 @@ static void read_inode_bitmap (struct mount * mp, gdp = get_group_desc (mp, block_group, NULL); if ((error = bread (VFSTOUFS(mp)->um_devvp, fsbtodb(sb, gdp->bg_inode_bitmap), - sb->s_blocksize, - NOCRED, &bh)) != 0) + sb->s_blocksize, &bh)) != 0) panic ( "read_inode_bitmap:" "Cannot read inode bitmap - " "block_group = %lu, inode_bitmap = %lu", diff --git a/sys/vfs/gnu/ext2fs/ext2_lookup.c b/sys/vfs/gnu/ext2fs/ext2_lookup.c index b1eb7e616d..a13014c18a 100644 --- a/sys/vfs/gnu/ext2fs/ext2_lookup.c +++ b/sys/vfs/gnu/ext2fs/ext2_lookup.c @@ -5,7 +5,7 @@ * University of Utah, Department of Computer Science * * $FreeBSD: src/sys/gnu/ext2fs/ext2_lookup.c,v 1.21.2.3 2002/11/17 02:02:42 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_lookup.c,v 1.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_lookup.c,v 1.3 2003/07/21 07:57:43 dillon Exp $ */ /* * Copyright (c) 1989, 1993 @@ -321,7 +321,7 @@ ext2_lookup(ap) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_td; int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->s_blocksize; @@ -501,7 +501,7 @@ searchloop: * Access for write is interpreted as allowing * creation of files in the directory. */ - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) return (error); /* * Return an indication of where the new directory @@ -539,7 +539,7 @@ searchloop: */ cnp->cn_flags |= SAVENAME; if (!lockparent) - VOP_UNLOCK(vdp, 0, p); + VOP_UNLOCK(vdp, 0, td); return (EJUSTRETURN); } /* @@ -583,7 +583,7 @@ found: /* * Write access to directory required to delete files. */ - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) return (error); /* * Return pointer to current entry in dp->i_offset, @@ -617,7 +617,7 @@ found: } *vpp = tdp; if (!lockparent) - VOP_UNLOCK(vdp, 0, p); + VOP_UNLOCK(vdp, 0, td); return (0); } @@ -629,7 +629,7 @@ found: */ if (nameiop == RENAME && wantparent && (flags & ISLASTCN)) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_td)) != 0) return (error); /* * Careful about locking second inode. @@ -642,7 +642,7 @@ found: *vpp = tdp; cnp->cn_flags |= SAVENAME; if (!lockparent) - VOP_UNLOCK(vdp, 0, p); + VOP_UNLOCK(vdp, 0, td); return (0); } @@ -667,13 +667,13 @@ found: */ pdp = vdp; if (flags & ISDOTDOT) { - VOP_UNLOCK(pdp, 0, p); /* race to get the inode */ + VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) { - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); return (error); } if (lockparent && (flags & ISLASTCN) && - (error = vn_lock(pdp, LK_EXCLUSIVE, p))) { + (error = vn_lock(pdp, LK_EXCLUSIVE, td))) { vput(tdp); return (error); } @@ -685,7 +685,7 @@ found: if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) return (error); if (!lockparent || !(flags & ISLASTCN)) - VOP_UNLOCK(pdp, 0, p); + VOP_UNLOCK(pdp, 0, td); *vpp = tdp; } @@ -798,7 +798,7 @@ ext2_direnter(ip, dvp, cnp) auio.uio_iovcnt = 1; auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_procp = (struct proc *)0; + auio.uio_td = NULL; error = VOP_WRITE(dvp, &auio, IO_SYNC, cnp->cn_cred); if (DIRBLKSIZ > VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_bsize) @@ -879,7 +879,7 @@ ext2_direnter(ip, dvp, cnp) dp->i_flag |= IN_CHANGE | IN_UPDATE; if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, - cnp->cn_cred, cnp->cn_proc); + cnp->cn_cred, cnp->cn_td); return (error); } @@ -982,7 +982,7 @@ ext2_dirempty(ip, parentino, cred) for (off = 0; off < ip->i_size; off += dp->rec_len) { error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off, - UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0); + UIO_SYSSPACE, IO_NODELOCKED, cred, &count, NULL); /* * Since we read MINDIRSIZ, residual must * be 0 unless we're at end of file. @@ -1046,7 +1046,7 @@ ext2_checkpath(source, target, cred) } error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED, cred, (int *)0, (struct proc *)0); + IO_NODELOCKED, cred, (int *)0, NULL); if (error != 0) break; namlen = dirbuf.dotdot_type; /* like ufs little-endian */ diff --git a/sys/vfs/gnu/ext2fs/ext2_readwrite.c b/sys/vfs/gnu/ext2fs/ext2_readwrite.c index 0a69c07abe..35c0de6f51 100644 --- a/sys/vfs/gnu/ext2fs/ext2_readwrite.c +++ b/sys/vfs/gnu/ext2fs/ext2_readwrite.c @@ -38,7 +38,7 @@ * * @(#)ufs_readwrite.c 8.7 (Berkeley) 1/21/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_readwrite.c,v 1.18.2.2 2000/12/22 18:44:33 dillon Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.4 2003/06/26 18:34:42 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_readwrite.c,v 1.5 2003/07/21 07:57:43 dillon Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -107,16 +107,16 @@ ext2_read(ap) xfersize = bytesinfile; if (lblktosize(fs, nextlbn) >= ip->i_size) - error = bread(vp, lbn, size, NOCRED, &bp); + error = bread(vp, lbn, size, &bp); else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) error = cluster_read(vp, ip->i_size, lbn, size, uio->uio_resid, (ap->a_ioflag >> 16), &bp); else if (seqcount > 1) { int nextsize = BLKSIZE(fs, ip, nextlbn); error = breadn(vp, lbn, - size, &nextlbn, &nextsize, 1, NOCRED, &bp); + size, &nextlbn, &nextsize, 1, &bp); } else - error = bread(vp, lbn, size, NOCRED, &bp); + error = bread(vp, lbn, size, &bp); if (error) { brelse(bp); bp = NULL; @@ -168,7 +168,7 @@ ext2_write(ap) register struct inode *ip; register FS *fs; struct buf *bp; - struct proc *p; + struct thread *td; daddr_t lbn; off_t osize; int seqcount; @@ -212,11 +212,11 @@ ext2_write(ap) * Maybe this should be above the vnode op call, but so long as * file servers have no limits, I don't think it matters. */ - p = uio->uio_procp; - if (vp->v_type == VREG && p && + td = uio->uio_td; + if (vp->v_type == VREG && td && td->td_proc && uio->uio_offset + uio->uio_resid > - p->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - psignal(p, SIGXFSZ); + td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { + psignal(td->td_proc, SIGXFSZ); return (EFBIG); } @@ -294,7 +294,7 @@ ext2_write(ap) if (error) { if (ioflag & IO_UNIT) { (void)UFS_TRUNCATE(vp, osize, - ioflag & IO_SYNC, ap->a_cred, uio->uio_procp); + ioflag & IO_SYNC, ap->a_cred, uio->uio_td); uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } diff --git a/sys/vfs/gnu/ext2fs/ext2_subr.c b/sys/vfs/gnu/ext2fs/ext2_subr.c index 25a1828317..f8e75e12ff 100644 --- a/sys/vfs/gnu/ext2fs/ext2_subr.c +++ b/sys/vfs/gnu/ext2fs/ext2_subr.c @@ -38,7 +38,7 @@ * * @(#)ext2_subr.c 8.2 (Berkeley) 9/21/93 * $FreeBSD: src/sys/gnu/ext2fs/ext2_subr.c,v 1.13.2.2 2000/08/03 18:48:27 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_subr.c,v 1.2 2003/06/17 04:28:34 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_subr.c,v 1.3 2003/07/21 07:57:43 dillon Exp $ */ #include @@ -84,7 +84,7 @@ ext2_blkatoff(vp, offset, res, bpp) bsize = blksize(fs, ip, lbn); *bpp = NULL; - if ((error = bread(vp, lbn, bsize, NOCRED, &bp)) != 0) { + if ((error = bread(vp, lbn, bsize, &bp)) != 0) { brelse(bp); return (error); } diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index 4a73d4a6d1..e92fe11aff 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vfsops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vfsops.c @@ -38,7 +38,7 @@ * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vfsops.c,v 1.63.2.7 2002/07/01 00:18:51 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.6 2003/07/19 21:14:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.7 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_quota.h" @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -70,16 +71,16 @@ #include static int ext2_fhtovp __P((struct mount *, struct fid *, struct vnode **)); -static int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p)); +static int ext2_flushfiles __P((struct mount *mp, int flags, struct thread *td)); static int ext2_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); -static int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *)); + char *, caddr_t, struct nameidata *, struct thread *)); +static int ext2_mountfs __P((struct vnode *, struct mount *, struct thread *)); static int ext2_reload __P((struct mount *mountp, struct ucred *cred, - struct proc *p)); + struct thread *p)); static int ext2_sbupdate __P((struct ufsmount *, int)); -static int ext2_statfs __P((struct mount *, struct statfs *, struct proc *)); -static int ext2_sync __P((struct mount *, int, struct ucred *, struct proc *)); -static int ext2_unmount __P((struct mount *, int, struct proc *)); +static int ext2_statfs __P((struct mount *, struct statfs *, struct thread *)); +static int ext2_sync __P((struct mount *, int, struct thread *)); +static int ext2_unmount __P((struct mount *, int, struct thread *)); static int ext2_vget __P((struct mount *, ino_t, struct vnode **)); static int ext2_vptofh __P((struct vnode *, struct fid *)); @@ -129,7 +130,7 @@ ext2_mountroot() { register struct ext2_sb_info *fs; register struct mount *mp; - struct proc *p = curproc; + struct thread *td = curthread; struct ufsmount *ump; u_int size; int error; @@ -144,12 +145,12 @@ ext2_mountroot() TAILQ_INIT(&mp->mnt_reservedvnlist); mp->mnt_op = &ext2fs_vfsops; mp->mnt_flag = MNT_RDONLY; - if (error = ext2_mountfs(rootvp, mp, p)) { + if (error = ext2_mountfs(rootvp, mp, td)) { bsd_free(mp, M_MOUNT); return (error); } if (error = vfs_lock(mp)) { - (void)ext2_unmount(mp, 0, p); + (void)ext2_unmount(mp, 0, td); bsd_free(mp, M_MOUNT); return (error); } @@ -165,7 +166,7 @@ ext2_mountroot() (void) copystr(ROOTNAME, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); - (void)ext2_statfs(mp, &mp->mnt_stat, p); + (void)ext2_statfs(mp, &mp->mnt_stat, td); vfs_unlock(mp); inittodr(fs->s_es->s_wtime); /* this helps to set the time */ return (0); @@ -178,12 +179,12 @@ ext2_mountroot() * mount system call */ static int -ext2_mount(mp, path, data, ndp, p) +ext2_mount(mp, path, data, ndp, td) register struct mount *mp; char *path; caddr_t data; /* this is actually a (struct ufs_args *) */ struct nameidata *ndp; - struct proc *p; + struct thread *td; { struct vnode *devvp; struct ufs_args args; @@ -192,9 +193,12 @@ ext2_mount(mp, path, data, ndp, p) size_t size; int error, flags; mode_t accessmode; + struct ucred *cred; if ((error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args))) != 0) return (error); + + cred = td->td_proc->p_ucred; /* * If updating, check whether changing from read-only to * read/write; if there is no device name, that's all we do. @@ -207,10 +211,10 @@ ext2_mount(mp, path, data, ndp, p) flags = WRITECLOSE; if (mp->mnt_flag & MNT_FORCE) flags |= FORCECLOSE; - if (vfs_busy(mp, LK_NOWAIT, 0, p)) + if (vfs_busy(mp, LK_NOWAIT, 0, td)) return (EBUSY); - error = ext2_flushfiles(mp, flags, p); - vfs_unbusy(mp, p); + error = ext2_flushfiles(mp, flags, td); + vfs_unbusy(mp, td); if (!error && fs->s_wasvalid) { fs->s_es->s_state |= EXT2_VALID_FS; ext2_sbupdate(ump, MNT_WAIT); @@ -218,7 +222,7 @@ ext2_mount(mp, path, data, ndp, p) fs->s_rd_only = 1; } if (!error && (mp->mnt_flag & MNT_RELOAD)) - error = ext2_reload(mp, ndp->ni_cnd.cn_cred, p); + error = ext2_reload(mp, ndp->ni_cnd.cn_cred, td); if (error) return (error); devvp = ump->um_devvp; @@ -230,14 +234,14 @@ ext2_mount(mp, path, data, ndp, p) * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. */ - if (p->p_ucred->cr_uid != 0) { - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + if (cred->cr_uid != 0) { + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); if ((error = VOP_ACCESS(devvp, VREAD | VWRITE, - p->p_ucred, p)) != 0) { - VOP_UNLOCK(devvp, 0, p); + cred, td)) != 0) { + VOP_UNLOCK(devvp, 0, td); return (error); } - VOP_UNLOCK(devvp, 0, p); + VOP_UNLOCK(devvp, 0, td); } if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 || @@ -268,7 +272,7 @@ ext2_mount(mp, path, data, ndp, p) * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. */ - NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p); + NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, td); if ((error = namei(ndp)) != 0) return (error); NDFREE(ndp, NDF_ONLY_PNBUF); @@ -283,20 +287,20 @@ ext2_mount(mp, path, data, ndp, p) * If mount by non-root, then verify that user has necessary * permissions on the device. */ - if (p->p_ucred->cr_uid != 0) { + if (cred->cr_uid != 0) { accessmode = VREAD; if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); - if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) { + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + if ((error = VOP_ACCESS(devvp, accessmode, cred, td)) != 0) { vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, p); + VOP_UNLOCK(devvp, 0, td); } if ((mp->mnt_flag & MNT_UPDATE) == 0) { - error = ext2_mountfs(devvp, mp, p); + error = ext2_mountfs(devvp, mp, td); } else { if (devvp != ump->um_devvp) error = EINVAL; /* needs translation */ @@ -316,7 +320,7 @@ ext2_mount(mp, path, data, ndp, p) (void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); - (void)ext2_statfs(mp, &mp->mnt_stat, p); + (void)ext2_statfs(mp, &mp->mnt_stat, td); return (0); } @@ -472,7 +476,7 @@ static int compute_sb_data(devvp, es, fs) for (i = 0; i < db_count; i++) { error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), - fs->s_blocksize, NOCRED, &fs->s_group_desc[i]); + fs->s_blocksize, &fs->s_group_desc[i]); if(error) { for (j = 0; j < i; j++) brelse(fs->s_group_desc[j]); @@ -517,10 +521,10 @@ static int compute_sb_data(devvp, es, fs) * 6) re-read inode data for all active vnodes. */ static int -ext2_reload(mountp, cred, p) +ext2_reload(mountp, cred, td) register struct mount *mountp; struct ucred *cred; - struct proc *p; + struct thread *td; { register struct vnode *vp, *nvp, *devvp; struct inode *ip; @@ -536,13 +540,13 @@ ext2_reload(mountp, cred, p) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOUFS(mountp)->um_devvp; - if (vinvalbuf(devvp, 0, p, 0, 0)) + if (vinvalbuf(devvp, 0, td, 0, 0)) panic("ext2_reload: dirty1"); /* * Step 2: re-read superblock from disk. * constants have been adjusted for ext2 */ - if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0) + if ((error = bread(devvp, SBLOCK, SBSIZE, &bp)) != 0) return (error); es = (struct ext2_super_block *)bp->b_data; if (ext2_check_sb_compat(es, devvp->v_rdev, 0) != 0) { @@ -570,7 +574,7 @@ loop: /* * Step 4: invalidate all inactive vnodes. */ - if (vrecycle(vp, NULL, p)) { + if (vrecycle(vp, NULL, td)) { lwkt_gentoken(&mntvnode_token, &gen); goto loop; } @@ -582,11 +586,11 @@ loop: lwkt_reltoken(&vp->v_interlock); goto loop; } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { lwkt_gentoken(&mntvnode_token, &gen); goto loop; } - if (vinvalbuf(vp, 0, p, 0, 0)) + if (vinvalbuf(vp, 0, td, 0, 0)) panic("ext2_reload: dirty2"); /* * Step 6: re-read inode data for all active vnodes. @@ -594,7 +598,7 @@ loop: ip = VTOI(vp); error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->s_blocksize, NOCRED, &bp); + (int)fs->s_blocksize, &bp); if (error) { vput(vp); lwkt_reltoken(&mntvnode_token); @@ -616,10 +620,10 @@ loop: * Common code for mount and mountroot */ static int -ext2_mountfs(devvp, mp, p) +ext2_mountfs(devvp, mp, td) register struct vnode *devvp; struct mount *mp; - struct proc *p; + struct thread *td; { register struct ufsmount *ump; struct buf *bp; @@ -641,7 +645,7 @@ ext2_mountfs(devvp, mp, p) return (error); if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); - if ((error = vinvalbuf(devvp, V_SAVE, p, 0, 0)) != 0) + if ((error = vinvalbuf(devvp, V_SAVE, td, 0, 0)) != 0) return (error); #ifdef READONLY /* turn on this to force it to be read-only */ @@ -649,16 +653,16 @@ ext2_mountfs(devvp, mp, p) #endif ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); - VOP_UNLOCK(devvp, 0, p); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td); + VOP_UNLOCK(devvp, 0, td); if (error) return (error); if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, p) != 0) + if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, td) != 0) size = DEV_BSIZE; else { havepart = 1; @@ -667,7 +671,7 @@ ext2_mountfs(devvp, mp, p) bp = NULL; ump = NULL; - if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0) + if ((error = bread(devvp, SBLOCK, SBSIZE, &bp)) != 0) goto out; es = (struct ext2_super_block *)bp->b_data; if (ext2_check_sb_compat(es, dev, ronly) != 0) { @@ -744,7 +748,7 @@ ext2_mountfs(devvp, mp, p) out: if (bp) brelse(bp); - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, td); if (ump) { bsd_free(ump->um_e2fs->s_es, M_UFSMNT); bsd_free(ump->um_e2fs, M_UFSMNT); @@ -758,10 +762,10 @@ out: * unmount system call */ static int -ext2_unmount(mp, mntflags, p) +ext2_unmount(mp, mntflags, td) struct mount *mp; int mntflags; - struct proc *p; + struct thread *td; { register struct ufsmount *ump; register struct ext2_sb_info *fs; @@ -773,7 +777,7 @@ ext2_unmount(mp, mntflags, p) return (EINVAL); flags |= FORCECLOSE; } - if ((error = ext2_flushfiles(mp, flags, p)) != 0) + if ((error = ext2_flushfiles(mp, flags, td)) != 0) return (error); ump = VFSTOUFS(mp); fs = ump->um_e2fs; @@ -799,8 +803,7 @@ ext2_unmount(mp, mntflags, p) ULCK_BUF(fs->s_block_bitmap[i]) ump->um_devvp->v_specmountpoint = NULL; - error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE, - NOCRED, p); + error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE, td); vrele(ump->um_devvp); bsd_free(fs->s_es, M_UFSMNT); bsd_free(fs, M_UFSMNT); @@ -814,10 +817,10 @@ ext2_unmount(mp, mntflags, p) * Flush out all the files in a filesystem. */ static int -ext2_flushfiles(mp, flags, p) +ext2_flushfiles(mp, flags, td) register struct mount *mp; int flags; - struct proc *p; + struct thread *td; { register struct ufsmount *ump; int error; @@ -833,7 +836,7 @@ ext2_flushfiles(mp, flags, p) for (i = 0; i < MAXQUOTAS; i++) { if (ump->um_quotas[i] == NULLVP) continue; - quotaoff(p, mp, i); + quotaoff(td, mp, i); } /* * Here we fall through to vflush again to ensure @@ -850,10 +853,10 @@ ext2_flushfiles(mp, flags, p) * taken from ext2/super.c ext2_statfs */ static int -ext2_statfs(mp, sbp, p) +ext2_statfs(mp, sbp, td) struct mount *mp; register struct statfs *sbp; - struct proc *p; + struct thread *td; { unsigned long overhead; register struct ufsmount *ump; @@ -909,11 +912,10 @@ ext2_statfs(mp, sbp, p) * Note: we are always called with the filesystem marked `MPBUSY'. */ static int -ext2_sync(mp, waitfor, cred, p) +ext2_sync(mp, waitfor, td) struct mount *mp; int waitfor; - struct ucred *cred; - struct proc *p; + struct thread *td; { struct vnode *nvp, *vp; struct inode *ip; @@ -955,15 +957,15 @@ loop: lwkt_reltoken(&vp->v_interlock); continue; } - error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p); + error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td); if (error) { if (error == ENOENT) goto loop; continue; } - if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0) + if ((error = VOP_FSYNC(vp, waitfor, td)) != 0) allerror = error; - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); vrele(vp); lwkt_gentoken(&mntvnode_token, &gen); } @@ -972,10 +974,10 @@ loop: * Force stale file system control information to be flushed. */ if (waitfor != MNT_LAZY) { - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); - if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, p)) != 0) + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); + if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) allerror = error; - VOP_UNLOCK(ump->um_devvp, 0, p); + VOP_UNLOCK(ump->um_devvp, 0, td); } #if QUOTA qsync(mp); @@ -1079,7 +1081,7 @@ restart: printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); #endif if ((error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), - (int)fs->s_blocksize, NOCRED, &bp)) != 0) { + (int)fs->s_blocksize, &bp)) != 0) { /* * The inode does not contain anything useful, so it would * be misleading to leave it on its hash chain. With mode diff --git a/sys/vfs/gnu/ext2fs/ext2_vnops.c b/sys/vfs/gnu/ext2fs/ext2_vnops.c index 015d997f1e..9f829bd389 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vnops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vnops.c @@ -44,7 +44,7 @@ * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 * @(#)ext2_vnops.c 8.7 (Berkeley) 2/3/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vnops.c,v 1.51.2.2 2003/01/02 17:26:18 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.4 2003/07/19 21:14:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.5 2003/07/21 07:57:43 dillon Exp $ */ #include "opt_quota.h" @@ -66,6 +66,7 @@ #include #include #include +#include #include #include @@ -339,7 +340,7 @@ ext2_link(ap) struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; struct componentname *cnp = ap->a_cnp; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_td; struct inode *ip; int error; @@ -351,7 +352,7 @@ ext2_link(ap) error = EXDEV; goto out2; } - if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) { + if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) { goto out2; } ip = VTOI(vp); @@ -374,7 +375,7 @@ ext2_link(ap) } out1: if (tdvp != vp) - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); out2: return (error); } @@ -400,7 +401,7 @@ ext2_rename(ap) struct vnode *fdvp = ap->a_fdvp; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; - struct proc *p = fcnp->cn_proc; + struct thread *td = fcnp->cn_td; struct inode *ip, *xp, *dp; struct dirtemplate dirbuf; int doingdirectory = 0, oldparent = 0, newparent = 0; @@ -446,18 +447,18 @@ abortit: goto abortit; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE, td)) != 0) goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); if (ip->i_nlink >= LINK_MAX) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); error = EMLINK; goto abortit; } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); error = EPERM; goto abortit; } @@ -468,7 +469,7 @@ abortit: if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') || dp == ip || (fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT || (ip->i_flag & IN_RENAME)) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); error = EINVAL; goto abortit; } @@ -496,7 +497,7 @@ abortit: ip->i_nlink++; ip->i_flag |= IN_CHANGE; if ((error = UFS_UPDATE(fvp, 1)) != 0) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); goto bad; } @@ -510,8 +511,8 @@ abortit: * to namei, as the parent directory is unlocked by the * call to checkpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); - VOP_UNLOCK(fvp, 0, p); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_td); + VOP_UNLOCK(fvp, 0, td); if (oldparent != dp->i_number) newparent = dp->i_number; if (doingdirectory && newparent) { @@ -637,7 +638,7 @@ abortit: if (--xp->i_nlink != 0) panic("ufs_rename: linked directory"); error = UFS_TRUNCATE(tvp, (off_t)0, IO_SYNC, - tcnp->cn_cred, tcnp->cn_proc); + tcnp->cn_cred, tcnp->cn_td); } xp->i_flag |= IN_CHANGE; vput(tvp); @@ -691,7 +692,7 @@ abortit: error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED, - tcnp->cn_cred, (int *)0, (struct proc *)0); + tcnp->cn_cred, (int *)0, NULL); if (error == 0) { /* Like ufs little-endian: */ namlen = dirbuf.dotdot_type; @@ -708,7 +709,7 @@ abortit: (off_t)0, UIO_SYSSPACE, IO_NODELOCKED|IO_SYNC, tcnp->cn_cred, (int *)0, - (struct proc *)0); + NULL); cache_purge(fdvp); } } @@ -734,7 +735,7 @@ bad: out: if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, p) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) { ip->i_nlink--; ip->i_flag |= IN_CHANGE; ip->i_flag &= ~IN_RENAME; @@ -879,7 +880,7 @@ ext2_mkdir(ap) dirtemplate.dotdot_reclen = DIRBLKSIZ - 12; error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate, sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0, (struct proc *)0); + IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0, NULL); if (error) { dp->i_nlink--; dp->i_flag |= IN_CHANGE; @@ -929,7 +930,7 @@ ext2_rmdir(ap) struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; struct componentname *cnp = ap->a_cnp; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_td; struct inode *ip, *dp; int error; @@ -964,7 +965,7 @@ ext2_rmdir(ap) dp->i_nlink--; dp->i_flag |= IN_CHANGE; cache_purge(dvp); - VOP_UNLOCK(dvp, 0, p); + VOP_UNLOCK(dvp, 0, td); /* * Truncate inode. The only stuff left * in the directory is "." and "..". The @@ -977,9 +978,9 @@ ext2_rmdir(ap) * worry about them later. */ ip->i_nlink -= 2; - error = UFS_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred, p); + error = UFS_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred, td); cache_purge(ITOV(ip)); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); out: return (error); } @@ -1015,7 +1016,7 @@ ext2_symlink(ap) } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, (int *)0, - (struct proc *)0); + NULL); if (error) vput(vp); return (error); diff --git a/sys/vfs/nfs/bootp_subr.c b/sys/vfs/nfs/bootp_subr.c index 5a2785be35..fac7c58b17 100644 --- a/sys/vfs/nfs/bootp_subr.c +++ b/sys/vfs/nfs/bootp_subr.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/nfs/bootp_subr.c,v 1.20.2.9 2003/04/24 16:51:08 ambrisko Exp $ */ -/* $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.3 2003/07/19 21:14:45 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.4 2003/07/21 07:57:51 dillon Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -216,18 +216,17 @@ struct bootpc_globalcontext { extern int nfs_diskless_valid; extern struct nfsv3_diskless nfsv3_diskless; static char bootp_cookie[128]; -SYSCTL_DECL(_kern); SYSCTL_STRING(_kern, OID_AUTO, bootp_cookie, CTLFLAG_RD, bootp_cookie, 0, "Cookie (T134) supplied by bootp server"); /* mountd RPC */ static int md_mount(struct sockaddr_in *mdsin, char *path, u_char *fhp, int *fhsizep, - struct nfs_args *args,struct proc *procp); + struct nfs_args *args,struct thread *td); static int md_lookup_swap(struct sockaddr_in *mdsin,char *path, u_char *fhp, int *fhsizep, struct nfs_args *args, - struct proc *procp); + struct thread *td); static int setfs(struct sockaddr_in *addr, char *path, char *p); static int getdec(char **ptr); static char *substr(char *a,char *b); @@ -241,7 +240,7 @@ static struct bootpc_ifcontext *allocifctx(struct bootpc_globalcontext *gctx); static void bootpc_compose_query(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, - struct proc *procp); + struct thread *td); static unsigned char *bootpc_tag(struct bootpc_tagcontext *tctx, struct bootp_packet *bp, int len, int tag); static void bootpc_tag_helper(struct bootpc_tagcontext *tctx, @@ -258,15 +257,15 @@ void bootpboot_p_iflist(void); #endif static int bootpc_call(struct bootpc_globalcontext *gctx, - struct proc *procp); + struct thread *td); static int bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, - struct proc *procp); + struct thread *td); static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, - struct proc *procp); + struct thread *td); static void bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, @@ -591,7 +590,7 @@ bootpc_received(struct bootpc_globalcontext *gctx, static int bootpc_call(struct bootpc_globalcontext *gctx, - struct proc *procp) + struct thread *td) { struct socket *so; struct sockaddr_in *sin, dst; @@ -611,7 +610,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, /* * Create socket and set its recieve timeout. */ - error = socreate(AF_INET, &so, SOCK_DGRAM, 0, procp); + error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td); if (error != 0) goto out; @@ -658,7 +657,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, sin = &dst; clear_sinaddr(sin); sin->sin_port = htons(IPPORT_BOOTPC); - error = sobind(so, (struct sockaddr *)sin, procp); + error = sobind(so, (struct sockaddr *)sin, td); if (error != 0) { printf("bind failed\n"); goto out; @@ -716,7 +715,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, (ifctx->state == IF_BOOTP_UNRESOLVED && ifctx->dhcpquerytype != DHCP_NOMSG)) { ifctx->sentmsg = 0; - bootpc_compose_query(ifctx, gctx, procp); + bootpc_compose_query(ifctx, gctx, td); } /* Send BOOTP request (or re-send). */ @@ -753,21 +752,21 @@ bootpc_call(struct bootpc_globalcontext *gctx, auio.uio_rw = UIO_WRITE; auio.uio_offset = 0; auio.uio_resid = sizeof(ifctx->call); - auio.uio_procp = procp; + auio.uio_td = td; /* Set netmask to 0.0.0.0 */ sin = (struct sockaddr_in *) &ifctx->ireq.ifr_addr; clear_sinaddr(sin); error = ifioctl(ifctx->so, SIOCSIFNETMASK, - (caddr_t) &ifctx->ireq, procp); + (caddr_t) &ifctx->ireq, td); if (error != 0) panic("bootpc_call:" "set if netmask, error=%d", error); error = sosend(so, (struct sockaddr *) &dst, - &auio, NULL, NULL, 0, procp); + &auio, NULL, NULL, 0, td); if (error != 0) { printf("bootpc_call: sosend: %d state %08x\n", error, (int) so->so_state); @@ -782,7 +781,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, clear_sinaddr(sin); sin->sin_addr.s_addr = htonl(0xff000000u); error = ifioctl(ifctx->so, SIOCSIFNETMASK, - (caddr_t) &ifctx->ireq, procp); + (caddr_t) &ifctx->ireq, td); if (error != 0) panic("bootpc_call:" "set if netmask, error=%d", @@ -820,7 +819,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, auio.uio_rw = UIO_READ; auio.uio_offset = 0; auio.uio_resid = sizeof(gctx->reply); - auio.uio_procp = procp; + auio.uio_td = td; rcvflg = 0; error = soreceive(so, NULL, &auio, @@ -989,7 +988,7 @@ out: static int bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, - struct proc *procp) + struct thread *td) { struct sockaddr_in *sin; int error; @@ -999,7 +998,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct ifaddr *ifa; struct sockaddr_dl *sdl; - error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, procp); + error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, td); if (error != 0) panic("nfs_boot: socreate, error=%d", error); @@ -1012,11 +1011,11 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, * Get the old interface flags and or IFF_UP into them; if * IFF_UP set blindly, interface selection can be clobbered. */ - error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp); + error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, td); if (error != 0) panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error); ireq->ifr_flags |= IFF_UP; - error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp); + error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, td); if (error != 0) panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error); @@ -1029,7 +1028,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, sin = (struct sockaddr_in *) &ireq->ifr_addr; clear_sinaddr(sin); - error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, procp); + error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, td); if (error != 0 && (error != EEXIST || ifctx == gctx->interfaces)) panic("bootpc_fakeup_interface: " "set if addr, error=%d", error); @@ -1039,7 +1038,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, sin = (struct sockaddr_in *) &ireq->ifr_addr; clear_sinaddr(sin); sin->sin_addr.s_addr = htonl(0xff000000u); - error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, procp); + error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)ireq, td); if (error != 0) panic("bootpc_fakeup_interface: set if netmask, error=%d", error); @@ -1052,7 +1051,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, sin->sin_addr.s_addr = htonl(INADDR_BROADCAST); ifctx->broadcast.sin_addr.s_addr = sin->sin_addr.s_addr; - error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, procp); + error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t)ireq, td); if (error != 0 && error != EADDRNOTAVAIL) panic("bootpc_fakeup_interface: " "set if broadcast addr, error=%d", @@ -1082,7 +1081,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx, - struct proc *procp) + struct thread *td) { int error; struct sockaddr_in defdst; @@ -1106,19 +1105,19 @@ bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, /* Shutdown interfaces where BOOTP failed */ printf("Shutdown interface %s\n", ifctx->ireq.ifr_name); - error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, procp); + error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)ireq, td); if (error != 0) panic("bootpc_adjust_interface: " "SIOCGIFFLAGS, error=%d", error); ireq->ifr_flags &= ~IFF_UP; - error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, procp); + error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)ireq, td); if (error != 0) panic("bootpc_adjust_interface: " "SIOCSIFFLAGS, error=%d", error); sin = (struct sockaddr_in *) &ireq->ifr_addr; clear_sinaddr(sin); - error = ifioctl(so, SIOCDIFADDR, (caddr_t) ireq, procp); + error = ifioctl(so, SIOCDIFADDR, (caddr_t) ireq, td); if (error != 0 && (error != EADDRNOTAVAIL || ifctx == gctx->interfaces)) panic("bootpc_adjust_interface: " @@ -1133,7 +1132,7 @@ bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, * can talk to the servers. (just set the address) */ bcopy(netmask, &ireq->ifr_addr, sizeof(*netmask)); - error = ifioctl(so, SIOCSIFNETMASK, (caddr_t) ireq, procp); + error = ifioctl(so, SIOCSIFNETMASK, (caddr_t) ireq, td); if (error != 0) panic("bootpc_adjust_interface: " "set if netmask, error=%d", error); @@ -1144,13 +1143,13 @@ bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, clear_sinaddr(sin); sin->sin_addr.s_addr = myaddr->sin_addr.s_addr | ~ netmask->sin_addr.s_addr; - error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t) ireq, procp); + error = ifioctl(so, SIOCSIFBRDADDR, (caddr_t) ireq, td); if (error != 0) panic("bootpc_adjust_interface: " "set if broadcast addr, error=%d", error); bcopy(myaddr, &ireq->ifr_addr, sizeof(*myaddr)); - error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, procp); + error = ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, td); if (error != 0 && (error != EEXIST || ifctx == gctx->interfaces)) panic("bootpc_adjust_interface: " "set if addr, error=%d", error); @@ -1337,10 +1336,10 @@ print_in_addr(struct in_addr addr) } static void -bootpc_compose_query(ifctx, gctx, procp) +bootpc_compose_query(ifctx, gctx, td) struct bootpc_ifcontext *ifctx; struct bootpc_globalcontext *gctx; - struct proc *procp; + struct thread *td; { unsigned char *vendp; unsigned char vendor_client[64]; @@ -1699,10 +1698,10 @@ bootpc_init(void) struct ifnet *ifp; int error; struct nfsv3_diskless *nd; - struct proc *procp; + struct thread *td; nd = &nfsv3_diskless; - procp = curproc; + td = curthread; /* * If already filled in, don't touch it here @@ -1774,13 +1773,13 @@ bootpc_init(void) gctx->gotgw = 0; for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next) - bootpc_fakeup_interface(ifctx, gctx, procp); + bootpc_fakeup_interface(ifctx, gctx, td); for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next) - bootpc_compose_query(ifctx, gctx, procp); + bootpc_compose_query(ifctx, gctx, td); ifctx = gctx->interfaces; - error = bootpc_call(gctx, procp); + error = bootpc_call(gctx, td); if (error != 0) { #ifdef BOOTP_NFSROOT @@ -1806,7 +1805,7 @@ bootpc_init(void) #endif for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next) { - bootpc_adjust_interface(ifctx, gctx, procp); + bootpc_adjust_interface(ifctx, gctx, td); soclose(ifctx->so); } @@ -1828,7 +1827,7 @@ bootpc_init(void) error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, - &nd->root_args, procp); + &nd->root_args, td); if (error != 0) panic("nfs_boot: mountd root, error=%d", error); @@ -1837,7 +1836,7 @@ bootpc_init(void) error = md_mount(&nd->swap_saddr, nd->swap_hostnam, nd->swap_fh, &nd->swap_fhsize, - &nd->swap_args, procp); + &nd->swap_args, td); if (error != 0) panic("nfs_boot: mountd swap, error=%d", error); @@ -1845,7 +1844,7 @@ bootpc_init(void) error = md_lookup_swap(&nd->swap_saddr, gctx->lookup_path, nd->swap_fh, &nd->swap_fhsize, - &nd->swap_args, procp); + &nd->swap_args, td); if (error != 0) panic("nfs_boot: lookup swap, error=%d", error); @@ -1881,7 +1880,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */ u_char *fhp, int *fhsizep, struct nfs_args *args, - struct proc *procp) + struct thread *td) { struct mbuf *m; int error; @@ -1893,13 +1892,13 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */ /* First try NFS v3 */ /* Get port number for MOUNTD. */ error = krpc_portmap(mdsin, RPCPROG_MNT, RPCMNT_VER3, - &mdsin->sin_port, procp); + &mdsin->sin_port, td); if (error == 0) { m = xdr_string_encode(path, strlen(path)); /* Do RPC to mountd. */ error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER3, - RPCMNT_MOUNT, &m, NULL, procp); + RPCMNT_MOUNT, &m, NULL, td); } if (error == 0) { args->flags |= NFSMNT_NFSV3; @@ -1909,7 +1908,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */ /* Get port number for MOUNTD. */ error = krpc_portmap(mdsin, RPCPROG_MNT, RPCMNT_VER1, - &mdsin->sin_port, procp); + &mdsin->sin_port, td); if (error != 0) return error; @@ -1917,7 +1916,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */ /* Do RPC to mountd. */ error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER1, - RPCMNT_MOUNT, &m, NULL, procp); + RPCMNT_MOUNT, &m, NULL, td); if (error != 0) return error; /* message already freed */ @@ -1960,7 +1959,7 @@ md_mount(struct sockaddr_in *mdsin, /* mountd server address */ error = krpc_portmap(mdsin, NFS_PROG, (args->flags & NFSMNT_NFSV3) ? NFS_VER3 : NFS_VER2, - &mdsin->sin_port, procp); + &mdsin->sin_port, td); goto out; @@ -1979,7 +1978,7 @@ md_lookup_swap(struct sockaddr_in *mdsin, /* mountd server address */ u_char *fhp, int *fhsizep, struct nfs_args *args, - struct proc *procp) + struct thread *td) { struct mbuf *m; int error; @@ -2013,10 +2012,10 @@ md_lookup_swap(struct sockaddr_in *mdsin, /* mountd server address */ /* Do RPC to nfsd. */ if ((args->flags & NFSMNT_NFSV3) != 0) error = krpc_call(mdsin, NFS_PROG, NFS_VER3, - NFSPROC_LOOKUP, &m, NULL, procp); + NFSPROC_LOOKUP, &m, NULL, td); else error = krpc_call(mdsin, NFS_PROG, NFS_VER2, - NFSV2PROC_LOOKUP, &m, NULL, procp); + NFSV2PROC_LOOKUP, &m, NULL, td); if (error != 0) return error; /* message already freed */ diff --git a/sys/vfs/nfs/krpc_subr.c b/sys/vfs/nfs/krpc_subr.c index 74911cfc06..6d0f5e7031 100644 --- a/sys/vfs/nfs/krpc_subr.c +++ b/sys/vfs/nfs/krpc_subr.c @@ -1,6 +1,6 @@ /* $NetBSD: krpc_subr.c,v 1.12.4.1 1996/06/07 00:52:26 cgd Exp $ */ /* $FreeBSD: src/sys/nfs/krpc_subr.c,v 1.13.2.1 2000/11/20 21:17:14 tegge Exp $ */ -/* $DragonFly: src/sys/vfs/nfs/krpc_subr.c,v 1.2 2003/06/17 04:28:54 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/nfs/krpc_subr.c,v 1.3 2003/07/21 07:57:51 dillon Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -125,11 +125,11 @@ struct rpc_reply { * Returns non-zero error on failure. */ int -krpc_portmap(sin, prog, vers, portp, procp) +krpc_portmap(sin, prog, vers, portp, td) struct sockaddr_in *sin; /* server address */ u_int prog, vers; /* host order */ u_int16_t *portp; /* network order */ - struct proc *procp; + struct thread *td; { struct sdata { u_int32_t prog; /* call program */ @@ -164,7 +164,7 @@ krpc_portmap(sin, prog, vers, portp, procp) sin->sin_port = htons(PMAPPORT); error = krpc_call(sin, PMAPPROG, PMAPVERS, - PMAPPROC_GETPORT, &m, NULL, procp); + PMAPPROC_GETPORT, &m, NULL, td); if (error) return error; @@ -186,12 +186,12 @@ krpc_portmap(sin, prog, vers, portp, procp) * the address from whence the response came is saved there. */ int -krpc_call(sa, prog, vers, func, data, from_p, procp) +krpc_call(sa, prog, vers, func, data, from_p, td) struct sockaddr_in *sa; u_int prog, vers, func; struct mbuf **data; /* input/output */ struct sockaddr **from_p; /* output */ - struct proc *procp; + struct thread *td; { struct socket *so; struct sockaddr_in *sin, ssin; @@ -221,7 +221,7 @@ krpc_call(sa, prog, vers, func, data, from_p, procp) /* * Create socket and set its recieve timeout. */ - if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, procp))) + if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td))) goto out; tv.tv_sec = 1; @@ -261,7 +261,7 @@ krpc_call(sa, prog, vers, func, data, from_p, procp) do { tport--; sin->sin_port = htons(tport); - error = sobind(so, (struct sockaddr *)sin, procp); + error = sobind(so, (struct sockaddr *)sin, td); } while (error == EADDRINUSE && tport > IPPORT_RESERVED / 2); if (error) { @@ -322,7 +322,7 @@ krpc_call(sa, prog, vers, func, data, from_p, procp) goto out; } error = sosend(so, (struct sockaddr *)sa, NULL, m, - NULL, 0, procp); + NULL, 0, td); if (error) { printf("krpc_call: sosend: %d\n", error); goto out; diff --git a/sys/vfs/nfs/nfs_bio.c b/sys/vfs/nfs/nfs_bio.c index 47b469036b..486bfaaae7 100644 --- a/sys/vfs/nfs/nfs_bio.c +++ b/sys/vfs/nfs/nfs_bio.c @@ -35,7 +35,7 @@ * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nfs_bio.c,v 1.83.2.4 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.7 2003/07/19 21:14:45 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_bio.c,v 1.8 2003/07/21 07:57:51 dillon Exp $ */ @@ -738,7 +738,7 @@ nfs_write(ap) #ifdef DIAGNOSTIC if (uio->uio_rw != UIO_WRITE) panic("nfs_write mode"); - if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc) + if (uio->uio_segflg == UIO_USERSPACE && uio->uio_td != curthread) panic("nfs_write proc"); #endif if (vp->v_type != VREG) -- 2.41.0