| 65 | #define PMU_IESR_C 0x80000000 /* Cycle Counter */ |
| 66 | |
| 67 | static int |
| 68 | pmu_intr(void *arg) |
| 69 | { |
| 70 | #ifdef HWPMC_HOOKS |
| 71 | struct trapframe *tf; |
| 72 | #endif |
| 73 | uint32_t r; |
| 74 | #if defined(__arm__) && (__ARM_ARCH > 6) |
| 75 | u_int cpu; |
| 76 | |
| 77 | cpu = PCPU_GET(cpuid); |
| 78 | |
| 79 | r = cp15_pmovsr_get(); |
| 80 | if (r & PMU_OVSR_C) { |
| 81 | atomic_add_32(&ccnt_hi[cpu], 1); |
| 82 | /* Clear the event. */ |
| 83 | r &= ~PMU_OVSR_C; |
| 84 | cp15_pmovsr_set(PMU_OVSR_C); |
| 85 | } |
| 86 | #else |
| 87 | r = 1; |
| 88 | #endif |
| 89 | |
| 90 | #ifdef HWPMC_HOOKS |
| 91 | /* Only call into the HWPMC framework if we know there is work. */ |
| 92 | if (r != 0 && pmc_intr) { |
| 93 | tf = arg; |
| 94 | (*pmc_intr)(tf); |
| 95 | } |
| 96 | #endif |
| 97 | |
| 98 | return (FILTER_HANDLED); |
| 99 | } |
| 100 | |
| 101 | int |
| 102 | pmu_attach(device_t dev) |
nothing calls this directly
no test coverage detected