Lines Matching refs:cp

102 common_startup_init(cpu_t *cp, int cpuid)  in common_startup_init()  argument
121 THREAD_ONPROC(tp, cp); in common_startup_init()
123 tp->t_bound_cpu = cp; in common_startup_init()
125 tp->t_cpu = cp; in common_startup_init()
126 tp->t_disp_queue = cp->cpu_disp; in common_startup_init()
138 cp->cpu_id = cpuid; in common_startup_init()
139 cp->cpu_self = cp; in common_startup_init()
140 cp->cpu_thread = tp; in common_startup_init()
141 cp->cpu_lwp = NULL; in common_startup_init()
142 cp->cpu_dispthread = tp; in common_startup_init()
143 cp->cpu_dispatch_pri = DISP_PRIO(tp); in common_startup_init()
144 cp->cpu_startup_thread = tp; in common_startup_init()
155 cp->cpu_m.poke_cpu_outstanding = B_TRUE; in common_startup_init()
165 cpu_t *cp; in cold_flag_set() local
169 cp = cpu[cpuid]; in cold_flag_set()
171 if (!(cp->cpu_flags & CPU_ENABLE)) in cold_flag_set()
174 cp->cpu_flags |= CPU_RUNNING | CPU_ENABLE | CPU_EXISTS; in cold_flag_set()
175 cpu_add_active(cp); in cold_flag_set()
180 cp->cpu_flags |= CPU_READY; /* ready */ in cold_flag_set()
181 cpu_set_state(cp); in cold_flag_set()
187 cpu_t *cp; in warm_flag_set() local
194 cp = cpu[cpuid]; in warm_flag_set()
195 cp->cpu_flags |= CPU_RUNNING | CPU_READY | CPU_EXISTS in warm_flag_set()
197 cpu_set_state(cp); in warm_flag_set()
290 struct cpu *cp = NULL; in setup_cpu_common() local
338 cp = &cpu0; in setup_cpu_common()
347 cp = cpus; in setup_cpu_common()
348 if (cp->cpu_next_free) in setup_cpu_common()
349 cpus = cp->cpu_next_free; in setup_cpu_common()
355 if (cp == NULL) in setup_cpu_common()
356 cp = vmem_xalloc(static_alloc_arena, CPU_ALLOC_SIZE, in setup_cpu_common()
359 bzero(cp, sizeof (*cp)); in setup_cpu_common()
361 cp->cpu_id = cpuid; in setup_cpu_common()
362 cp->cpu_self = cp; in setup_cpu_common()
367 ptl1_init_cpu(cp); in setup_cpu_common()
372 disp_cpu_init(cp); in setup_cpu_common()
377 pg_cpu_bootstrap(cp); in setup_cpu_common()
379 cpu_vm_data_init(cp); in setup_cpu_common()
386 cp->cpu_idle_thread = tp; in setup_cpu_common()
389 tp->t_bound_cpu = cp; in setup_cpu_common()
391 tp->t_cpu = cp; in setup_cpu_common()
392 tp->t_disp_queue = cp->cpu_disp; in setup_cpu_common()
404 init_cpu_info(cp); in setup_cpu_common()
409 cpu_intr_alloc(cp, NINTR_THREADS); in setup_cpu_common()
415 cpu_add_unit(cp); in setup_cpu_common()
421 cpu_init_private(cp); in setup_cpu_common()
422 populate_idstr(cp); in setup_cpu_common()
427 pghw_physid_create(cp); in setup_cpu_common()
428 (void) pg_cpu_init(cp, B_FALSE); in setup_cpu_common()
430 if ((rval = cpu_intrq_setup(cp)) != 0) { in setup_cpu_common()
437 sfmmu_cpu_init(cp); in setup_cpu_common()
448 struct cpu *cp; in cleanup_cpu_common() local
458 cp = cpu[cpuid]; in cleanup_cpu_common()
461 cpu_uninit_private(cp); in cleanup_cpu_common()
464 if (cp->cpu_idstr) in cleanup_cpu_common()
465 kmem_free(cp->cpu_idstr, strlen(cp->cpu_idstr) + 1); in cleanup_cpu_common()
466 if (cp->cpu_brandstr) in cleanup_cpu_common()
467 kmem_free(cp->cpu_brandstr, strlen(cp->cpu_brandstr) + 1); in cleanup_cpu_common()
469 cpu_vm_data_destroy(cp); in cleanup_cpu_common()
479 cpu_intrq_cleanup(cp); in cleanup_cpu_common()
486 cpu_destroy_bound_threads(cp); in cleanup_cpu_common()
491 segkp_release(segkp, cp->cpu_intr_stack); in cleanup_cpu_common()
526 disp_cpu_fini(cp); in cleanup_cpu_common()
528 if (CPU_MMU_CTXP(cp)) in cleanup_cpu_common()
529 sfmmu_cpu_cleanup(cp); in cleanup_cpu_common()
530 bzero(cp, sizeof (*cp)); in cleanup_cpu_common()
535 if (cp != &cpu0) { in cleanup_cpu_common()
537 cp->cpu_next_free = cpus; in cleanup_cpu_common()
538 cpus = cp; in cleanup_cpu_common()
541 cpus = cp; in cleanup_cpu_common()
554 struct cpu *cp; in restart_other_cpu() local
565 cp = cpu[cpuid]; in restart_other_cpu()
567 common_startup_init(cp, cpuid); in restart_other_cpu()
575 cp->cpu_intr_actv = 0; /* clear the value from previous life */ in restart_other_cpu()
576 cp->cpu_m.mutex_ready = 0; /* we are not ready yet */ in restart_other_cpu()
577 lock_clear(&cp->cpu_idle_thread->t_lock); in restart_other_cpu()
578 tp = cp->cpu_idle_thread; in restart_other_cpu()
603 struct cpu *cp = CPU; in slave_startup() local
604 ushort_t original_flags = cp->cpu_flags; in slave_startup()
606 mach_htraptrace_configure(cp->cpu_id); in slave_startup()
608 cp->cpu_m.mutex_ready = 1; in slave_startup()
611 CPUSET_ADD(proxy_ready_set, cp->cpu_id); in slave_startup()
617 kdi_dvec_cpu_init(cp); in slave_startup()
627 while (!CPU_IN_SET(cpu_ready_set, cp->cpu_id)) in slave_startup()
633 cp->cpu_m.poke_cpu_outstanding = B_FALSE; in slave_startup()
643 CPU_SIGNATURE(OS_SIG, SIGST_RUN, SIGSUBST_NULL, cp->cpu_id); in slave_startup()
649 while (((volatile ushort_t)cp->cpu_flags) & CPU_QUIESCED) in slave_startup()