| 87 | } |
| 88 | |
| 89 | static int |
| 90 | pmu_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 | |
| 118 | static int |
| 119 | pmu_parse_intr(device_t dev, struct pmu_softc *sc) |
no test coverage detected