| 172 | } |
| 173 | |
| 174 | int |
| 175 | perfmon_start(int pmc) |
| 176 | { |
| 177 | register_t saveintr; |
| 178 | |
| 179 | if (pmc < 0 || pmc >= NPMC) |
| 180 | return EINVAL; |
| 181 | |
| 182 | if (perfmon_inuse & (1 << pmc)) { |
| 183 | saveintr = intr_disable(); |
| 184 | ctl_shadow[pmc] |= (PMCF_EN << 16); |
| 185 | wrmsr(msr_pmc[pmc], pmc_shadow[pmc]); |
| 186 | writectl(pmc); |
| 187 | intr_restore(saveintr); |
| 188 | return 0; |
| 189 | } |
| 190 | return EBUSY; |
| 191 | } |
| 192 | |
| 193 | int |
| 194 | perfmon_stop(int pmc) |
no test coverage detected