1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,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 Software.Distribution@CS.CMU.EDU
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 * HISTORY
28 * $Log: ipc_marequest.h,v $
29 * Revision 2.7 93/11/17 16:58:01 dbg
30 * Added ANSI function prototypes.
31 * [93/09/23 dbg]
32 *
33 * Revision 2.6 92/01/14 16:44:40 rpd
34 * Changed ipc_marequest_info for CountInOut.
35 * [92/01/14 rpd]
36 *
37 * Revision 2.5 91/05/14 16:33:47 mrt
38 * Correcting copyright
39 *
40 * Revision 2.4 91/02/05 17:22:20 mrt
41 * Changed to new Mach copyright
42 * [91/02/01 15:46:14 mrt]
43 *
44 * Revision 2.3 91/01/08 15:14:30 rpd
45 * Changed ipc_info_bucket_t to hash_info_bucket_t.
46 * [91/01/02 rpd]
47 *
48 * Revision 2.2 90/06/02 14:50:35 rpd
49 * Created for new IPC.
50 * [90/03/26 20:56:53 rpd]
51 *
52 */
53 /*
54 * File: ipc/ipc_marequest.h
55 * Author: Rich Draves
56 * Date: 1989
57 *
58 * Definitions for msg-accepted requests.
59 */
60
61 #ifndef _IPC_IPC_MAREQUEST_H_
62 #define _IPC_IPC_MAREQUEST_H_
63
64 #include <mach_ipc_debug.h>
65
66 #include <mach/kern_return.h>
67 #include <mach/port.h>
68 #include <ipc/ipc_types.h>
69
70 #if MACH_IPC_DEBUG
71 #include <mach_debug/hash_info.h>
72 #endif
73
74 /*
75 * A msg-accepted request is made when MACH_SEND_NOTIFY is used
76 * to force a message to a send right. The IE_BITS_MAREQUEST bit
77 * in an entry indicates the entry is blocked because MACH_SEND_NOTIFY
78 * has already been used to force a message. The kmsg holds
79 * a pointer to the marequest; it is destroyed when the kmsg
80 * is received/destroyed. (If the send right is destroyed,
81 * this just changes imar_name. If the space is destroyed,
82 * the marequest is left unchanged.)
83 *
84 * Locking considerations: The imar_space field is read-only and
85 * points to the space which locks the imar_name field. imar_soright
86 * is read-only. Normally it is a non-null send-once right for
87 * the msg-accepted notification, but in compat mode it is null
88 * and the notification goes to the space's notify port. Normally
89 * imar_name is non-null, but if the send right is destroyed then
90 * it is changed to be null. imar_next is locked by a bucket lock;
91 * imar_name is read-only when the request is in a bucket. (So lookups
92 * in the bucket can safely check imar_space and imar_name.)
93 * imar_space and imar_soright both hold references.
94 */
95
96 typedef struct ipc_marequest {
97 struct ipc_space *imar_space;
98 mach_port_t imar_name;
99 struct ipc_port *imar_soright;
100 struct ipc_marequest *imar_next;
101 } *ipc_marequest_t;
102
103 #define IMAR_NULL ((ipc_marequest_t) 0)
104
105
106 extern void
107 ipc_marequest_init(void);
108
109 #if MACH_IPC_DEBUG
110
111 extern unsigned int
112 ipc_marequest_info(unsigned int *, hash_info_bucket_t *, unsigned int);
113
114 #endif /* MACH_IPC_DEBUG */
115
116 extern mach_msg_return_t
117 ipc_marequest_create(ipc_space_t space, ipc_port_t port,
118 mach_port_t notify, ipc_marequest_t *marequestp);
119
120 extern void
121 ipc_marequest_cancel(ipc_space_t space, mach_port_t name);
122
123 extern void
124 ipc_marequest_rename(ipc_space_t space,
125 mach_port_t old, mach_port_t new);
126
127 extern void
128 ipc_marequest_destroy(ipc_marequest_t marequest);
129
130 #endif /* _IPC_IPC_MAREQUEST_H_ */
Cache object: f6c0a52336932c6ae7217c4c61552618
|