Lines Matching defs:new_task
330 task_t new_task;
333 new_task = (task_t) zalloc(task_zone);
335 if (new_task == TASK_NULL)
339 new_task->ref_count = 2;
342 new_task->map = vm_map_fork(parent_task->map);
344 new_task->map = vm_map_create(pmap_create(0, is_64bit),
350 vm_map_set_user_wire_limit(new_task->map, parent_task->map->user_wire_limit);
352 mutex_init(&new_task->lock, 0);
353 queue_init(&new_task->threads);
354 new_task->suspend_count = 0;
355 new_task->thread_count = 0;
356 new_task->active_thread_count = 0;
357 new_task->user_stop_count = 0;
358 new_task->pset_hint = PROCESSOR_SET_NULL;
359 new_task->role = TASK_UNSPECIFIED;
360 new_task->active = TRUE;
361 new_task->user_data = NULL;
362 new_task->faults = 0;
363 new_task->cow_faults = 0;
364 new_task->pageins = 0;
365 new_task->messages_sent = 0;
366 new_task->messages_received = 0;
367 new_task->syscalls_mach = 0;
368 new_task->priv_flags = 0;
369 new_task->syscalls_unix=0;
370 new_task->c_switch = new_task->p_switch = new_task->ps_switch = 0;
371 new_task->taskFeatures[0] = 0; /* Init task features */
372 new_task->taskFeatures[1] = 0; /* Init task features */
375 new_task->bsd_info = NULL;
379 new_task->i386_ldt = 0;
383 if(BootProcInfo.pf.Available & pf64Bit) new_task->taskFeatures[0] |= tf64BitData; /* If 64-bit machine, show we have 64-bit registers at least */
386 queue_init(&new_task->semaphore_list);
387 queue_init(&new_task->lock_set_list);
388 new_task->semaphores_owned = 0;
389 new_task->lock_sets_owned = 0;
392 /*mutex_init(&new_task->labellock, ETAP_NO_TRACE);*/
393 new_task->label = labelh_new(1);
394 mac_task_label_init (&new_task->maclabel);
397 ipc_task_init(new_task, parent_task);
399 new_task->total_user_time = 0;
400 new_task->total_system_time = 0;
402 new_task->vtimers = 0;
404 new_task->shared_region = NULL;
406 new_task->affinity_space = NULL;
409 new_task->sec_token = parent_task->sec_token;
410 new_task->audit_token = parent_task->audit_token;
414 vm_shared_region_set(new_task, shared_region);
416 new_task->wired_ledger_port = ledger_copy(
418 new_task->paged_ledger_port = ledger_copy(
421 task_set_64BitAddr(new_task);
425 new_task->i386_ldt = user_ldt_copy(parent_task->i386_ldt);
428 task_affinity_create(parent_task, new_task);
431 new_task->sec_token = KERNEL_SECURITY_TOKEN;
432 new_task->audit_token = KERNEL_AUDIT_TOKEN;
433 new_task->wired_ledger_port = ledger_copy(root_wired_ledger);
434 new_task->paged_ledger_port = ledger_copy(root_paged_ledger);
438 new_task->priority = BASEPRI_KERNEL;
439 new_task->max_priority = MAXPRI_KERNEL;
442 new_task->priority = BASEPRI_DEFAULT;
443 new_task->max_priority = MAXPRI_USER;
447 queue_enter(&tasks, new_task, task_t, tasks);
452 new_task->priv_flags |= (parent_task->priv_flags&VM_BACKING_STORE_PRIV);
454 ipc_task_enable(new_task);
456 *child_task = new_task;