Fix gic_cpu_mask() calculation in ARM GIC

r309616 changed the definition of GICD_ITARGETSR(n) to take the irq
id as argument, but the usage of the macro in gic_cpu_mask() was not
updated to reflect this. This causes the cpu mask to be computed
incorrectly.

Update the GICD_ITARGETSR() call to fix this, this fixes a hang seen
while booting freebsd on qemu-system-aarch64 with SMP enabled.
This commit is contained in:
jchandra 2016-12-12 15:35:57 +00:00
parent ec4d9aa4a2
commit f24a1f7d0d

View File

@ -190,7 +190,7 @@ gic_cpu_mask(struct arm_gic_softc *sc)
/* Read the current cpuid mask by reading ITARGETSR{0..7} */
for (i = 0; i < 8; i++) {
mask = gic_d_read_4(sc, GICD_ITARGETSR(i));
mask = gic_d_read_4(sc, GICD_ITARGETSR(4 * i));
if (mask != 0)
break;
}