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 sure darwin_iokit_ioframebuffer is in...



details:   https://anonhg.NetBSD.org/src/rev/26416180c60c
branches:  trunk
changeset: 543090:26416180c60c
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Feb 16 18:33:35 2003 +0000

description:
- Make sure darwin_iokit_ioframebuffer is invoked
- fix a mistake in mach_io_registry_entry_get_property message format

diffstat:

 sys/compat/mach/mach_iokit.c |  34 ++++++++++++++++++++++++++++++++--
 sys/compat/mach/mach_iokit.h |   8 ++------
 2 files changed, 34 insertions(+), 8 deletions(-)

diffs (89 lines):

diff -r d7f21c459baa -r 26416180c60c sys/compat/mach/mach_iokit.c
--- a/sys/compat/mach/mach_iokit.c      Sun Feb 16 18:16:26 2003 +0000
+++ b/sys/compat/mach/mach_iokit.c      Sun Feb 16 18:33:35 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_iokit.c,v 1.6 2003/02/16 15:02:05 manu Exp $ */
+/*     $NetBSD: mach_iokit.c,v 1.7 2003/02/16 18:33:35 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.6 2003/02/16 15:02:05 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_iokit.c,v 1.7 2003/02/16 18:33:35 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -285,9 +285,20 @@
        struct lwp *l = args->l;
        struct mach_port *mp;
        struct mach_right *mr;
+       mach_port_t mn;
+
+       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);
 
        mp = mach_port_get();
        mp->mp_flags |= MACH_MP_INKERNEL;
+#ifdef COMPAT_DARWIN
+       if (mr->mr_port->mp_datatype == MACH_MP_DARWIN_FAKEDEV) {
+               mp->mp_datatype = MACH_MP_DARWIN_FAKEDEV;
+               mp->mp_data = mr->mr_port->mp_data;
+       }
+#endif
        mr = mach_right_get(mp, l, MACH_PORT_TYPE_SEND, 0);
 
        rep->rep_msgh.msgh_bits = 
@@ -315,6 +326,25 @@
        struct lwp *l = args->l;
        struct mach_port *mp;
        struct mach_right *mr;
+       mach_port_t mn;
+#ifdef COMPAT_DARWIN
+       struct darwin_iokit_class *dic;
+#endif
+
+       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);
+       
+#ifdef COMPAT_DARWIN
+       if (mr->mr_port->mp_datatype == MACH_MP_DARWIN_FAKEDEV) {
+               dic = mr->mr_port->mp_data;
+               if (dic->dic_handler == NULL)
+                       printf("no handler for darwin_iokit_class %s\n",
+                           dic->dic_name);
+               else
+                       return (*dic->dic_handler)(args);
+       }
+#endif
 
        mp = mach_port_get();
        mp->mp_flags |= MACH_MP_INKERNEL;
diff -r d7f21c459baa -r 26416180c60c sys/compat/mach/mach_iokit.h
--- a/sys/compat/mach/mach_iokit.h      Sun Feb 16 18:16:26 2003 +0000
+++ b/sys/compat/mach/mach_iokit.h      Sun Feb 16 18:33:35 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_iokit.h,v 1.5 2003/02/09 22:13:46 manu Exp $ */
+/*     $NetBSD: mach_iokit.h,v 1.6 2003/02/16 18:33:35 manu Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -126,13 +126,9 @@
 typedef struct {
        mach_msg_header_t req_msgh;
        mach_ndr_record_t req_ndr;
-       mach_msg_type_number_t req_planeoffset;
-       mach_msg_type_number_t req_planecount;
-       char req_plane[128];
-       mach_msg_type_number_t req_property_nameoffser;
+       mach_msg_type_number_t req_property_nameoffset;
        mach_msg_type_number_t req_property_namecount;
        char req_propery_name[128];
-       int req_options;
 } mach_io_registry_entry_get_property_request_t;
 
 typedef struct {



Home | Main Index | Thread Index | Old Index