MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmu_intr

Function pmu_intr

freebsd/arm/arm/pmu.c:67–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65#define PMU_IESR_C 0x80000000 /* Cycle Counter */
66
67static int
68pmu_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
101int
102pmu_attach(device_t dev)

Callers

nothing calls this directly

Calls 1

atomic_add_32Function · 0.50

Tested by

no test coverage detected