arch/parisc/kernel/topology.c

Source file repositories/reference/linux-study-clean/arch/parisc/kernel/topology.c

File Facts

System
Linux kernel
Corpus path
arch/parisc/kernel/topology.c
Extension
.c
Size
2252 bytes
Lines
88
Domain
Architecture Layer
Bucket
arch/parisc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (cpuinfo->cpu_loc == p->cpu_loc) {
			cpuid_topo->core_id = cpu_topology[cpu].core_id;
			if (p->cpu_loc) {
				cpuid_topo->core_id++;
				cpuid_topo->package_id = cpu_topology[cpu].package_id;
				continue;
			}
		}

		if (cpuid_topo->package_id == -1)
			max_socket = max(max_socket, cpu_topology[cpu].package_id);
	}

	if (cpuid_topo->package_id == -1)
		cpuid_topo->package_id = max_socket + 1;

	update_siblings_masks(cpuid);

	pr_info("CPU%u: cpu core %d of socket %d\n",
		cpuid,
		cpu_topology[cpuid].core_id,
		cpu_topology[cpuid].package_id);
}

/*
 * init_cpu_topology is called at boot when only one cpu is running
 * which prevent simultaneous write access to cpu_topology array
 */
void __init init_cpu_topology(void)
{
	reset_cpu_topology();
}

Annotation

Implementation Notes