FreeBSD/sys/x86/x86/mp_x86.c
/*
 * Print various information about the SMP system hardware and setup.
 */
Print various information about the SMP system hardware and setup.
Print various information about the SMP system hardware and setup .
void
cpu_mp_announce(void)
{
	struct topo_node *node;
	const char *hyperthread;
	int pkg_count;
	int cores_per_pkg;
	int thrs_per_core;
	printf("FreeBSD/SMP: ");
	if (topo_analyze(&topo_root, 1, &pkg_count,
	    &cores_per_pkg, &thrs_per_core)) {
		printf("%d package(s)", pkg_count);
		if (cores_per_pkg > 0)
			printf(" x %d core(s)", cores_per_pkg);
		if (thrs_per_core > 1)
		    printf(" x %d hardware threads", thrs_per_core);
	} else {
		printf("Non-uniform topology");
	}
	printf("\n");
	if (disabled_cpus) {
		printf("FreeBSD/SMP Online: ");
		if (topo_analyze(&topo_root, 0, &pkg_count,
		    &cores_per_pkg, &thrs_per_core)) {
			printf("%d package(s)", pkg_count);
			if (cores_per_pkg > 0)
				printf(" x %d core(s)", cores_per_pkg);
			if (thrs_per_core > 1)
			    printf(" x %d hardware threads", thrs_per_core);
		} else {
			printf("Non-uniform topology");
		}
		printf("\n");
	}
	if (!bootverbose)
		return;
	TOPO_FOREACH(node, &topo_root) {
		switch (node->type) {
		case TOPO_TYPE_PKG:
			printf("Package HW ID = %u (%#x)\n",
			    node->hwid, node->hwid);
			break;
		case TOPO_TYPE_CORE:
			printf("\tCore HW ID = %u (%#x)\n",
			    node->hwid, node->hwid);
			break;
		case TOPO_TYPE_PU:
			if (cpu_info[node->hwid].cpu_hyperthread)
				hyperthread = "/HT";
			else
				hyperthread = "";
			if (node->subtype == 0)
				printf("\t\tCPU (AP%s): APIC ID: %u (%#x)"
				    "(disabled)\n", hyperthread, node->hwid,
				    node->hwid);
			else if (node->id == 0)
				printf("\t\tCPU0 (BSP): APIC ID: %u (%#x)\n",
				    node->hwid, node->hwid);
			else
				printf("\t\tCPU%u (AP%s): APIC ID: %u (%#x)\n",
				    node->id, hyperthread, node->hwid,
				    node->hwid);
			break;
		default:
			break;
		}
	}
}
void cpu_mp_announce ( void ) { struct topo_node * node ; const char * hyperthread ; int pkg_count ; int cores_per_pkg ; int thrs_per_core ; printf ( " " ) ; if ( topo_analyze ( & topo_root , 1 , & pkg_count , & cores_per_pkg , & thrs_per_core ) ) { printf ( " " , pkg_count ) ; if ( cores_per_pkg > 0 ) printf ( " " , cores_per_pkg ) ; if ( thrs_per_core > 1 ) printf ( " " , thrs_per_core ) ; } else { printf ( " " ) ; } printf ( " \n " ) ; if ( disabled_cpus ) { printf ( " " ) ; if ( topo_analyze ( & topo_root , 0 , & pkg_count , & cores_per_pkg , & thrs_per_core ) ) { printf ( " " , pkg_count ) ; if ( cores_per_pkg > 0 ) printf ( " " , cores_per_pkg ) ; if ( thrs_per_core > 1 ) printf ( " " , thrs_per_core ) ; } else { printf ( " " ) ; } printf ( " \n " ) ; } if ( ! bootverbose ) return ; TOPO_FOREACH ( node , & topo_root ) { switch ( node -> type ) { case TOPO_TYPE_PKG : printf ( " \n " , node -> hwid , node -> hwid ) ; break ; case TOPO_TYPE_CORE : printf ( " \t \n " , node -> hwid , node -> hwid ) ; break ; case TOPO_TYPE_PU : if ( cpu_info [ node -> hwid ] . cpu_hyperthread ) hyperthread = " " ; else hyperthread = " " ; if ( node -> subtype == 0 ) printf ( " \t \t " " \n " , hyperthread , node -> hwid , node -> hwid ) ; else if ( node -> id == 0 ) printf ( " \t \t \n " , node -> hwid , node -> hwid ) ; else printf ( " \t \t \n " , node -> id , hyperthread , node -> hwid , node -> hwid ) ; break ; default : break ; } } }
Print various information about the SMP system hardware and setup.
Print various information about the SMP system hardware and setup .
/* ignored */