summaryrefslogtreecommitdiff
path: root/ipc/ipc_object.c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-12-03 20:16:16 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:26:57 +0200
commit96c01087a657dfc1c877b63e9e6b0f45c37b9c78 (patch)
tree11f6e4d507c8327b52d167a718ec65c184c6bbfd /ipc/ipc_object.c
parenta0e81d1ebfbf11bc056f729242e8565f177afa95 (diff)
2006-12-03 Thomas Schwinge <tschwinge@gnu.org>
[patch #5017 --- ``Remove obsolete IPC interfaces.''] * DEVELOPMENT: Document the removal. * configfrag.ac (MACH_IPC_COMPAT): Don't define. 2006-12-03 Leonardo Lopes Pereira <leonardolopespereira@gmail.com> [patch #5017 --- ``Remove obsolete IPC interfaces.''] * kern/act.c [MIGRATING_THREADS]: Don't include <mach_ipc_compat.h>. * kern/act.h: Likewise. * i386/include/mach/i386/machine_types.defs: Adapt all users of MACH_IPC_COMPAT as if it were always defined to `0'. * include/mach/mach.defs: Likewise. * include/mach/mach_param.h: Likewise. * include/mach/mach_traps.h: Likewise. * include/mach/message.h: Likewise. * include/mach/mig_errors.h: Likewise. * include/mach/notify.h: Likewise. * include/mach/port.h: Likewise. * include/mach/std_types.defs: Likewise. * include/mach/syscall_sw.h: Likewise. * include/mach/task_special_ports.h: Likewise. * include/mach/thread_special_ports.h: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_kmsg.h: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_notify.c: Likewise. * ipc/ipc_notify.h: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_port.c: Likewise. * ipc/ipc_port.h: Likewise. * ipc/ipc_right.c: Likewise. * ipc/ipc_right.h: Likewise. * ipc/ipc_space.c: Likewise. * ipc/ipc_space.h: Likewise. * ipc/mach_debug.c: Likewise. * ipc/mach_msg.c: Likewise * ipc/mach_msg.h: Likewise. * ipc/mach_port.c: Likewise. * kern/act.c: Likewise. * kern/act.h: Likewise. * kern/ipc_host.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/syscall_sw.c: Likewise. * kern/thread.h: Likewise.
Diffstat (limited to 'ipc/ipc_object.c')
-rw-r--r--ipc/ipc_object.c325
1 files changed, 0 insertions, 325 deletions
diff --git a/ipc/ipc_object.c b/ipc/ipc_object.c
index 74d21f9..a7a7ddb 100644
--- a/ipc/ipc_object.c
+++ b/ipc/ipc_object.c
@@ -368,14 +368,6 @@ ipc_object_copyin_type(
case MACH_MSG_TYPE_COPY_SEND:
return MACH_MSG_TYPE_PORT_SEND;
-#if MACH_IPC_COMPAT
- case MSG_TYPE_PORT:
- return MACH_MSG_TYPE_PORT_SEND;
-
- case MSG_TYPE_PORT_ALL:
- return MACH_MSG_TYPE_PORT_RECEIVE;
-#endif /* MACH_IPC_COMPAT */
-
default:
#if MACH_ASSERT
assert(!"ipc_object_copyin_type: strange rights");
@@ -966,323 +958,6 @@ ipc_object_rename(
return kr;
}
-#if MACH_IPC_COMPAT
-
-/*
- * Routine: ipc_object_copyout_type_compat
- * Purpose:
- * Convert a carried type name to an old type name.
- */
-
-mach_msg_type_name_t
-ipc_object_copyout_type_compat(msgt_name)
- mach_msg_type_name_t msgt_name;
-{
- switch (msgt_name) {
- case MACH_MSG_TYPE_PORT_SEND:
- case MACH_MSG_TYPE_PORT_SEND_ONCE:
- return MSG_TYPE_PORT;
-
- case MACH_MSG_TYPE_PORT_RECEIVE:
- return MSG_TYPE_PORT_ALL;
-
- default:
-#if MACH_ASSERT
- assert(!"ipc_object_copyout_type_compat: strange rights");
-#else
- panic("ipc_object_copyout_type_compat: strange rights");
-#endif
- }
-}
-
-/*
- * Routine: ipc_object_copyin_compat
- * Purpose:
- * Copyin a capability from a space.
- * If successful, the caller gets a ref
- * for the resulting object, which is always valid.
- * Conditions:
- * Nothing locked.
- * Returns:
- * KERN_SUCCESS Acquired a valid object.
- * KERN_INVALID_TASK The space is dead.
- * KERN_INVALID_NAME Name doesn't exist in space.
- * KERN_INVALID_RIGHT Name doesn't denote correct right.
- */
-
-kern_return_t
-ipc_object_copyin_compat(space, name, msgt_name, dealloc, objectp)
- ipc_space_t space;
- mach_port_t name;
- mach_msg_type_name_t msgt_name;
- boolean_t dealloc;
- ipc_object_t *objectp;
-{
- ipc_entry_t entry;
- kern_return_t kr;
-
- kr = ipc_right_lookup_write(space, name, &entry);
- if (kr != KERN_SUCCESS)
- return kr;
- /* space is write-locked and active */
-
- kr = ipc_right_copyin_compat(space, name, entry,
- msgt_name, dealloc, objectp);
- /* space is unlocked */
- return kr;
-}
-
-/*
- * Routine: ipc_object_copyin_header
- * Purpose:
- * Copyin a capability from a space.
- * If successful, the caller gets a ref
- * for the resulting object, which is always valid.
- * The type of the acquired capability is returned.
- * Conditions:
- * Nothing locked.
- * Returns:
- * KERN_SUCCESS Acquired a valid object.
- * KERN_INVALID_TASK The space is dead.
- * KERN_INVALID_NAME Name doesn't exist in space.
- * KERN_INVALID_RIGHT Name doesn't denote correct right.
- */
-
-kern_return_t
-ipc_object_copyin_header(space, name, objectp, msgt_namep)
- ipc_space_t space;
- mach_port_t name;
- ipc_object_t *objectp;
- mach_msg_type_name_t *msgt_namep;
-{
- ipc_entry_t entry;
- kern_return_t kr;
-
- kr = ipc_right_lookup_write(space, name, &entry);
- if (kr != KERN_SUCCESS)
- return kr;
- /* space is write-locked and active */
-
- kr = ipc_right_copyin_header(space, name, entry,
- objectp, msgt_namep);
- /* space is unlocked */
- return kr;
-}
-
-/*
- * Routine: ipc_object_copyout_compat
- * Purpose:
- * Copyout a capability, placing it into a space.
- * If successful, consumes a ref for the object.
- *
- * Marks new entries with IE_BITS_COMPAT.
- * Conditions:
- * Nothing locked.
- * Returns:
- * KERN_SUCCESS Copied out object, consumed ref.
- * KERN_INVALID_TASK The space is dead.
- * KERN_INVALID_CAPABILITY The object is dead.
- * KERN_NO_SPACE No room in space for another right.
- * KERN_RESOURCE_SHORTAGE No memory available.
- */
-
-kern_return_t
-ipc_object_copyout_compat(space, object, msgt_name, namep)
- ipc_space_t space;
- ipc_object_t object;
- mach_msg_type_name_t msgt_name;
- mach_port_t *namep;
-{
- mach_port_t name;
- ipc_entry_t entry;
- ipc_port_t port;
- kern_return_t kr;
-
- assert(IO_VALID(object));
- assert(io_otype(object) == IOT_PORT);
- port = (ipc_port_t) object;
-
- is_write_lock(space);
-
- for (;;) {
- ipc_port_request_index_t request;
-
- if (!space->is_active) {
- is_write_unlock(space);
- return KERN_INVALID_TASK;
- }
-
- if ((msgt_name != MACH_MSG_TYPE_PORT_SEND_ONCE) &&
- ipc_right_reverse(space, (ipc_object_t) port,
- &name, &entry)) {
- /* port is locked and active */
-
- assert(entry->ie_bits & MACH_PORT_TYPE_SEND_RECEIVE);
- break;
- }
-
- kr = ipc_entry_get(space, &name, &entry);
- if (kr != KERN_SUCCESS) {
- /* unlocks/locks space, so must start again */
-
- kr = ipc_entry_grow_table(space);
- if (kr != KERN_SUCCESS)
- return kr; /* space is unlocked */
-
- continue;
- }
-
- assert(IE_BITS_TYPE(entry->ie_bits) == MACH_PORT_TYPE_NONE);
- assert(entry->ie_object == IO_NULL);
-
- ip_lock(port);
- if (!ip_active(port)) {
- ip_unlock(port);
- ipc_entry_dealloc(space, name, entry);
- is_write_unlock(space);
- return KERN_INVALID_CAPABILITY;
- }
-
- kr = ipc_port_dnrequest(port, name, ipr_spacem(space),
- &request);
- if (kr != KERN_SUCCESS) {
- ipc_entry_dealloc(space, name, entry);
- is_write_unlock(space);
-
- kr = ipc_port_dngrow(port);
- /* port is unlocked */
- if (kr != KERN_SUCCESS)
- return kr;
-
- is_write_lock(space);
- continue;
- }
-
- is_reference(space); /* for dnrequest */
- entry->ie_object = (ipc_object_t) port;
- entry->ie_request = request;
- entry->ie_bits |= IE_BITS_COMPAT;
- break;
- }
-
- /* space is write-locked and active, port is locked and active */
-
- kr = ipc_right_copyout(space, name, entry,
- msgt_name, TRUE, (ipc_object_t) port);
- /* object is unlocked */
- is_write_unlock(space);
-
- if (kr == KERN_SUCCESS)
- *namep = name;
- return kr;
-}
-
-/*
- * Routine: ipc_object_copyout_name_compat
- * Purpose:
- * Copyout a capability, placing it into a space.
- * The specified name is used for the capability.
- * If successful, consumes a ref for the object.
- *
- * Like ipc_object_copyout_name, except that
- * the name can't be in use at all, even for the same
- * port, and IE_BITS_COMPAT gets turned on.
- * Conditions:
- * Nothing locked.
- * Returns:
- * KERN_SUCCESS Copied out object, consumed ref.
- * KERN_INVALID_TASK The space is dead.
- * KERN_INVALID_CAPABILITY The object is dead.
- * KERN_RESOURCE_SHORTAGE No memory available.
- * KERN_RIGHT_EXISTS Space has rights under another name.
- * KERN_NAME_EXISTS Name is already used.
- */
-
-kern_return_t
-ipc_object_copyout_name_compat(space, object, msgt_name, name)
- ipc_space_t space;
- ipc_object_t object;
- mach_msg_type_name_t msgt_name;
- mach_port_t name;
-{
- ipc_entry_t entry;
- ipc_port_t port;
- kern_return_t kr;
-
- assert(IO_VALID(object));
- assert(io_otype(object) == IOT_PORT);
- port = (ipc_port_t) object;
-
- for (;;) {
- mach_port_t oname;
- ipc_entry_t oentry;
- ipc_port_request_index_t request;
-
- kr = ipc_entry_alloc_name(space, name, &entry);
- if (kr != KERN_SUCCESS)
- return kr;
- /* space is write-locked and active */
-
- if (ipc_right_inuse(space, name, entry))
- return KERN_NAME_EXISTS; /* space is unlocked */
-
- assert(IE_BITS_TYPE(entry->ie_bits) == MACH_PORT_TYPE_NONE);
- assert(entry->ie_object == IO_NULL);
-
- if ((msgt_name != MACH_MSG_TYPE_PORT_SEND_ONCE) &&
- ipc_right_reverse(space, (ipc_object_t) port,
- &oname, &oentry)) {
- /* port is locked and active */
-
- ip_unlock(port);
- ipc_entry_dealloc(space, name, entry);
- is_write_unlock(space);
- return KERN_RIGHT_EXISTS;
- }
-
- ip_lock(port);
- if (!ip_active(port)) {
- ip_unlock(port);
- ipc_entry_dealloc(space, name, entry);
- is_write_unlock(space);
- return KERN_INVALID_CAPABILITY;
- }
-
- kr = ipc_port_dnrequest(port, name, ipr_spacem(space),
- &request);
- if (kr != KERN_SUCCESS) {
- ipc_entry_dealloc(space, name, entry);
- is_write_unlock(space);
-
- kr = ipc_port_dngrow(port);
- /* port is unlocked */
- if (kr != KERN_SUCCESS)
- return kr;
-
- continue;
- }
-
- is_reference(space); /* for dnrequest */
- entry->ie_object = (ipc_object_t) port;
- entry->ie_request = request;
- entry->ie_bits |= IE_BITS_COMPAT;
- break;
- }
-
- /* space is write-locked and active, port is locked and active */
-
- kr = ipc_right_copyout(space, name, entry,
- msgt_name, TRUE, (ipc_object_t) port);
- /* object is unlocked */
- is_write_unlock(space);
-
- assert(kr == KERN_SUCCESS);
- return kr;
-}
-
-#endif /* MACH_IPC_COMPAT */
-
-
#if MACH_KDB
#define printf kdbprintf