Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/gehenna-devsw]: src/sys/compat Replace the direct-access to devsw table ...



details:   https://anonhg.NetBSD.org/src/rev/3083e370bf2b
branches:  gehenna-devsw
changeset: 527051:3083e370bf2b
user:      gehenna <gehenna%NetBSD.org@localhost>
date:      Thu May 16 04:29:37 2002 +0000

description:
Replace the direct-access to devsw table with calling devsw API.

diffstat:

 sys/compat/irix/irix_fcntl.c          |   7 ++++---
 sys/compat/linux/common/linux_ioctl.c |  12 ++++++------
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (76 lines):

diff -r 2099ca025b25 -r 3083e370bf2b sys/compat/irix/irix_fcntl.c
--- a/sys/compat/irix/irix_fcntl.c      Thu May 16 04:28:13 2002 +0000
+++ b/sys/compat/irix/irix_fcntl.c      Thu May 16 04:29:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_fcntl.c,v 1.7 2002/05/04 07:45:07 manu Exp $ */
+/*     $NetBSD: irix_fcntl.c,v 1.7.2.1 2002/05/16 04:30:50 gehenna Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.7 2002/05/04 07:45:07 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.7.2.1 2002/05/16 04:30:50 gehenna Exp $");
 
 #include <sys/types.h>
 #include <sys/signal.h>
@@ -267,6 +267,7 @@
                syscallarg(int) fd;
                syscallarg(int) mode;
        } */ *uap = v;
+       extern const struct cdevsw irix_usema_cdevsw;
        struct sys_fchmod_args cup;
        struct file *fp;
        int error;
@@ -291,7 +292,7 @@
                major = major(vp->v_specinfo->si_rdev);
                minor = minor(vp->v_specinfo->si_rdev);
                /* XXX is there a better way to identify a given driver ? */
-               if (cdevsw[major].d_open == *irix_usemaopen &&
+               if (major == cdevsw_lookup_major(&irix_usema_cdevsw) &&
                    minor == IRIX_USEMACLNDEV_MINOR)
                        error = 0;
        }
diff -r 2099ca025b25 -r 3083e370bf2b sys/compat/linux/common/linux_ioctl.c
--- a/sys/compat/linux/common/linux_ioctl.c     Thu May 16 04:28:13 2002 +0000
+++ b/sys/compat/linux/common/linux_ioctl.c     Thu May 16 04:29:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_ioctl.c,v 1.28 2001/11/13 02:08:53 lukem Exp $   */
+/*     $NetBSD: linux_ioctl.c,v 1.28.8.1 2002/05/16 04:29:37 gehenna Exp $     */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.28 2001/11/13 02:08:53 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.28.8.1 2002/05/16 04:29:37 gehenna Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "sequencer.h"
@@ -113,18 +113,18 @@
                struct filedesc *fdp;
                struct vnode *vp;
                struct vattr va;
-               extern int sequencerioctl 
-                       __P((dev_t, u_long, caddr_t, int, struct proc *));
+               extern const struct cdevsw sequencer_cdevsw;
+               const struct cdevsw *cdev;
 
                fdp = p->p_fd;
+               cdev = cdevsw_lookup(va.va_rdev);
                if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
                        return EBADF;
                if (fp->f_type == DTYPE_VNODE &&
                    (vp = (struct vnode *)fp->f_data) != NULL &&
                    vp->v_type == VCHR &&
                    VOP_GETATTR(vp, &va, p->p_ucred, p) == 0 &&
-                   major(va.va_rdev) < nchrdev &&
-                   cdevsw[major(va.va_rdev)].d_ioctl == &sequencerioctl)
+                   cdev == &sequencer_cdevsw)
                        return oss_ioctl_sequencer(p, (void*)LINUX_TO_OSS(uap),
                                                   retval);
                else



Home | Main Index | Thread Index | Old Index