Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/mach Added io_iterator_reset (there is a nundocum...



details:   https://anonhg.NetBSD.org/src/rev/251518efca31
branches:  trunk
changeset: 546492:251518efca31
user:      manu <manu%NetBSD.org@localhost>
date:      Wed Apr 30 07:32:16 2003 +0000

description:
Added io_iterator_reset (there is a nundocumented flag argument, no idea
of its use yet)

diffstat:

 sys/compat/mach/mach_iokit.c   |  39 +++++++++++++++++++++++++++++++++++++--
 sys/compat/mach/mach_iokit.h   |  18 +++++++++++++++++-
 sys/compat/mach/mach_namemap.c |   5 +++--
 3 files changed, 57 insertions(+), 5 deletions(-)

diffs (122 lines):

diff -r 2255f8a4468b -r 251518efca31 sys/compat/mach/mach_iokit.c
--- a/sys/compat/mach/mach_iokit.c      Wed Apr 30 07:23:49 2003 +0000
+++ b/sys/compat/mach/mach_iokit.c      Wed Apr 30 07:32:16 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_iokit.c,v 1.11 2003/04/29 22:16:38 manu Exp $ */
+/*     $NetBSD: mach_iokit.c,v 1.12 2003/04/30 07:32:16 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.11 2003/04/29 22:16:38 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_iokit.c,v 1.12 2003/04/30 07:32:16 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -766,3 +766,38 @@
        return 0;
 }
 
+int
+mach_io_iterator_reset(args)
+       struct mach_trap_args *args;
+{
+       mach_io_iterator_reset_request_t *req = args->smsg;
+       mach_io_iterator_reset_reply_t *rep = args->rmsg;
+       size_t *msglen = args->rsize; 
+       struct lwp *l = args->l;
+       mach_port_t mn;
+       struct mach_right *mr;
+       struct mach_device_iterator *mdi;
+
+       mn = req->req_msgh.msgh_remote_port;
+       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) {
+               mdi = mr->mr_port->mp_data;
+               mdi->mdi_parent = mr->mr_port->mp_data;
+               mdi->mdi_current = TAILQ_FIRST(&alldevs);
+       }
+
+       rep->rep_msgh.msgh_bits = 
+           MACH_MSGH_REPLY_LOCAL_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE);
+       rep->rep_msgh.msgh_size = sizeof(*rep) - sizeof(rep->rep_trailer);
+       rep->rep_msgh.msgh_local_port = req->req_msgh.msgh_local_port;
+       rep->rep_msgh.msgh_id = req->req_msgh.msgh_id + 100;
+       rep->rep_retval = 0;
+       rep->rep_trailer.msgh_trailer_size = 8;
+
+       *msglen = sizeof(*rep);
+
+       return 0;
+}
+
diff -r 2255f8a4468b -r 251518efca31 sys/compat/mach/mach_iokit.h
--- a/sys/compat/mach/mach_iokit.h      Wed Apr 30 07:23:49 2003 +0000
+++ b/sys/compat/mach/mach_iokit.h      Wed Apr 30 07:32:16 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_iokit.h,v 1.10 2003/04/29 22:16:38 manu Exp $ */
+/*     $NetBSD: mach_iokit.h,v 1.11 2003/04/30 07:32:17 manu Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -358,6 +358,21 @@
        mach_msg_trailer_t rep_trailer;
 } mach_io_connect_map_memory_reply_t;
 
+/* io_iterator_reset */
+
+typedef struct {
+       mach_msg_header_t req_msgh;
+       mach_ndr_record_t req_ndr;
+       int req_flags;
+} mach_io_iterator_reset_request_t;
+
+typedef struct {
+       mach_msg_header_t rep_msgh;
+       mach_ndr_record_t rep_ndr;
+       mach_kern_return_t rep_retval;
+       mach_msg_trailer_t rep_trailer;
+} mach_io_iterator_reset_reply_t;
+
 int mach_io_service_get_matching_services(struct mach_trap_args *);
 int mach_io_iterator_next(struct mach_trap_args *);
 int mach_io_service_open(struct mach_trap_args *);
@@ -376,6 +391,7 @@
 int mach_io_registry_entry_get_properties(struct mach_trap_args *);
 int mach_io_registry_entry_get_path(struct mach_trap_args *);
 int mach_io_connect_map_memory(struct mach_trap_args *);
+int mach_io_iterator_reset(struct mach_trap_args *);
 
 extern struct mach_iokit_devclass *mach_iokit_devclasses[];
 
diff -r 2255f8a4468b -r 251518efca31 sys/compat/mach/mach_namemap.c
--- a/sys/compat/mach/mach_namemap.c    Wed Apr 30 07:23:49 2003 +0000
+++ b/sys/compat/mach/mach_namemap.c    Wed Apr 30 07:32:16 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_namemap.c,v 1.24 2003/04/29 22:16:38 manu Exp $ */
+/*     $NetBSD: mach_namemap.c,v 1.25 2003/04/30 07:32:17 manu Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_namemap.c,v 1.24 2003/04/29 22:16:38 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_namemap.c,v 1.25 2003/04/30 07:32:17 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -70,6 +70,7 @@
        { 2800, mach_io_object_get_class, "io_object_get_class" },
        { 2801, mach_io_object_conforms_to, "io_object_conforms_to" },
        { 2802, mach_io_iterator_next, "io_iterator_next" },
+       { 2803, mach_io_iterator_reset, "io_iterator_reset" },
        { 2804, mach_io_service_get_matching_services, 
            "io_service_get_matching_services" },
        { 2805, mach_io_registry_entry_get_property,



Home | Main Index | Thread Index | Old Index