diff options
author | jhb <jhb@FreeBSD.org> | 2010-08-06 15:36:59 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-08-06 15:36:59 +0000 |
commit | 19ddbf5c3845e0aaeed327e2be2f168e30013b63 (patch) | |
tree | 90823b92f30822fa8ac56ad8c70614f9aae1017a /sys/sun4v | |
parent | 57b610d580a3dd85aaac28dae65ce416f30c3f31 (diff) | |
download | FreeBSD-src-19ddbf5c3845e0aaeed327e2be2f168e30013b63.zip FreeBSD-src-19ddbf5c3845e0aaeed327e2be2f168e30013b63.tar.gz |
Add a new ipi_cpu() function to the MI IPI API that can be used to send an
IPI to a specific CPU by its cpuid. Replace calls to ipi_selected() that
constructed a mask for a single CPU with calls to ipi_cpu() instead. This
will matter more in the future when we transition from cpumask_t to
cpuset_t for CPU masks in which case building a CPU mask is more expensive.
Submitted by: peter, sbruno
Reviewed by: rookie
Obtained from: Yahoo! (x86)
MFC after: 1 month
Diffstat (limited to 'sys/sun4v')
-rw-r--r-- | sys/sun4v/include/smp.h | 3 | ||||
-rw-r--r-- | sys/sun4v/sun4v/mp_machdep.c | 30 |
2 files changed, 28 insertions, 5 deletions
diff --git a/sys/sun4v/include/smp.h b/sys/sun4v/include/smp.h index ec30d0d..4f5fc76 100644 --- a/sys/sun4v/include/smp.h +++ b/sys/sun4v/include/smp.h @@ -85,8 +85,9 @@ void cpu_ipi_preempt(struct trapframe *tf); void cpu_ipi_hardclock(struct trapframe *tf); void cpu_ipi_statclock(struct trapframe *tf); -void ipi_selected(u_int cpus, u_int ipi); void ipi_all_but_self(u_int ipi); +void ipi_cpu(int cpu, u_int ipi); +void ipi_selected(u_int cpus, u_int ipi); vm_offset_t mp_tramp_alloc(void); void mp_set_tsb_desc_ra(vm_paddr_t); diff --git a/sys/sun4v/sun4v/mp_machdep.c b/sys/sun4v/sun4v/mp_machdep.c index 6461cf8..a5fa692 100644 --- a/sys/sun4v/sun4v/mp_machdep.c +++ b/sys/sun4v/sun4v/mp_machdep.c @@ -535,7 +535,6 @@ retry: } } - void ipi_selected(u_int icpus, u_int ipi) { @@ -550,7 +549,6 @@ ipi_selected(u_int icpus, u_int ipi) * 4) handling 4-way threading vs 2-way threading should happen here * and not in forward wakeup */ - cpulist = PCPU_GET(cpulist); cpus = (icpus & ~PCPU_GET(cpumask)); @@ -562,8 +560,32 @@ ipi_selected(u_int icpus, u_int ipi) cpu_count++; } - cpu_ipi_selected(cpu_count, cpulist, (u_long)tl_ipi_level, ipi, 0, &ackmask); - + cpu_ipi_selected(cpu_count, cpulist, (u_long)tl_ipi_level, ipi, 0, + &ackmask); +} + +void +ipi_cpu(int cpu, u_int ipi) +{ + int cpu_count; + uint16_t *cpulist; + uint64_t ackmask; + + /* + * + * 3) forward_wakeup appears to abuse ASTs + * 4) handling 4-way threading vs 2-way threading should happen here + * and not in forward wakeup + */ + cpulist = PCPU_GET(cpulist); + if (PCPU_GET(cpumask) & (1 << cpu)) + cpu_count = 0; + else { + cpulist[0] = (uint16_t)cpu; + cpu_count = 1; + } + cpu_ipi_selected(cpu_count, cpulist, (u_long)tl_ipi_level, ipi, 0, + &ackmask); } void |