• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/osfmk/ipc/

Lines Matching refs:space

96 	ipc_space_t		space,
103 * in the space's tree. That is, returns TRUE
107 * The space is locked (read or write) and active.
112 ipc_space_t space,
118 assert(space->is_active);
125 ipc_splay_tree_bounds(&space->is_tree, name, &lower, &upper);
138 * The space must be read or write locked throughout.
139 * The space must be active.
144 ipc_space_t space,
150 assert(space->is_active);
155 * If space is fast, we assume no splay tree and name within table
159 if (is_fast_space(space)) {
160 entry = &space->is_table[index];
166 if (index < space->is_table_size) {
167 entry = &space->is_table[index];
170 assert(space->is_tree_total > 0);
176 } else if (space->is_tree_total == 0)
181 ipc_splay_tree_lookup(&space->is_tree, name);
182 /* with sub-space introduction, an entry may appear in */
197 * Tries to allocate an entry out of the space.
199 * The space is write-locked and active throughout.
208 ipc_space_t space,
216 assert(space->is_active);
219 table = space->is_table;
261 * Allocate an entry out of the space.
263 * The space is not locked before, but it is write-locked after
267 * KERN_INVALID_TASK The space is dead.
268 * KERN_NO_SPACE No room for an entry in the space.
274 ipc_space_t space,
280 is_write_lock(space);
283 if (!space->is_active) {
284 is_write_unlock(space);
288 kr = ipc_entry_get(space, namep, entryp);
292 kr = ipc_entry_grow_table(space, ITS_SIZE_NONE);
294 return kr; /* space is unlocked */
304 * The space is not locked before, but it is write-locked after
309 * KERN_INVALID_TASK The space is dead.
315 ipc_space_t space,
326 is_write_lock(space);
333 if (!space->is_active) {
334 is_write_unlock(space);
346 * For a task with a "fast" IPC space, we disallow
349 if (index < space->is_table_size) {
350 ipc_entry_t table = space->is_table;
384 if (is_fast_space(space))
393 * In a fast space, ipc_entry_alloc_name may be
395 * known in this space.
397 if (is_fast_space(space)) {
398 is_write_unlock(space);
411 if ((space->is_tree_total > 0) &&
412 ((tentry2 = ipc_splay_tree_lookup(&space->is_tree, name))
414 assert(tentry2->ite_space == space);
422 its = space->is_table_next;
427 * Note that if space->is_table_size == its->its_size,
436 if ((space->is_table_size <= index) &&
438 (((its->its_size - space->is_table_size) *
440 ((space->is_tree_small + 1) *
445 * Can save space by growing the table.
446 * Because the space will be unlocked,
450 kr = ipc_entry_grow_table(space, ITS_SIZE_NONE);
453 /* space is unlocked */
468 space->is_tree_total++;
470 if (index < space->is_table_size) {
471 entry = &space->is_table[index];
474 !ipc_entry_tree_collision(space, name))
475 space->is_tree_small++;
477 ipc_splay_tree_insert(&space->is_tree, name, tentry);
481 tentry->ite_space = space;
490 is_write_unlock(space);
494 is_write_lock(space);
501 * Deallocates an entry from a space.
503 * The space must be write-locked throughout.
504 * The space must be active.
509 ipc_space_t space,
517 assert(space->is_active);
522 table = space->is_table;
523 size = space->is_table_size;
525 if (is_fast_space(space)) {
549 ipc_splay_tree_split(&space->is_tree,
565 assert(tentry->ite_space == space);
568 ipc_hash_global_delete(space, obj,
570 ipc_hash_local_insert(space, obj,
576 assert(space->is_tree_total > 0);
577 space->is_tree_total--;
585 ipc_splay_tree_join(&space->is_tree,
589 ipc_splay_tree_join(&space->is_tree, &small);
600 assert(tentry->ite_space == space);
602 ipc_splay_tree_delete(&space->is_tree, name, tentry);
604 assert(space->is_tree_total > 0);
605 space->is_tree_total--;
612 if (!ipc_entry_tree_collision(space, name))
615 } else if ((index < space->is_table_next->its_size) &&
616 !ipc_entry_tree_collision(space, name)) {
618 assert(space->is_tree_small > 0);
620 space->is_tree_small--;
628 * Grows the table in a space.
630 * The space must be write-locked and active before.
636 * KERN_SUCCESS The space died.
643 ipc_space_t space,
655 assert(space->is_active);
657 if (space->is_growing) {
663 is_write_sleep(space);
667 otable = space->is_table;
669 its = space->is_table_next;
686 is_write_unlock(space);
697 is_write_unlock(space);
703 is_write_unlock(space);
718 space->is_growing = TRUE;
719 is_write_unlock(space);
729 is_write_lock(space);
730 space->is_growing = FALSE;
733 * We need to do a wakeup on the space,
735 * this until the space is unlocked,
740 is_write_unlock(space);
741 thread_wakeup((event_t) space);
745 if (!space->is_active) {
747 * The space died while it was unlocked.
750 is_write_unlock(space);
751 thread_wakeup((event_t) space);
753 is_write_lock(space);
757 assert(space->is_table == otable);
758 assert((space->is_table_next == its) ||
760 assert(space->is_table_size == osize);
762 space->is_table = table;
763 space->is_table_size = size;
764 space->is_table_next = nits;
789 ipc_hash_local_insert(space, entry->ie_object,
800 assert(!is_fast_space(space) || space->is_tree_total == 0);
801 if (space->is_tree_total > 0) {
826 ipc_splay_tree_split(&space->is_tree,
853 assert(tentry->ite_space == space);
874 ipc_hash_global_delete(space, obj,
876 ipc_hash_local_insert(space, obj,
879 space->is_tree_total--;
902 assert(nosmall <= space->is_tree_total);
903 space->is_tree_small = nosmall;
907 ipc_splay_tree_join(&space->is_tree, &small);
908 ipc_splay_tree_join(&space->is_tree, &move);
909 ipc_splay_tree_join(&space->is_tree, &ignore);
933 * If the space dies or grows while unlocked,
936 is_write_unlock(space);
937 thread_wakeup((event_t) space);
940 is_write_lock(space);
941 if (!space->is_active || (space->is_table_next != nits))
950 * space->is_tree_small == 0.
952 } while ((space->is_tree_small > 0) &&
954 (space->is_tree_small * sizeof(struct ipc_tree_entry))));
974 ipc_space_t space = task->itk_space;
978 entry = ipc_entry_lookup(space, name);