| 5953 | extern struct cpu_group *cpu_top; /* CPU topology */ |
| 5954 | |
| 5955 | static int |
| 5956 | find_child_with_core(int cpu, struct cpu_group *grp) |
| 5957 | { |
| 5958 | int i; |
| 5959 | |
| 5960 | if (grp->cg_children == 0) |
| 5961 | return -1; |
| 5962 | |
| 5963 | MPASS(grp->cg_child); |
| 5964 | for (i = 0; i < grp->cg_children; i++) { |
| 5965 | if (CPU_ISSET(cpu, &grp->cg_child[i].cg_mask)) |
| 5966 | return i; |
| 5967 | } |
| 5968 | |
| 5969 | return -1; |
| 5970 | } |
| 5971 | |
| 5972 | /* |
| 5973 | * Find the nth "close" core to the specified core |