|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4: * All Rights Reserved.
5: *
6: * Permission to use, copy, modify and distribute this software and its
7: * documentation is hereby granted, provided that both the copyright
8: * notice and this permission notice appear in all copies of the
9: * software, derivative works or modified versions, and any portions
10: * thereof, and that both notices appear in supporting documentation.
11: *
12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15: *
16: * Carnegie Mellon requests users of this software to return to
17: *
18: * Software Distribution Coordinator or [email protected]
19: * School of Computer Science
20: * Carnegie Mellon University
21: * Pittsburgh PA 15213-3890
22: *
23: * any improvements or extensions that they make and grant Carnegie Mellon
24: * the rights to redistribute these changes.
25: */
26: /*
27: * File: ipc/ipc_marequest.h
28: * Author: Rich Draves
29: * Date: 1989
30: *
31: * Definitions for msg-accepted requests.
32: */
33:
34: #ifndef _IPC_IPC_MAREQUEST_H_
35: #define _IPC_IPC_MAREQUEST_H_
36:
37: #include <mach_ipc_debug.h>
38:
39: #include <mach/kern_return.h>
40: #include <mach/port.h>
41:
42: /*
43: * A msg-accepted request is made when MACH_SEND_NOTIFY is used
44: * to force a message to a send right. The IE_BITS_MAREQUEST bit
45: * in an entry indicates the entry is blocked because MACH_SEND_NOTIFY
46: * has already been used to force a message. The kmsg holds
47: * a pointer to the marequest; it is destroyed when the kmsg
48: * is received/destroyed. (If the send right is destroyed,
49: * this just changes imar_name. If the space is destroyed,
50: * the marequest is left unchanged.)
51: *
52: * Locking considerations: The imar_space field is read-only and
53: * points to the space which locks the imar_name field. imar_soright
54: * is read-only. Normally it is a non-null send-once right for
55: * the msg-accepted notification, but in compat mode it is null
56: * and the notification goes to the space's notify port. Normally
57: * imar_name is non-null, but if the send right is destroyed then
58: * it is changed to be null. imar_next is locked by a bucket lock;
59: * imar_name is read-only when the request is in a bucket. (So lookups
60: * in the bucket can safely check imar_space and imar_name.)
61: * imar_space and imar_soright both hold references.
62: */
63:
64: typedef struct ipc_marequest {
65: struct ipc_space *imar_space;
66: mach_port_t imar_name;
67: struct ipc_port *imar_soright;
68: struct ipc_marequest *imar_next;
69: } *ipc_marequest_t;
70:
71: #define IMAR_NULL ((ipc_marequest_t) 0)
72:
73:
74: extern void
75: ipc_marequest_init();
76:
77: #if MACH_IPC_DEBUG
78:
79: extern unsigned int
80: ipc_marequest_info(/* unsigned int *, hash_info_bucket_t *, unsigned int */);
81:
82: #endif /* MACH_IPC_DEBUG */
83:
84: extern mach_msg_return_t
85: ipc_marequest_create(/* ipc_space_t space, mach_port_t name,
86: ipc_port_t soright, ipc_marequest_t *marequestp */);
87:
88: extern void
89: ipc_marequest_cancel(/* ipc_space_t space, mach_port_t name */);
90:
91: extern void
92: ipc_marequest_rename(/* ipc_space_t space,
93: mach_port_t old, mach_port_t new */);
94:
95: extern void
96: ipc_marequest_destroy(/* ipc_marequest_t marequest */);
97:
98: #endif /* _IPC_IPC_MAREQUEST_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.