bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 3/4] remove unused file ipc/mach_rpc.c


From: Luca Dariz
Subject: [PATCH 3/4] remove unused file ipc/mach_rpc.c
Date: Mon, 16 Jan 2023 14:04:25 +0100

* Makefrag.am: remove ipc/mach_rpc.c
* ipc/mach_rpc.c: remove file, all functions here seem unused.
---
 Makefrag.am    |   1 -
 ipc/mach_rpc.c | 150 -------------------------------------------------
 2 files changed, 151 deletions(-)
 delete mode 100644 ipc/mach_rpc.c

diff --git a/Makefrag.am b/Makefrag.am
index cb5651a2..9da44d55 100644
--- a/Makefrag.am
+++ b/Makefrag.am
@@ -114,7 +114,6 @@ libkernel_a_SOURCES += \
        ipc/mach_msg.h \
        ipc/mach_port.c \
        ipc/mach_port.h \
-       ipc/mach_rpc.c \
        ipc/mach_debug.c \
        ipc/port.h
 EXTRA_DIST += \
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 */
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]