--- Gnu-Mach/ipc/ipc_entry.c 2020/09/02 04:36:56 1.1.1.1 +++ Gnu-Mach/ipc/ipc_entry.c 2020/09/02 04:47:21 1.1.1.4 @@ -25,7 +25,7 @@ * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. - * + */ /* * File: ipc/ipc_entry.c * Author: Rich Draves @@ -34,11 +34,14 @@ * Primitive functions to manipulate translation entries. */ +#include +#include + #include #include #include #include -#include +#include #include #include #include @@ -48,7 +51,7 @@ #include #include -zone_t ipc_tree_entry_zone; +struct kmem_cache ipc_tree_entry_cache; /* * Routine: ipc_entry_tree_collision @@ -93,9 +96,9 @@ ipc_entry_tree_collision( */ ipc_entry_t -ipc_entry_lookup(space, name) - ipc_space_t space; - mach_port_t name; +ipc_entry_lookup( + ipc_space_t space, + mach_port_t name) { mach_port_index_t index; ipc_entry_t entry; @@ -137,10 +140,10 @@ ipc_entry_lookup(space, name) */ kern_return_t -ipc_entry_get(space, namep, entryp) - ipc_space_t space; - mach_port_t *namep; - ipc_entry_t *entryp; +ipc_entry_get( + ipc_space_t space, + mach_port_t *namep, + ipc_entry_t *entryp) { ipc_entry_t table; mach_port_index_t first_free; @@ -539,8 +542,7 @@ ipc_entry_dealloc( */ kern_return_t -ipc_entry_grow_table(space) - ipc_space_t space; +ipc_entry_grow_table(ipc_space_t space) { ipc_entry_num_t osize, size, nsize; @@ -574,6 +576,7 @@ ipc_entry_grow_table(space) if (osize == size) { is_write_unlock(space); + printf_once("no more room for ipc_entry_grow_table in space %p\n", space); return KERN_NO_SPACE; } @@ -635,7 +638,7 @@ ipc_entry_grow_table(space) */ if (!it_entries_reallocable(oits)) - (void) memcpy((void *) table, (const void *) otable, + memcpy(table, otable, osize * sizeof(struct ipc_entry)); for (i = 0; i < osize; i++) @@ -831,16 +834,13 @@ ipc_entry_grow_table(space) #if MACH_KDB #include -#define printf kdbprintf - -ipc_entry_t db_ipc_object_by_name( - task_t task, - mach_port_t name); +#include +#define printf kdbprintf ipc_entry_t db_ipc_object_by_name( - task_t task, + const task_t task, mach_port_t name) { ipc_space_t space = task->itk_space;