Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/mp_machdep.c
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | |||||
SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); | SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); | ||||
int | int | ||||
powerpc_ipi_handler(void *arg) | powerpc_ipi_handler(void *arg) | ||||
{ | { | ||||
u_int cpuid; | u_int cpuid; | ||||
uint32_t ipimask; | uint32_t ipimask; | ||||
int msg; | |||||
CTR2(KTR_SMP, "%s: MSR 0x%08x", __func__, mfmsr()); | CTR2(KTR_SMP, "%s: MSR 0x%08x", __func__, mfmsr()); | ||||
ipimask = atomic_readandclear_32(&(pcpup->pc_ipimask)); | ipimask = atomic_readandclear_32(&(pcpup->pc_ipimask)); | ||||
if (ipimask == 0) | if (ipimask == 0) | ||||
return (FILTER_STRAY); | return (FILTER_STRAY); | ||||
while ((msg = ffs(ipimask) - 1) != -1) { | if (ipimask & (1 << IPI_AST)) { | ||||
ipimask &= ~(1u << msg); | |||||
switch (msg) { | |||||
case IPI_AST: | |||||
CTR1(KTR_SMP, "%s: IPI_AST", __func__); | CTR1(KTR_SMP, "%s: IPI_AST", __func__); | ||||
break; | } | ||||
case IPI_PREEMPT: | if (ipimask & (1 << IPI_PREEMPT)) { | ||||
CTR1(KTR_SMP, "%s: IPI_PREEMPT", __func__); | CTR1(KTR_SMP, "%s: IPI_PREEMPT", __func__); | ||||
sched_preempt(curthread); | sched_preempt(curthread); | ||||
break; | } | ||||
case IPI_RENDEZVOUS: | if (ipimask & (1 << IPI_RENDEZVOUS)) { | ||||
CTR1(KTR_SMP, "%s: IPI_RENDEZVOUS", __func__); | CTR1(KTR_SMP, "%s: IPI_RENDEZVOUS", __func__); | ||||
smp_rendezvous_action(); | smp_rendezvous_action(); | ||||
break; | } | ||||
case IPI_STOP: | if (ipimask & (1 << IPI_STOP)) { | ||||
/* | /* | ||||
* IPI_STOP_HARD is mapped to IPI_STOP so it is not | * IPI_STOP_HARD is mapped to IPI_STOP so it is not | ||||
* necessary to add such case in the switch. | * necessary to add such case in the switch. | ||||
nwhitehorn: There's no switch anymore here. | |||||
*/ | */ | ||||
CTR1(KTR_SMP, "%s: IPI_STOP or IPI_STOP_HARD (stop)", | CTR1(KTR_SMP, "%s: IPI_STOP or IPI_STOP_HARD (stop)", | ||||
__func__); | __func__); | ||||
cpuid = PCPU_GET(cpuid); | cpuid = PCPU_GET(cpuid); | ||||
savectx(&stoppcbs[cpuid]); | savectx(&stoppcbs[cpuid]); | ||||
CPU_SET_ATOMIC(cpuid, &stopped_cpus); | CPU_SET_ATOMIC(cpuid, &stopped_cpus); | ||||
while (!CPU_ISSET(cpuid, &started_cpus)) | while (!CPU_ISSET(cpuid, &started_cpus)) | ||||
cpu_spinwait(); | cpu_spinwait(); | ||||
CPU_CLR_ATOMIC(cpuid, &stopped_cpus); | CPU_CLR_ATOMIC(cpuid, &stopped_cpus); | ||||
CPU_CLR_ATOMIC(cpuid, &started_cpus); | CPU_CLR_ATOMIC(cpuid, &started_cpus); | ||||
CTR1(KTR_SMP, "%s: IPI_STOP (restart)", __func__); | CTR1(KTR_SMP, "%s: IPI_STOP (restart)", __func__); | ||||
break; | } | ||||
case IPI_HARDCLOCK: | if (ipimask & (1 << IPI_HARDCLOCK)) { | ||||
CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); | CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); | ||||
hardclockintr(); | hardclockintr(); | ||||
break; | |||||
} | |||||
} | } | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
static void | static void | ||||
ipi_send(struct pcpu *pc, int ipi) | ipi_send(struct pcpu *pc, int ipi) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
There's no switch anymore here.