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

Function pmu_parse_affinity

freebsd/arm/arm/pmu_fdt.c:89–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89static int
90pmu_parse_affinity(device_t dev, struct pmu_softc *sc, struct pmu_intr *irq,
91 phandle_t xref, uint32_t mpidr)
92{
93 struct pcpu *pcpu;
94 int i, err;
95
96
97 if (xref != 0) {
98 err = OF_getencprop(OF_node_from_xref(xref), "reg", &mpidr,
99 sizeof(mpidr));
100 if (err < 0) {
101 device_printf(dev, "missing 'reg' property\n");
102 return (ENXIO);
103 }
104 }
105
106 for (i = 0; i < MAXCPU; i++) {
107 pcpu = pcpu_find(i);
108 if (pcpu != NULL && pcpu->pc_mpidr == mpidr) {
109 irq->cpuid = i;
110 return (0);
111 }
112 }
113
114 device_printf(dev, "Cannot find CPU with MPIDR: 0x%08X\n", mpidr);
115 return (ENXIO);
116}
117
118static int
119pmu_parse_intr(device_t dev, struct pmu_softc *sc)

Callers 1

pmu_parse_intrFunction · 0.85

Calls 2

device_printfFunction · 0.85
pcpu_findFunction · 0.85

Tested by

no test coverage detected