diff options
Diffstat (limited to 'ipc/ipc_space.h')
-rw-r--r-- | ipc/ipc_space.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ipc/ipc_space.h b/ipc/ipc_space.h index b4eb5ba6..22460877 100644 --- a/ipc/ipc_space.h +++ b/ipc/ipc_space.h @@ -47,6 +47,7 @@ #include <kern/lock.h> #include <kern/rdxtree.h> #include <kern/slab.h> +#include <kern/printf.h> #include <ipc/ipc_entry.h> #include <ipc/ipc_types.h> @@ -155,6 +156,18 @@ ipc_entry_lookup( return entry; } +extern volatile boolean_t mach_port_deallocate_debug; + +static inline void +ipc_entry_lookup_failed(mach_port_name_t name) +{ + if (name == MACH_PORT_NULL || name == MACH_PORT_DEAD) + return; + printf("task %.*s looked up a bogus port %lu, most probably a bug.\n", (int) sizeof current_task()->name, current_task()->name, (unsigned long) name); + if (mach_port_deallocate_debug) + SoftDebugger("ipc_entry_lookup"); +} + /* * Routine: ipc_entry_get * Purpose: |