summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-01-16 14:04:25 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-16 21:29:47 +0100
commit6c91d04fbe4ddd798015724988a88b0043ddf1f9 (patch)
treebad6ace83eee5226067dc90de4de6cf6462aabbf /ipc
parentb46149b640aa7c6b341d11bd26e3d139e1694eb4 (diff)
remove unused file ipc/mach_rpc.c
* Makefrag.am: remove ipc/mach_rpc.c * ipc/mach_rpc.c: remove file, all functions here seem unused. Message-Id: <20230116130426.246584-3-luca@orpolo.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mach_rpc.c150
1 files changed, 0 insertions, 150 deletions
diff --git a/ipc/mach_rpc.c b/ipc/mach_rpc.c
deleted file mode 100644
index 7b747f79..00000000
--- a/ipc/mach_rpc.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1994 The University of Utah and
- * the Computer Systems Laboratory (CSL). All rights reserved.
- *
- * Permission to use, copy, modify and distribute this software is hereby
- * granted provided that (1) source code retains these copyright, permission,
- * and disclaimer notices, and (2) redistributions including binaries
- * reproduce the notices in supporting documentation, and (3) all advertising
- * materials mentioning features or use of this software display the following
- * acknowledgement: ``This product includes software developed by the
- * Computer Systems Laboratory at the University of Utah.''
- *
- * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
- * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
- * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * CSL requests users of this software to return to csl-dist@cs.utah.edu any
- * improvements that they make and grant CSL redistribution rights.
- *
- */
-
-#ifdef MIGRATING_THREADS
-
-#include <kern/printf.h>
-#include <mach/kern_return.h>
-#include <mach/port.h>
-#include <mach/rpc.h>
-#include <mach/notify.h>
-#include <mach/mach_param.h>
-#include <mach/vm_param.h>
-#include <mach/vm_prot.h>
-#include <kern/task.h>
-#include <kern/act.h>
-#include <vm/vm_map.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_user.h>
-#include <ipc/ipc_entry.h>
-#include <ipc/ipc_space.h>
-#include <ipc/ipc_object.h>
-#include <ipc/ipc_notify.h>
-#include <ipc/ipc_port.h>
-#include <ipc/ipc_pset.h>
-#include <ipc/ipc_right.h>
-
-#undef DEBUG_MPRC
-
-/*
- * XXX need to identify if one endpoint of an RPC is the kernel to
- * ensure proper port name translation (or lack of). This is bogus.
- */
-#define ISKERNELACT(act) ((act)->task == kernel_task)
-
-/*
- * Copy the indicated port from the task associated with the source
- * activation into the task associated with the destination activation.
- *
- * XXX on errors we should probably clear the portp to avoid leaking
- * info to the other side.
- */
-kern_return_t
-mach_port_rpc_copy(
- struct rpc_port_desc *portp,
- struct Act *sact,
- struct Act *dact)
-{
- ipc_space_t sspace, dspace;
- mach_msg_type_name_t tname;
- ipc_object_t iname;
- kern_return_t kr;
-
-#ifdef DEBUG_MPRC
- printf("m_p_rpc_copy(portp=%x/%x, sact=%x, dact=%x): ",
- portp->name, portp->msgt_name, sact, dact);
-#endif
- sspace = sact->task->itk_space;
- dspace = dact->task->itk_space;
- if (sspace == IS_NULL || dspace == IS_NULL) {
-#ifdef DEBUG_MPRC
- printf("bogus src (%x) or dst (%x) space\n", sspace, dspace);
-#endif
- return KERN_INVALID_TASK;
- }
-
- if (!MACH_MSG_TYPE_PORT_ANY(portp->msgt_name)) {
-#ifdef DEBUG_MPRC
- printf("invalid port type\n");
-#endif
- return KERN_INVALID_VALUE;
- }
-
- if (ISKERNELACT(sact)) {
- iname = (ipc_object_t) portp->name;
- ipc_object_copyin_from_kernel(iname, portp->msgt_name);
- kr = KERN_SUCCESS;
- } else {
- kr = ipc_object_copyin(sspace, portp->name, portp->msgt_name,
- &iname);
- }
- if (kr != KERN_SUCCESS) {
-#ifdef DEBUG_MPRC
- printf("copyin returned %x\n", kr);
-#endif
- return kr;
- }
-
- tname = ipc_object_copyin_type(portp->msgt_name);
- if (!IO_VALID(iname)) {
- portp->name = (mach_port_name_t) iname;
- portp->msgt_name = tname;
-#ifdef DEBUG_MPRC
- printf("iport %x invalid\n", iname);
-#endif
- return KERN_SUCCESS;
- }
-
- if (ISKERNELACT(dact)) {
- portp->name = (mach_port_name_t) iname;
- kr = KERN_SUCCESS;
- } else {
- kr = ipc_object_copyout(dspace, iname, tname, TRUE,
- &portp->name);
- }
- if (kr != KERN_SUCCESS) {
- ipc_object_destroy(iname, tname);
-
- if (kr == KERN_INVALID_CAPABILITY)
- portp->name = MACH_PORT_DEAD;
- else {
- portp->name = MACH_PORT_NULL;
-#ifdef DEBUG_MPRC
- printf("copyout iport %x returned %x\n", iname);
-#endif
- return kr;
- }
- }
-
- portp->msgt_name = tname;
-#ifdef DEBUG_MPRC
- printf("portp=%x/%x, iname=%x\n", portp->name, portp->msgt_name, iname);
-#endif
- return KERN_SUCCESS;
-}
-
-kern_return_t
-mach_port_rpc_sig(const ipc_space_t space, const char *name, const char *buffer, unsigned int buflen)
-{
- return KERN_FAILURE;
-}
-
-#endif /* MIGRATING_THREADS */