/* BSD KERN COMPONENT INTERFACE */
-task_t bsd_init_task = TASK_NULL;
extern unsigned int not_in_kdp; /* Skip acquiring locks if we're in kdp */
thread_t get_firstthread(task_t);
/*
* Swap in a new map for the task/thread pair; the old map reference is
- * returned.
+ * returned. Also does a pmap switch if thread provided is current thread.
*/
vm_map_t
-swap_task_map(task_t task, thread_t thread, vm_map_t map, boolean_t doswitch)
+swap_task_map(task_t task, thread_t thread, vm_map_t map)
{
vm_map_t old_map;
+ boolean_t doswitch = (thread == current_thread()) ? TRUE : FALSE;
if (task != thread->task)
panic("swap_task_map");