FreeBSD/sys/dev/hwpmc/hwpmc_x86.c
/*
 * Machine dependent initialization for x86 class platforms.
 */
Machine dependent initialization for x86 class platforms.
Machine dependent initialization for x86 class platforms .
struct pmc_mdep *
pmc_md_initialize()
{
	int i;
	struct pmc_mdep *md;
	if (cpu_vendor_id == CPU_VENDOR_AMD)
		md = pmc_amd_initialize();
	else if (cpu_vendor_id == CPU_VENDOR_INTEL)
		md = pmc_intel_initialize();
	else
		return (NULL);
	if (md != NULL && !lapic_enable_pmc())
		for (i = 0; i < md->pmd_nclass; i++) {
			if (i == PMC_CLASS_INDEX_SOFT)
				continue;
			md->pmd_classdep[i].pcd_caps &= ~PMC_CAP_INTERRUPT;
		}
	return (md);
}
struct pmc_mdep * pmc_md_initialize ( ) { int i ; struct pmc_mdep * md ; if ( cpu_vendor_id == CPU_VENDOR_AMD ) md = pmc_amd_initialize ( ) ; else if ( cpu_vendor_id == CPU_VENDOR_INTEL ) md = pmc_intel_initialize ( ) ; else return ( NULL ) ; if ( md != NULL && ! lapic_enable_pmc ( ) ) for ( i = 0 ; i < md -> pmd_nclass ; i ++ ) { if ( i == PMC_CLASS_INDEX_SOFT ) continue ; md -> pmd_classdep [ i ] . pcd_caps &= ~ PMC_CAP_INTERRUPT ; } return ( md ) ; }
Machine dependent initialization for x86 class platforms.
Machine dependent initialization for x86 class platforms .
/* determine the CPU kind */ /* disallow sampling if we do not have an LAPIC */