FreeBSD/sys/i386/i386/perfmon.c
/*
 * Must be called after cpu_class is set up.
 */
Must be called after cpu_class is set up.
Must be called after cpu_class is set up .
void
perfmon_init(void)
{
#ifndef SMP
	switch(cpu_class) {
	case CPUCLASS_586:
		perfmon_cpuok = 1;
		msr_ctl[0] = MSR_P5_CESR;
		msr_ctl[1] = MSR_P5_CESR;
		msr_pmc[0] = MSR_P5_CTR0;
		msr_pmc[1] = MSR_P5_CTR1;
		writectl = writectl5;
		break;
	case CPUCLASS_686:
		perfmon_cpuok = 1;
		msr_ctl[0] = MSR_EVNTSEL0;
		msr_ctl[1] = MSR_EVNTSEL1;
		msr_pmc[0] = MSR_PERFCTR0;
		msr_pmc[1] = MSR_PERFCTR1;
		writectl = writectl6;
		break;
	default:
		perfmon_cpuok = 0;
		break;
	}
#endif 
}
void perfmon_init ( void ) { #ifndef SMP switch ( cpu_class ) { case CPUCLASS_586 : perfmon_cpuok = 1 ; msr_ctl [ 0 ] = MSR_P5_CESR ; msr_ctl [ 1 ] = MSR_P5_CESR ; msr_pmc [ 0 ] = MSR_P5_CTR0 ; msr_pmc [ 1 ] = MSR_P5_CTR1 ; writectl = writectl5 ; break ; case CPUCLASS_686 : perfmon_cpuok = 1 ; msr_ctl [ 0 ] = MSR_EVNTSEL0 ; msr_ctl [ 1 ] = MSR_EVNTSEL1 ; msr_pmc [ 0 ] = MSR_PERFCTR0 ; msr_pmc [ 1 ] = MSR_PERFCTR1 ; writectl = writectl6 ; break ; default : perfmon_cpuok = 0 ; break ; } #endif }
Must be called after cpu_class is set up.
Must be called after cpu_class is set up .
/* SMP */