Beispiel #1
0
/*
 * Return non-zero if the CPU belongs in the given PG
 */
static int
pg_cmt_cpu_belongs(pg_t *pg, cpu_t *cp)
{
	cpu_t	*pg_cpu;

	pg_cpu = GROUP_ACCESS(&pg->pg_cpus, 0);

	ASSERT(pg_cpu != NULL);

	/*
	 * The CPU belongs if, given the nature of the hardware sharing
	 * relationship represented by the PG, the CPU has that
	 * relationship with some other CPU already in the PG
	 */
	if (pg_plat_cpus_share(cp, pg_cpu, ((pghw_t *)pg)->pghw_hw))
		return (1);

	return (0);
}
Beispiel #2
0
int
pg_plat_cpus_share(cpu_t *cpu_a, cpu_t *cpu_b, pghw_type_t hw)
{
	int impl;

	impl = cpunodes[cpu_a->cpu_id].implementation;

	switch (hw) {
	case PGHW_IPIPE:
	case PGHW_CHIP:
		return (pg_plat_hw_instance_id(cpu_a, hw) ==
		    pg_plat_hw_instance_id(cpu_b, hw));
	case PGHW_CACHE:
		if ((IS_PANTHER(impl) || IS_OLYMPUS_C(impl) ||
		    IS_JUPITER(impl)) && pg_plat_cpus_share(cpu_a,
		    cpu_b, PGHW_CHIP)) {
			return (1);
		} else {
			return (0);
		}
	}
	return (0);
}