diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2006-12-03 20:16:16 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:26:57 +0200 |
commit | 96c01087a657dfc1c877b63e9e6b0f45c37b9c78 (patch) | |
tree | 11f6e4d507c8327b52d167a718ec65c184c6bbfd /ipc/ipc_port.c | |
parent | a0e81d1ebfbf11bc056f729242e8565f177afa95 (diff) | |
download | gnumach-96c01087a657dfc1c877b63e9e6b0f45c37b9c78.tar.gz gnumach-96c01087a657dfc1c877b63e9e6b0f45c37b9c78.tar.bz2 gnumach-96c01087a657dfc1c877b63e9e6b0f45c37b9c78.zip |
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_port.c')
-rw-r--r-- | ipc/ipc_port.c | 239 |
1 files changed, 0 insertions, 239 deletions
diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c index f19cca6d..ce0dbeb4 100644 --- a/ipc/ipc_port.c +++ b/ipc/ipc_port.c @@ -570,55 +570,6 @@ ipc_port_alloc_name( return KERN_SUCCESS; } -#if MACH_IPC_COMPAT -/* - * Routine: ipc_port_delete_compat - * Purpose: - * Find and destroy a compat entry for a dead port. - * If successful, generate a port-deleted notification. - * Conditions: - * Nothing locked; the port is dead. - * Frees a ref for the space. - */ - -void -ipc_port_delete_compat(port, space, name) - ipc_port_t port; - ipc_space_t space; - mach_port_t name; -{ - ipc_entry_t entry; - kern_return_t kr; - - assert(!ip_active(port)); - - kr = ipc_right_lookup_write(space, name, &entry); - if (kr == KERN_SUCCESS) { - ipc_port_t sright; - - /* space is write-locked and active */ - - if ((ipc_port_t) entry->ie_object == port) { - assert(entry->ie_bits & IE_BITS_COMPAT); - - sright = ipc_space_make_notify(space); - - kr = ipc_right_destroy(space, name, entry); - /* space is unlocked */ - assert(kr == KERN_INVALID_NAME); - } else { - is_write_unlock(space); - sright = IP_NULL; - } - - if (IP_VALID(sright)) - ipc_notify_port_deleted_compat(sright, name); - } - - is_release(space); -} -#endif /* MACH_IPC_COMPAT */ - /* * Routine: ipc_port_destroy * Purpose: @@ -662,28 +613,6 @@ ipc_port_destroy( port->ip_destination = IP_NULL; ip_unlock(port); -#if MACH_IPC_COMPAT - /* - * pdrequest might actually be a send right instead - * of a send-once right, indicated by the low bit - * of the pointer value. If this is the case, - * we must use ipc_notify_port_destroyed_compat. - */ - - if (ip_pdsendp(pdrequest)) { - ipc_port_t sright = ip_pdsend(pdrequest); - - if (!ipc_port_check_circularity(port, sright)) { - /* consumes our refs for port and sright */ - ipc_notify_port_destroyed_compat(sright, port); - return; - } else { - /* consume sright and destroy port */ - ipc_port_release_send(sright); - } - } else -#endif /* MACH_IPC_COMPAT */ - if (!ipc_port_check_circularity(port, pdrequest)) { /* consumes our refs for port and pdrequest */ ipc_notify_port_destroyed(pdrequest, port); @@ -771,14 +700,6 @@ ipc_port_destroy( soright = ipr->ipr_soright; assert(soright != IP_NULL); -#if MACH_IPC_COMPAT - if (ipr_spacep(soright)) { - ipc_port_delete_compat(port, - ipr_space(soright), name); - continue; - } -#endif /* MACH_IPC_COMPAT */ - ipc_notify_dead_name(soright, name); } @@ -1276,166 +1197,6 @@ ipc_port_dealloc_special( ipc_port_destroy(port); } -#if MACH_IPC_COMPAT - -/* - * Routine: ipc_port_alloc_compat - * Purpose: - * Allocate a port. - * Conditions: - * Nothing locked. If successful, the port is returned - * locked. (The caller doesn't have a reference.) - * - * Like ipc_port_alloc, except that the new entry - * is IE_BITS_COMPAT. - * Returns: - * KERN_SUCCESS The port is allocated. - * KERN_INVALID_TASK The space is dead. - * KERN_NO_SPACE No room for an entry in the space. - * KERN_RESOURCE_SHORTAGE Couldn't allocate memory. - */ - -kern_return_t -ipc_port_alloc_compat(space, namep, portp) - ipc_space_t space; - mach_port_t *namep; - ipc_port_t *portp; -{ - ipc_port_t port; - ipc_entry_t entry; - mach_port_t name; - ipc_table_size_t its; - ipc_port_request_t table; - ipc_table_elems_t size; - ipc_port_request_index_t free, i; - kern_return_t kr; - - port = ip_alloc(); - if (port == IP_NULL) - return KERN_RESOURCE_SHORTAGE; - - its = &ipc_table_dnrequests[0]; - table = it_dnrequests_alloc(its); - if (table == IPR_NULL) { - ip_free(port); - return KERN_RESOURCE_SHORTAGE; - } - - kr = ipc_entry_alloc(space, &name, &entry); - if (kr != KERN_SUCCESS) { - ip_free(port); - it_dnrequests_free(its, table); - return kr; - } - /* space is write-locked */ - - entry->ie_object = (ipc_object_t) port; - entry->ie_request = 1; - entry->ie_bits |= IE_BITS_COMPAT|MACH_PORT_TYPE_RECEIVE; - - ip_lock_init(port); - ip_lock(port); - is_write_unlock(space); - - port->ip_references = 1; /* for entry, not caller */ - port->ip_bits = io_makebits(TRUE, IOT_PORT, 0); - - ipc_port_init(port, space, name); - - size = its->its_size; - assert(size > 1); - free = 0; - - for (i = 2; i < size; i++) { - ipc_port_request_t ipr = &table[i]; - - ipr->ipr_name = MACH_PORT_NULL; - ipr->ipr_next = free; - free = i; - } - - table->ipr_next = free; - table->ipr_size = its; - port->ip_dnrequests = table; - - table[1].ipr_name = name; - table[1].ipr_soright = ipr_spacem(space); - is_reference(space); - - *namep = name; - *portp = port; - return KERN_SUCCESS; -} - -/* - * Routine: ipc_port_copyout_send_compat - * Purpose: - * Copyout a naked send right (possibly null/dead), - * or if that fails, destroy the right. - * Like ipc_port_copyout_send, except that if a - * new translation is created it has the compat bit. - * Conditions: - * Nothing locked. - */ - -mach_port_t -ipc_port_copyout_send_compat(sright, space) - ipc_port_t sright; - ipc_space_t space; -{ - mach_port_t name; - - if (IP_VALID(sright)) { - kern_return_t kr; - - kr = ipc_object_copyout_compat(space, (ipc_object_t) sright, - MACH_MSG_TYPE_PORT_SEND, &name); - if (kr != KERN_SUCCESS) { - ipc_port_release_send(sright); - name = MACH_PORT_NULL; - } - } else - name = (mach_port_t) sright; - - return name; -} - -/* - * Routine: ipc_port_copyout_receiver - * Purpose: - * Copyout a port reference (possibly null) - * by giving the caller his name for the port, - * if he is the receiver. - * Conditions: - * Nothing locked. Consumes a ref for the port. - */ - -mach_port_t -ipc_port_copyout_receiver(port, space) - ipc_port_t port; - ipc_space_t space; -{ - mach_port_t name; - - if (!IP_VALID(port)) - return MACH_PORT_NULL; - - ip_lock(port); - if (port->ip_receiver == space) { - name = port->ip_receiver_name; - assert(MACH_PORT_VALID(name)); - } else - name = MACH_PORT_NULL; - - ip_release(port); - ip_check_unlock(port); - - return name; -} - -#endif /* MACH_IPC_COMPAT */ - - #if MACH_KDB #define printf kdbprintf |