Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/mach Make io_iterator_reset working for device cl...



details:   https://anonhg.NetBSD.org/src/rev/a4fd2b945547
branches:  trunk
changeset: 546505:a4fd2b945547
user:      manu <manu%NetBSD.org@localhost>
date:      Wed Apr 30 18:38:19 2003 +0000

description:
Make io_iterator_reset working for device class itaerators

diffstat:

 sys/compat/mach/mach_iokit.c |  18 ++++++++++++++----
 sys/compat/mach/mach_port.h  |   3 ++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diffs (66 lines):

diff -r bc34c084e574 -r a4fd2b945547 sys/compat/mach/mach_iokit.c
--- a/sys/compat/mach/mach_iokit.c      Wed Apr 30 18:31:30 2003 +0000
+++ b/sys/compat/mach/mach_iokit.c      Wed Apr 30 18:38:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_iokit.c,v 1.13 2003/04/30 18:05:47 manu Exp $ */
+/*     $NetBSD: mach_iokit.c,v 1.14 2003/04/30 18:38:19 manu Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include "opt_compat_darwin.h"
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_iokit.c,v 1.13 2003/04/30 18:05:47 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_iokit.c,v 1.14 2003/04/30 18:38:19 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -132,7 +132,7 @@
        switch (mr->mr_port->mp_datatype) {
        case MACH_MP_IOKIT_DEVCLASS:
                /* Do not come here again */
-               mr->mr_port->mp_datatype = MACH_MP_NONE;
+               mr->mr_port->mp_datatype = MACH_MP_IOKIT_DEVCLASS_DONE;
 
                mp = mach_port_get();
                mp->mp_flags |= MACH_MP_INKERNEL;
@@ -782,10 +782,20 @@
        if ((mr = mach_right_check(mn, l, MACH_PORT_TYPE_ALL_RIGHTS)) == NULL)
                return mach_iokit_error(args, MACH_IOKIT_EPERM);
        
-       if (mr->mr_port->mp_datatype == MACH_MP_DEVICE_ITERATOR) {
+       switch(mr->mr_port->mp_datatype) {
+       case MACH_MP_DEVICE_ITERATOR:
                mdi = mr->mr_port->mp_data;
                mdi->mdi_parent = mr->mr_port->mp_data;
                mdi->mdi_current = TAILQ_FIRST(&alldevs);
+               break;
+       
+       case MACH_MP_IOKIT_DEVCLASS_DONE:
+               mr->mr_port->mp_datatype = MACH_MP_IOKIT_DEVCLASS;
+               break;
+
+       case MACH_MP_IOKIT_DEVCLASS:
+       default:
+               printf("mach_io_iterator_reset: unknown type\n");
        }
 
        rep->rep_msgh.msgh_bits = 
diff -r bc34c084e574 -r a4fd2b945547 sys/compat/mach/mach_port.h
--- a/sys/compat/mach/mach_port.h       Wed Apr 30 18:31:30 2003 +0000
+++ b/sys/compat/mach/mach_port.h       Wed Apr 30 18:38:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_port.h,v 1.24 2003/03/29 11:04:11 manu Exp $ */
+/*     $NetBSD: mach_port.h,v 1.25 2003/04/30 18:38:19 manu Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -301,6 +301,7 @@
 #define MACH_MP_IOKIT_DEVCLASS 0x3     /* (struct mach_iokit_devclass *) */
 #define MACH_MP_PROC           0x4     /* (struct proc *) */
 #define MACH_MP_NOTIFY_SYNC    0x5     /* int */
+#define MACH_MP_IOKIT_DEVCLASS_DONE 0x6 /* (struct mach_iokit_devclass *) */
 
 void mach_port_init(void);
 struct mach_port *mach_port_get(void);



Home | Main Index | Thread Index | Old Index