Lines Matching refs:new_task
400 task_t new_task;
404 new_task = (task_t) zalloc(task_zone);
406 if (new_task == TASK_NULL)
410 new_task->ref_count = 2;
416 zfree(task_zone, new_task);
419 new_task->ledger = ledger;
423 new_task->map = vm_map_fork(ledger, parent_task->map);
425 new_task->map = vm_map_create(pmap_create(ledger, 0, is_64bit),
431 vm_map_set_user_wire_limit(new_task->map, (vm_size_t)parent_task->map->user_wire_limit);
433 lck_mtx_init(&new_task->lock, &task_lck_grp, &task_lck_attr);
434 queue_init(&new_task->threads);
435 new_task->suspend_count = 0;
436 new_task->thread_count = 0;
437 new_task->active_thread_count = 0;
438 new_task->user_stop_count = 0;
439 new_task->role = TASK_UNSPECIFIED;
440 new_task->active = TRUE;
441 new_task->halting = FALSE;
442 new_task->user_data = NULL;
443 new_task->faults = 0;
444 new_task->cow_faults = 0;
445 new_task->pageins = 0;
446 new_task->messages_sent = 0;
447 new_task->messages_received = 0;
448 new_task->syscalls_mach = 0;
449 new_task->priv_flags = 0;
450 new_task->syscalls_unix=0;
451 new_task->c_switch = new_task->p_switch = new_task->ps_switch = 0;
452 new_task->taskFeatures[0] = 0; /* Init task features */
453 new_task->taskFeatures[1] = 0; /* Init task features */
455 zinfo_task_init(new_task);
458 new_task->bsd_info = NULL;
462 new_task->i386_ldt = 0;
463 new_task->task_debug = NULL;
467 queue_init(&new_task->semaphore_list);
468 queue_init(&new_task->lock_set_list);
469 new_task->semaphores_owned = 0;
470 new_task->lock_sets_owned = 0;
473 new_task->label = labelh_new(1);
474 mac_task_label_init (&new_task->maclabel);
477 ipc_task_init(new_task, parent_task);
479 new_task->total_user_time = 0;
480 new_task->total_system_time = 0;
482 new_task->vtimers = 0;
484 new_task->shared_region = NULL;
486 new_task->affinity_space = NULL;
489 new_task->t_chud = 0U;
492 new_task->pidsuspended = FALSE;
493 new_task->frozen = FALSE;
494 new_task->rusage_cpu_flags = 0;
495 new_task->rusage_cpu_percentage = 0;
496 new_task->rusage_cpu_interval = 0;
497 new_task->rusage_cpu_deadline = 0;
498 new_task->rusage_cpu_callt = NULL;
499 new_task->proc_terminate = 0;
501 queue_init(&new_task->task_watchers);
502 new_task->appstate = TASK_APPSTATE_ACTIVE;
503 new_task->num_taskwatchers = 0;
504 new_task->watchapplying = 0;
507 new_task->uexc_range_start = new_task->uexc_range_size = new_task->uexc_handler = 0;
510 new_task->sec_token = parent_task->sec_token;
511 new_task->audit_token = parent_task->audit_token;
515 vm_shared_region_set(new_task, shared_region);
518 task_set_64BitAddr(new_task);
519 new_task->all_image_info_addr = parent_task->all_image_info_addr;
520 new_task->all_image_info_size = parent_task->all_image_info_size;
524 new_task->i386_ldt = user_ldt_copy(parent_task->i386_ldt);
527 task_affinity_create(parent_task, new_task);
529 new_task->pset_hint = parent_task->pset_hint = task_choose_pset(parent_task);
530 new_task->policystate = parent_task->policystate;
532 new_task->appliedstate = parent_task->appliedstate;
533 new_task->ext_policystate = parent_task->ext_policystate;
536 new_task->ext_appliedstate = parent_task->ext_appliedstate;
538 new_task->ext_appliedstate = default_task_null_policy;
542 new_task->sec_token = KERNEL_SECURITY_TOKEN;
543 new_task->audit_token = KERNEL_AUDIT_TOKEN;
546 task_set_64BitAddr(new_task);
548 new_task->all_image_info_addr = (mach_vm_address_t)0;
549 new_task->all_image_info_size = (mach_vm_size_t)0;
551 new_task->pset_hint = PROCESSOR_SET_NULL;
552 new_task->policystate = default_task_proc_policy;
553 new_task->ext_policystate = default_task_proc_policy;
554 new_task->appliedstate = default_task_null_policy;
555 new_task->ext_appliedstate = default_task_null_policy;
559 new_task->priority = BASEPRI_KERNEL;
560 new_task->max_priority = MAXPRI_KERNEL;
563 new_task->priority = BASEPRI_DEFAULT;
564 new_task->max_priority = MAXPRI_USER;
567 bzero(&new_task->extmod_statistics, sizeof(new_task->extmod_statistics));
568 new_task->task_timer_wakeups_bin_1 = new_task->task_timer_wakeups_bin_2 = 0;
571 queue_enter(&tasks, new_task, task_t, tasks);
576 new_task->priv_flags |= (parent_task->priv_flags&VM_BACKING_STORE_PRIV);
578 ipc_task_enable(new_task);
580 *child_task = new_task;