Lines Matching refs:core

182      * Compute the number of threads (logical CPUs) per core.
342 lcpu->core = NULL;
356 x86_core_t *core;
363 core = free_cores;
364 free_cores = core->next_in_die;
365 core->next_in_die = NULL;
369 core = kalloc(sizeof(x86_core_t));
370 if (core == NULL)
374 bzero((void *) core, sizeof(x86_core_t));
376 core->pcore_num = cpup->cpu_phys_number / topoParms.nPThreadsPerCore;
377 core->lcore_num = core->pcore_num % topoParms.nPCoresPerPackage;
379 core->flags = X86CORE_FL_PRESENT | X86CORE_FL_READY
382 return(core);
386 x86_core_free(x86_core_t *core)
389 core->next_in_die = free_cores;
390 free_cores = core;
444 x86_core_t *core;
457 core = die->cores;
458 while (core != NULL) {
459 if (core->pcore_num == core_num)
461 core = core->next_in_die;
464 return(core);
470 x86_core_t *core = lcpu->core;
474 assert(core != NULL);
485 core->pcore_num = lnum / topoParms.nLThreadsPerCore;
486 core->lcore_num = core->pcore_num % topoParms.nLCoresPerDie;
608 x86_core_t *core;
656 * Assume that L{LLC-1} are all at the core level and that
661 * Shared at the core.
663 core = lcpu->core;
664 cur_lcpu = core->lcpus;
732 x86_core_add_lcpu(x86_core_t *core, x86_lcpu_t *lcpu)
734 assert(core != NULL);
739 lcpu->next_in_core = core->lcpus;
740 lcpu->core = core;
741 core->lcpus = lcpu;
742 core->num_lcpus += 1;
758 x86_die_add_core(x86_die_t *die, x86_core_t *core)
761 assert(core != NULL);
763 core->next_in_die = die->cores;
764 core->die = die;
765 die->cores = core;
781 x86_package_add_core(x86_pkg_t *pkg, x86_core_t *core)
784 assert(core != NULL);
786 core->next_in_pkg = pkg->cores;
787 core->package = pkg;
788 pkg->cores = core;
806 x86_core_t *core = NULL;
888 * Get the core for this logical CPU.
891 core = x86_core_find(cpu);
892 if (core == NULL) {
894 * Allocate the core structure now.
897 core = x86_core_alloc(cpu);
900 x86_core_free(core);
905 * Add the core to the die & package.
907 x86_die_add_core(die, core);
908 x86_package_add_core(pkg, core);
911 } while (core == NULL);
923 x86_core_add_lcpu(core, &cpup->lcpu);
924 x86_die_add_lcpu(core->die, &cpup->lcpu);
925 x86_package_add_lcpu(core->package, &cpup->lcpu);
928 return (void *) core;
936 x86_core_t *core;
949 cpup->lcpu.core = cpu_thread_alloc(my_cpu);
957 core = cpup->lcpu.core;
960 if (core->active_lcpus == 0)
962 core->active_lcpus += 1;
976 x86_core_t *core;
981 core = cpup->lcpu.core;
982 core->active_lcpus -= 1;
983 if (core->active_lcpus == 0)
1007 x86_core_t *core;
1055 core = die->cores;
1056 while (core != NULL) {
1057 if (core->die == NULL)
1059 core->pcore_num);
1060 if (core->die != die)
1062 core->pcore_num, core->die->pdie_num, die->pdie_num);
1064 TOPO_DBG("%d ", core->pcore_num);
1065 core = core->next_in_die;
1108 core = pkg->cores;
1109 while (core != NULL) {
1110 if (core->package == NULL)
1112 core->pcore_num);
1113 if (core->package != pkg)
1115 core->pcore_num, core->package->lpkg_num, pkg->lpkg_num);
1117 core->pcore_num, pkg->lpkg_num);
1120 * Make sure that the core has the correct number of CPUs.
1123 lcpu = core->lcpus;
1124 TOPO_DBG("Core(%d)->lcpus: ", core->pcore_num);
1126 if (lcpu->core == NULL)
1127 panic("CPU(%d)->core is NULL",
1129 if (lcpu->core != core)
1130 panic("CPU %d points to core %d, should be %d",
1131 lcpu->cpu_num, lcpu->core->pcore_num, core->pcore_num);
1140 topoParms.nLThreadsPerCore, nCPUs, core->pcore_num);
1142 core = core->next_in_pkg;
1183 x86_core_t *core;
1198 core = die->cores;
1199 while (core != NULL) {
1201 kprintf(" Physical: %d\n", core->pcore_num);
1202 kprintf(" Logical: %d\n", core->lcore_num);
1204 cpu = core->lcpus;
1222 core = core->next_in_die;