341 |
entry = (struct ipc_entry *) kmem_cache_alloc (ipc_entry_cache); |
entry = (struct ipc_entry *) kmem_cache_alloc (ipc_entry_cache); |
342 |
|
|
343 |
/* Fill entry structure with needed information. */ |
/* Fill entry structure with needed information. */ |
|
|
|
344 |
entry->ie_key = name; |
entry->ie_key = name; |
345 |
entry->ie_port = port; |
entry->ie_port = port; |
346 |
entry->ie_object = object; |
entry->ie_object = object; |
347 |
|
entry->ie_urefs = 1; |
348 |
|
|
349 |
/* Set valid bit and right for port. */ |
/* Set valid bit and right for port. */ |
|
|
|
350 |
entry->ie_bits = IE_BITS_VALID | RTMK_PORT_TYPE_RECEIVE; |
entry->ie_bits = IE_BITS_VALID | RTMK_PORT_TYPE_RECEIVE; |
351 |
|
|
352 |
|
|
353 |
/* We can insert it into the revese lookup hash table. */ |
/* We can insert it into the revese lookup hash table. */ |
|
|
|
354 |
ipc_reverse_insert (object, entry); |
ipc_reverse_insert (object, entry); |
355 |
|
|
356 |
*entryp = entry; |
*entryp = entry; |
357 |
|
|
358 |
/* We can now insert it into the splay-tree */ |
/* We can now insert it into the splay-tree */ |
|
|
|
359 |
ipc_splay_tree_insert (&object->splay_tree, name, entry); |
ipc_splay_tree_insert (&object->splay_tree, name, entry); |
360 |
return true; |
return true; |
361 |
} |
} |
382 |
&& ipc_reverse_lookup (object, port, &entry) == KERN_SUCCESS) |
&& ipc_reverse_lookup (object, port, &entry) == KERN_SUCCESS) |
383 |
{ |
{ |
384 |
entry->ie_bits = entry->ie_bits | convert_name_to_right (msgt); |
entry->ie_bits = entry->ie_bits | convert_name_to_right (msgt); |
385 |
|
entry->ie_urefs++; |
386 |
*namep = entry->ie_key; |
*namep = entry->ie_key; |
387 |
return KERN_SUCCESS; |
return KERN_SUCCESS; |
388 |
} |
} |
395 |
entry->ie_key = *namep; /* XXX just in case */ |
entry->ie_key = *namep; /* XXX just in case */ |
396 |
entry->ie_port = port; |
entry->ie_port = port; |
397 |
entry->ie_object = object; |
entry->ie_object = object; |
398 |
|
entry->ie_urefs = 1; |
399 |
|
|
400 |
/* Set valid bit and right for port. */ |
/* Set valid bit and right for port. */ |
401 |
|
|