/*===========================================================================*
* has_pending *
*===========================================================================*/
-PUBLIC int has_pending(sys_map_t *map, int src_p)
+PRIVATE int has_pending(sys_map_t *map, int src_p, int asynm)
{
/* Check to see if there is a pending message from the desired source
* available.
return(id);
}
+/*===========================================================================*
+ * has_pending_notify *
+ *===========================================================================*/
+PUBLIC int has_pending_notify(struct proc * caller, int src_p)
+{
+ sys_map_t * map = &priv(caller)->s_notify_pending;
+ return has_pending(map, src_p, 0);
+}
+
+/*===========================================================================*
+ * has_pending_asend *
+ *===========================================================================*/
+PUBLIC int has_pending_asend(struct proc * caller, int src_p)
+{
+ sys_map_t * map = &priv(caller)->s_asyn_pending;
+ return has_pending(map, src_p, 1);
+}
+
+/*===========================================================================*
+ * unset_notify_pending *
+ *===========================================================================*/
+PUBLIC void unset_notify_pending(struct proc * caller, int src_p)
+{
+ sys_map_t * map = &priv(caller)->s_notify_pending;
+ unset_sys_bit(*map, src_p);
+}
+
/*===========================================================================*
* mini_send *
*===========================================================================*/
* is available block the caller.
*/
register struct proc **xpp;
- sys_map_t *map;
int r, src_id, src_proc_nr, src_p;
assert(!(caller_ptr->p_misc_flags & MF_DELIVERMSG));
/* Check if there are pending notifications, except for SENDREC. */
if (! (caller_ptr->p_misc_flags & MF_REPLY_PEND)) {
- map = &priv(caller_ptr)->s_notify_pending;
/* Check for pending notifications */
- if ((src_id = has_pending(map, src_p)) != NULL_PRIV_ID) {
+ if ((src_id = has_pending_notify(caller_ptr, src_p)) != NULL_PRIV_ID) {
endpoint_t hisep;
src_proc_nr = id_to_nr(src_id); /* get source proc */
printf("mini_receive: sending notify from NONE\n");
}
#endif
- unset_sys_bit(*map, src_id); /* no longer pending */
+ unset_notify_pending(caller_ptr, src_id); /* no longer pending */
/* Found a suitable source, deliver the notification message. */
hisep = proc_addr(src_proc_nr)->p_endpoint;
}
/* Check for pending asynchronous messages */
- map = &priv(caller_ptr)->s_asyn_pending;
-
- if (has_pending(map, src_p) != NULL_PRIV_ID) {
+ if (has_pending_asend(caller_ptr, src_p) != NULL_PRIV_ID) {
if (src_p != ANY)
r = try_one(proc_addr(src_p), caller_ptr);
else
_PROTOTYPE( int do_ipc, (reg_t r1, reg_t r2, reg_t r3) );
_PROTOTYPE( void proc_init, (void) );
-_PROTOTYPE( int has_pending, (sys_map_t *map, int src_p) );
_PROTOTYPE( int cancel_async, (struct proc *src, struct proc *dst) );
+_PROTOTYPE( int has_pending_notify, (struct proc * caller, int src_p) );
+_PROTOTYPE( int has_pending_asend, (struct proc * caller, int src_p) );
+_PROTOTYPE( void unset_notify_pending, (struct proc * caller, int src_p));
_PROTOTYPE( int mini_notify, (const struct proc *src, endpoint_t dst) );
_PROTOTYPE( void enqueue, (struct proc *rp) );
_PROTOTYPE( void dequeue, (struct proc *rp) );
/* Clear IPC references for a given process slot. */
struct proc *rp; /* iterate over process table */
int src_id;
- sys_map_t *map;
/* Tell processes that sent asynchronous messages to 'rc' they are not
* going to be delivered */
- map = &priv(rc)->s_asyn_pending;
- while ((src_id = has_pending(map, ANY)) != NULL_PRIV_ID)
+ while ((src_id = has_pending_asend(rc, ANY)) != NULL_PRIV_ID)
cancel_async(proc_addr(id_to_nr(src_id)), rc);
for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; rp++) {