* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#include <mach/mach_types.h>
+#include <mach/machine/vm_param.h>
#include <kern/kern_types.h>
#include <kern/processor.h>
}
/*
- * The old map reference is returned.
+ * Swap in a new map for the task/thread pair; the old map reference is
+ * returned.
*/
vm_map_t
-swap_task_map(task_t task,vm_map_t map)
+swap_task_map(task_t task, thread_t thread, vm_map_t map)
{
- thread_t thread = current_thread();
vm_map_t old_map;
if (task != thread->task)
thread->map = task->map = map;
task_unlock(task);
+#if (defined(__i386__) || defined(__x86_64__)) && NCOPY_WINDOWS > 0
inval_copy_windows(thread);
+#endif
return old_map;
}
return(t->map->pmap);
}
+/*
+ *
+ */
+uint64_t get_task_resident_size(task_t task)
+{
+ vm_map_t map;
+
+ map = (task == kernel_task) ? kernel_map: task->map;
+ return((uint64_t)pmap_resident_count(map->pmap) * PAGE_SIZE_64);
+}
+
/*
*
*/
!queue_end(&task->threads, (queue_entry_t)thact); ) {
#if defined(__ppc__) || defined(__arm__)
if (thact->machine.cthread_self == thaddr)
-#elif defined (__i386__)
+#elif defined (__i386__) || defined (__x86_64__)
if (thact->machine.pcb->cthread_self == thaddr)
#else
#error architecture not supported
if ((vpp != NULL) && (thact->uthread != NULL))
bsd_threadcdir(thact->uthread, vpp, vidp);
+ bsd_getthreadname(thact->uthread,ptinfo->pth_name);
err = 0;
goto out;
}
!queue_end(&task->threads, (queue_entry_t)thact); ) {
#if defined(__ppc__) || defined(__arm__)
thaddr = thact->machine.cthread_self;
-#elif defined (__i386__)
+#elif defined (__i386__) || defined (__x86_64__)
thaddr = thact->machine.pcb->cthread_self;
#else
#error architecture not supported
out:
task_unlock(task);
- return(numthr * sizeof(uint64_t));
+ return (int)(numthr * sizeof(uint64_t));
}