Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/mp_machdep.c
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | |||||
#ifdef IPI_IRQ_END | #ifdef IPI_IRQ_END | ||||
end = IPI_IRQ_END; | end = IPI_IRQ_END; | ||||
#else | #else | ||||
end = IPI_IRQ_START; | end = IPI_IRQ_START; | ||||
#endif | #endif | ||||
#endif | #endif | ||||
for (int i = start; i <= end; i++) | for (int i = start; i <= end; i++) | ||||
arm_unmask_irq(i); | arm_unmask_ipi(i); | ||||
enable_interrupts(I32_bit); | enable_interrupts(I32_bit); | ||||
loop_counter = 0; | loop_counter = 0; | ||||
while (smp_started == 0) { | while (smp_started == 0) { | ||||
DELAY(100); | DELAY(100); | ||||
loop_counter++; | loop_counter++; | ||||
if (loop_counter == 1000) | if (loop_counter == 1000) | ||||
CTR0(KTR_SMP, "AP still wait for smp_started"); | CTR0(KTR_SMP, "AP still wait for smp_started"); | ||||
Show All 13 Lines | |||||
static int | static int | ||||
ipi_handler(void *arg) | ipi_handler(void *arg) | ||||
{ | { | ||||
u_int cpu, ipi; | u_int cpu, ipi; | ||||
cpu = PCPU_GET(cpuid); | cpu = PCPU_GET(cpuid); | ||||
ipi = pic_ipi_get((int)arg); | ipi = pic_ipi_read((int)arg); | ||||
while ((ipi != 0x3ff)) { | while ((ipi != 0x3ff)) { | ||||
switch (ipi) { | switch (ipi) { | ||||
case IPI_RENDEZVOUS: | case IPI_RENDEZVOUS: | ||||
CTR0(KTR_SMP, "IPI_RENDEZVOUS"); | CTR0(KTR_SMP, "IPI_RENDEZVOUS"); | ||||
smp_rendezvous_action(); | smp_rendezvous_action(); | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | case IPI_TLB: | ||||
CTR1(KTR_SMP, "%s: IPI_TLB", __func__); | CTR1(KTR_SMP, "%s: IPI_TLB", __func__); | ||||
cpufuncs.cf_tlb_flushID(); | cpufuncs.cf_tlb_flushID(); | ||||
break; | break; | ||||
default: | default: | ||||
panic("Unknown IPI 0x%0x on cpu %d", ipi, curcpu); | panic("Unknown IPI 0x%0x on cpu %d", ipi, curcpu); | ||||
} | } | ||||
pic_ipi_clear(ipi); | pic_ipi_clear(ipi); | ||||
ipi = pic_ipi_get(-1); | ipi = pic_ipi_read(-1); | ||||
} | } | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
static void | static void | ||||
release_aps(void *dummy __unused) | release_aps(void *dummy __unused) | ||||
{ | { | ||||
Show All 14 Lines | #endif | ||||
for (int i = start; i <= end; i++) { | for (int i = start; i <= end; i++) { | ||||
/* | /* | ||||
* IPI handler | * IPI handler | ||||
*/ | */ | ||||
/* | /* | ||||
* Use 0xdeadbeef as the argument value for irq 0, | * Use 0xdeadbeef as the argument value for irq 0, | ||||
* if we used 0, the intr code will give the trap frame | * if we used 0, the intr code will give the trap frame | ||||
* pointer instead. | * pointer instead. | ||||
*/ | */ | ||||
andrew: This comment doesn't make sense, I see no 0xdeadbeef here. | |||||
jceelUnsubmitted Not Done Inline ActionsYes, that comment seems invalid. It is also present in head. jceel: Yes, that comment seems invalid. It is also present in head. | |||||
arm_setup_irqhandler("ipi", ipi_handler, NULL, (void *)i, i, | arm_setup_irqhandler((device_t)"ipi", ipi_handler, NULL, (void *)i, i, | ||||
INTR_TYPE_MISC | INTR_EXCL, NULL); | INTR_TYPE_MISC | INTR_EXCL | INTR_IPI, NULL); | ||||
/* Enable ipi */ | arm_unmask_ipi(i); | ||||
arm_unmask_irq(i); | |||||
} | } | ||||
atomic_store_rel_int(&aps_ready, 1); | atomic_store_rel_int(&aps_ready, 1); | ||||
printf("Release APs\n"); | printf("Release APs\n"); | ||||
for (loop_counter = 0; loop_counter < 2000; loop_counter++) { | for (loop_counter = 0; loop_counter < 2000; loop_counter++) { | ||||
if (smp_started) | if (smp_started) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
This comment doesn't make sense, I see no 0xdeadbeef here.