83 |
/* Reference counter. */ |
/* Reference counter. */ |
84 |
unsigned int ref_count; |
unsigned int ref_count; |
85 |
|
|
86 |
/* IPC object that has receive rights for the time. */ |
/* IPC object that has receive rights for the time. |
87 |
|
Name of port in rcvobject. This is an optimization. */ |
88 |
struct ipc_object *rcvobject; |
struct ipc_object *rcvobject; |
89 |
|
rtmk_port_t rcvname; |
90 |
|
|
91 |
/* Message queue. Also holds information about queue limit. */ |
/* Message queue. Also holds information about queue limit. */ |
92 |
struct ipc_mqueue mqueue; |
struct ipc_mqueue mqueue; |
118 |
/* Number of send and send rights to this port. */ |
/* Number of send and send rights to this port. */ |
119 |
rtmk_port_right_t srights; |
rtmk_port_right_t srights; |
120 |
rtmk_port_right_t sorights; |
rtmk_port_right_t sorights; |
121 |
|
rtmk_port_right_t msrights; |
122 |
}; |
}; |
123 |
|
|
124 |
/* Convinience definitions. */ |
/* Convinience definitions. */ |
171 |
|
|
172 |
/* Allocate a new port. Receive rights are returned in PORTP. */ |
/* Allocate a new port. Receive rights are returned in PORTP. */ |
173 |
extern kern_return_t port_allocate (struct task *task, |
extern kern_return_t port_allocate (struct task *task, |
174 |
rtmk_port_t *portp); |
struct ipc_port **portp); |
175 |
|
|
176 |
/* Allocate a new named port. We fail if name already exits. */ |
/* Allocate a new named port. We fail if name already exits. */ |
177 |
extern kern_return_t port_allocate_name (struct task *task, |
extern kern_return_t port_allocate_name (struct task *task, |
179 |
|
|
180 |
/* Inserts into TASK the caller's right for PORT. RIGHT_NAME is name in |
/* Inserts into TASK the caller's right for PORT. RIGHT_NAME is name in |
181 |
TASK's IPC object. RIGHT_TYPE specifies right type. */ |
TASK's IPC object. RIGHT_TYPE specifies right type. */ |
182 |
extern kern_return_t port_insert_right (struct task *task, struct ipc_port *port, |
extern kern_return_t port_insert_right (struct task *task, |
183 |
rtmk_port_name_t right_name, |
rtmk_port_name_t right_name, |
184 |
rtmk_port_type_t right_type); |
struct ipc_port *port, |
185 |
|
rtmk_port_type_t port_type); |
186 |
|
|
187 |
/* Removes TASK's rights for NAME. The name becomes immediately |
/* Removes TASK's rights for NAME. The name becomes immediately |
188 |
available for reuse. */ |
available for reuse. */ |
189 |
extern kern_return_t port_destroy (struct task *task, |
extern kern_return_t port_destroy (struct task *task, |
190 |
rtmk_port_name_t name); |
rtmk_port_name_t name); |
191 |
|
|
192 |
#endif /* ipc-port.h */ |
/* Deallocate user reference to right NAME. If reference counter |
193 |
|
drops to zero, we destroy the right and release reference to port. */ |
194 |
|
extern kern_return_t port_deallocate (struct task *task, |
195 |
|
rtmk_port_name_t name); |
196 |
|
|
197 |
|
/* Allocate a new port set. When created the port set does not |
198 |
|
contain any members. Return receive rights in PSETP. */ |
199 |
|
extern kern_return_t port_set_allocate (struct task *task, |
200 |
|
struct ipc_port **psetp); |
201 |
|
|
202 |
|
/* Insert PORT into PORT_SET. If PORT_SET is NULL, we remove |
203 |
|
PORT from the port set it currently belongs to. */ |
204 |
|
extern kern_return_t port_move_member (struct task *task, |
205 |
|
rtmk_port_name_t port_name, |
206 |
|
rtmk_port_name_t pset_name); |
207 |
|
|
208 |
|
#endif /* ipc-port.h */ |