Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/mach Add task_terminate



details:   https://anonhg.NetBSD.org/src/rev/00d8653a089c
branches:  trunk
changeset: 555838:00d8653a089c
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Nov 30 20:42:03 2003 +0000

description:
Add task_terminate

diffstat:

 sys/compat/mach/mach_services.c       |   6 ++--
 sys/compat/mach/mach_services.h       |   5 ++-
 sys/compat/mach/mach_services.master  |   4 +-
 sys/compat/mach/mach_services_names.c |   6 ++--
 sys/compat/mach/mach_task.c           |  36 +++++++++++++++++++++++++++++++++-
 sys/compat/mach/mach_task.h           |  15 +++++++++++++-
 6 files changed, 59 insertions(+), 13 deletions(-)

diffs (189 lines):

diff -r c70012750d9d -r 00d8653a089c sys/compat/mach/mach_services.c
--- a/sys/compat/mach/mach_services.c   Sun Nov 30 18:16:45 2003 +0000
+++ b/sys/compat/mach/mach_services.c   Sun Nov 30 20:42:03 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mach_services.c,v 1.9 2003/11/30 00:09:59 manu Exp $ */
+/* $NetBSD: mach_services.c,v 1.10 2003/11/30 20:42:03 manu Exp $ */
 
 /*
  * Mach services table.
@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_services.c,v 1.9 2003/11/30 00:09:59 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_services.c,v 1.10 2003/11/30 20:42:03 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -217,7 +217,7 @@
        {3226, mach_port_insert_member, "port_insert_member", sizeof(mach_port_insert_member_request_t), sizeof(mach_port_insert_member_reply_t)},
        {3227, NULL, "unimpl. port_extract_member", 0, 0},
        {3400, NULL, "unimpl. task_create", 0, 0},
-       {3401, NULL, "unimpl. task_terminate", 0, 0},
+       {3401, mach_task_terminate, "task_terminate", sizeof(mach_task_terminate_request_t), sizeof(mach_task_terminate_reply_t)},
        {3402, mach_task_threads, "task_threads", sizeof(mach_task_threads_request_t), sizeof(mach_task_threads_reply_t)},
        {3403, NULL, "unimpl. ports_register", 0, 0},
        {3404, mach_ports_lookup, "ports_lookup", sizeof(mach_ports_lookup_request_t), sizeof(mach_ports_lookup_reply_t)},
diff -r c70012750d9d -r 00d8653a089c sys/compat/mach/mach_services.h
--- a/sys/compat/mach/mach_services.h   Sun Nov 30 18:16:45 2003 +0000
+++ b/sys/compat/mach/mach_services.h   Sun Nov 30 20:42:03 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mach_services.h,v 1.9 2003/11/30 00:09:59 manu Exp $ */
+/* $NetBSD: mach_services.h,v 1.10 2003/11/30 20:42:03 manu Exp $ */
 
 /*
  * Mach services prototypes.
@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_services.h,v 1.9 2003/11/30 00:09:59 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_services.h,v 1.10 2003/11/30 20:42:03 manu Exp $");
 
 #include <compat/mach/mach_types.h>
 #include <compat/mach/mach_message.h>
@@ -59,6 +59,7 @@
 int mach_port_get_attributes(struct mach_trap_args *);
 int mach_port_set_attributes(struct mach_trap_args *);
 int mach_port_insert_member(struct mach_trap_args *);
+int mach_task_terminate(struct mach_trap_args *);
 int mach_task_threads(struct mach_trap_args *);
 int mach_ports_lookup(struct mach_trap_args *);
 int mach_task_info(struct mach_trap_args *);
diff -r c70012750d9d -r 00d8653a089c sys/compat/mach/mach_services.master
--- a/sys/compat/mach/mach_services.master      Sun Nov 30 18:16:45 2003 +0000
+++ b/sys/compat/mach/mach_services.master      Sun Nov 30 20:42:03 2003 +0000
@@ -1,4 +1,4 @@
- $NetBSD: mach_services.master,v 1.6 2003/11/29 23:56:08 manu Exp $
+ $NetBSD: mach_services.master,v 1.7 2003/11/30 20:42:03 manu Exp $
 ;
 ; Mach services list. 
 ;
@@ -291,7 +291,7 @@
 ; Mach tasks
 ;
 3400   UNIMPL  task_create
-3401   UNIMPL  task_terminate
+3401   STD     task_terminate
 3402   STD     task_threads
 3403   UNIMPL  ports_register
 3404   STD     ports_lookup
diff -r c70012750d9d -r 00d8653a089c sys/compat/mach/mach_services_names.c
--- a/sys/compat/mach/mach_services_names.c     Sun Nov 30 18:16:45 2003 +0000
+++ b/sys/compat/mach/mach_services_names.c     Sun Nov 30 20:42:03 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mach_services_names.c,v 1.6 2003/11/30 00:09:59 manu Exp $ */
+/* $NetBSD: mach_services_names.c,v 1.7 2003/11/30 20:42:03 manu Exp $ */
 
 /*
  * Mach services names. This file is not built
@@ -9,7 +9,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_services_names.c,v 1.6 2003/11/30 00:09:59 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_services_names.c,v 1.7 2003/11/30 20:42:03 manu Exp $");
 
 struct mach_service_name {
        int srv_id;
@@ -207,7 +207,7 @@
        {3226, "port_insert_member"},
        {3227, "unimpl. port_extract_member"},
        {3400, "unimpl. task_create"},
-       {3401, "unimpl. task_terminate"},
+       {3401, "task_terminate"},
        {3402, "task_threads"},
        {3403, "unimpl. ports_register"},
        {3404, "ports_lookup"},
diff -r c70012750d9d -r 00d8653a089c sys/compat/mach/mach_task.c
--- a/sys/compat/mach/mach_task.c       Sun Nov 30 18:16:45 2003 +0000
+++ b/sys/compat/mach/mach_task.c       Sun Nov 30 20:42:03 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_task.c,v 1.43 2003/11/27 23:44:49 manu Exp $ */
+/*     $NetBSD: mach_task.c,v 1.44 2003/11/30 20:42:03 manu Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #include "opt_compat_darwin.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.43 2003/11/27 23:44:49 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.44 2003/11/30 20:42:03 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -50,6 +50,9 @@
 #include <sys/ktrace.h>
 #include <sys/resourcevar.h>
 #include <sys/malloc.h>
+#include <sys/sa.h>
+#include <sys/mount.h>
+#include <sys/syscallargs.h>
 
 #include <uvm/uvm_extern.h>
 #include <uvm/uvm_param.h>
@@ -644,6 +647,35 @@
 }
 
 int
+mach_task_terminate(args)
+       struct mach_trap_args *args;
+{
+       mach_task_resume_request_t *req = args->smsg;
+       mach_task_resume_reply_t *rep = args->rmsg;
+       size_t *msglen = args->rsize;
+       struct lwp *tl = args->tl;
+       struct sys_exit_args cup;
+       register_t retval;
+       int error;
+
+
+       SCARG(&cup, rval) = 0;
+       error = sys_exit(tl, &cup, &retval);
+
+       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 = native_to_mach_errno[error];
+       rep->rep_trailer.msgh_trailer_size = 8;
+
+       *msglen = sizeof(*rep);
+
+       return 0;
+}
+
+int
 mach_sys_task_for_pid(l, v, retval)
        struct lwp *l;
        void *v;
diff -r c70012750d9d -r 00d8653a089c sys/compat/mach/mach_task.h
--- a/sys/compat/mach/mach_task.h       Sun Nov 30 18:16:45 2003 +0000
+++ b/sys/compat/mach/mach_task.h       Sun Nov 30 20:42:03 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_task.h,v 1.12 2003/11/27 23:44:49 manu Exp $ */
+/*     $NetBSD: mach_task.h,v 1.13 2003/11/30 20:42:03 manu Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -218,4 +218,17 @@
        mach_msg_trailer_t rep_trailer;
 } mach_task_resume_reply_t;
 
+/* task_terminate */
+
+typedef struct {
+       mach_msg_header_t req_msgh;
+} mach_task_terminate_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_task_terminate_reply_t;
+
 #endif /* _MACH_TASK_H_ */



Home | Main Index | Thread Index | Old Index