summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-01-05 09:41:37 +0000
committerpeter <peter@FreeBSD.org>2002-01-05 09:41:37 +0000
commitb19d3ea0e21b0dc767f57b08497f4dcc4bcd9bda (patch)
tree20b88f57275b83dc0c9ea9823c18ec1a663b2438 /sys
parent5e902a48f6ffa366d3573e7e7b3c571d7f384c9b (diff)
downloadFreeBSD-src-b19d3ea0e21b0dc767f57b08497f4dcc4bcd9bda.zip
FreeBSD-src-b19d3ea0e21b0dc767f57b08497f4dcc4bcd9bda.tar.gz
Convert a bunch of 1 << PCPU_GET(cpuid) to PCPU_GET(cpumask).
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/mp_machdep.c2
-rw-r--r--sys/alpha/alpha/pmap.c10
-rw-r--r--sys/amd64/amd64/mp_machdep.c4
-rw-r--r--sys/amd64/amd64/mptable.c4
-rw-r--r--sys/amd64/amd64/pmap.c6
-rw-r--r--sys/amd64/include/mptable.h4
-rw-r--r--sys/i386/i386/mp_machdep.c4
-rw-r--r--sys/i386/i386/mptable.c4
-rw-r--r--sys/i386/i386/pmap.c6
-rw-r--r--sys/i386/include/mptable.h4
-rw-r--r--sys/ia64/ia64/interrupt.c2
-rw-r--r--sys/ia64/ia64/mp_machdep.c4
-rw-r--r--sys/sparc64/sparc64/pmap.c2
13 files changed, 28 insertions, 28 deletions
diff --git a/sys/alpha/alpha/mp_machdep.c b/sys/alpha/alpha/mp_machdep.c
index f15e130..3892113 100644
--- a/sys/alpha/alpha/mp_machdep.c
+++ b/sys/alpha/alpha/mp_machdep.c
@@ -182,7 +182,7 @@ smp_init_secondary(void)
CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", PCPU_GET(cpuid));
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c
index 720aad8..f0bde96 100644
--- a/sys/alpha/alpha/pmap.c
+++ b/sys/alpha/alpha/pmap.c
@@ -667,7 +667,7 @@ pmap_invalidate_page_action(void *arg)
vm_offset_t va = ((struct pmap_invalidate_page_arg *) arg)->va;
#endif
- if (pmap->pm_active & (1 << PCPU_GET(cpuid))) {
+ if (pmap->pm_active & PCPU_GET(cpumask)) {
ALPHA_TBIS(va);
alpha_pal_imb(); /* XXX overkill? */
} else {
@@ -688,7 +688,7 @@ pmap_invalidate_all_action(void *arg)
pmap_t pmap = (pmap_t) arg;
#endif
- if (pmap->pm_active & (1 << PCPU_GET(cpuid))) {
+ if (pmap->pm_active & PCPU_GET(cpumask)) {
ALPHA_TBIA();
alpha_pal_imb(); /* XXX overkill? */
} else
@@ -3246,7 +3246,7 @@ pmap_activate(struct thread *td)
if (pmap_active[PCPU_GET(cpuid)] && pmap != pmap_active[PCPU_GET(cpuid)]) {
atomic_clear_32(&pmap_active[PCPU_GET(cpuid)]->pm_active,
- 1 << PCPU_GET(cpuid));
+ PCPU_GET(cpumask));
pmap_active[PCPU_GET(cpuid)] = 0;
}
@@ -3257,7 +3257,7 @@ pmap_activate(struct thread *td)
pmap_get_asn(pmap);
pmap_active[PCPU_GET(cpuid)] = pmap;
- atomic_set_32(&pmap->pm_active, 1 << PCPU_GET(cpuid));
+ atomic_set_32(&pmap->pm_active, PCPU_GET(cpumask));
td->td_pcb->pcb_hw.apcb_asn = pmap->pm_asn[PCPU_GET(cpuid)].asn;
@@ -3272,7 +3272,7 @@ pmap_deactivate(struct thread *td)
pmap_t pmap;
pmap = vmspace_pmap(td->td_proc->p_vmspace);
- atomic_clear_32(&pmap->pm_active, 1 << PCPU_GET(cpuid));
+ atomic_clear_32(&pmap->pm_active, PCPU_GET(cpumask));
pmap_active[PCPU_GET(cpuid)] = 0;
}
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 1feb66a..f4f9c52 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -1992,7 +1992,7 @@ start_all_aps(u_int boot_addr)
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
/* fill in our (BSP) APIC version */
cpu_apic_versions[0] = lapic.version;
@@ -2268,7 +2268,7 @@ ap_init(void)
smp_cpus++;
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index 1feb66a..f4f9c52 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -1992,7 +1992,7 @@ start_all_aps(u_int boot_addr)
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
/* fill in our (BSP) APIC version */
cpu_apic_versions[0] = lapic.version;
@@ -2268,7 +2268,7 @@ ap_init(void)
smp_cpus++;
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index baa71b2..6075329 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -567,7 +567,7 @@ static __inline void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
#if defined(SMP)
- if (pmap->pm_active & (1 << PCPU_GET(cpuid)))
+ if (pmap->pm_active & PCPU_GET(cpumask))
cpu_invlpg((void *)va);
if (pmap->pm_active & PCPU_GET(other_cpus))
smp_invltlb();
@@ -581,7 +581,7 @@ static __inline void
pmap_invalidate_all(pmap_t pmap)
{
#if defined(SMP)
- if (pmap->pm_active & (1 << PCPU_GET(cpuid)))
+ if (pmap->pm_active & PCPU_GET(cpumask))
cpu_invltlb();
if (pmap->pm_active & PCPU_GET(other_cpus))
smp_invltlb();
@@ -3409,7 +3409,7 @@ pmap_activate(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
#if defined(SMP)
- pmap->pm_active |= 1 << PCPU_GET(cpuid);
+ pmap->pm_active |= PCPU_GET(cpumask);
#else
pmap->pm_active |= 1;
#endif
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index 1feb66a..f4f9c52 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -1992,7 +1992,7 @@ start_all_aps(u_int boot_addr)
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
/* fill in our (BSP) APIC version */
cpu_apic_versions[0] = lapic.version;
@@ -2268,7 +2268,7 @@ ap_init(void)
smp_cpus++;
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 1feb66a..f4f9c52 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -1992,7 +1992,7 @@ start_all_aps(u_int boot_addr)
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
/* fill in our (BSP) APIC version */
cpu_apic_versions[0] = lapic.version;
@@ -2268,7 +2268,7 @@ ap_init(void)
smp_cpus++;
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index 1feb66a..f4f9c52 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -1992,7 +1992,7 @@ start_all_aps(u_int boot_addr)
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
/* fill in our (BSP) APIC version */
cpu_apic_versions[0] = lapic.version;
@@ -2268,7 +2268,7 @@ ap_init(void)
smp_cpus++;
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index baa71b2..6075329 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -567,7 +567,7 @@ static __inline void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
#if defined(SMP)
- if (pmap->pm_active & (1 << PCPU_GET(cpuid)))
+ if (pmap->pm_active & PCPU_GET(cpumask))
cpu_invlpg((void *)va);
if (pmap->pm_active & PCPU_GET(other_cpus))
smp_invltlb();
@@ -581,7 +581,7 @@ static __inline void
pmap_invalidate_all(pmap_t pmap)
{
#if defined(SMP)
- if (pmap->pm_active & (1 << PCPU_GET(cpuid)))
+ if (pmap->pm_active & PCPU_GET(cpumask))
cpu_invltlb();
if (pmap->pm_active & PCPU_GET(other_cpus))
smp_invltlb();
@@ -3409,7 +3409,7 @@ pmap_activate(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
#if defined(SMP)
- pmap->pm_active |= 1 << PCPU_GET(cpuid);
+ pmap->pm_active |= PCPU_GET(cpumask);
#else
pmap->pm_active |= 1;
#endif
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index 1feb66a..f4f9c52 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -1992,7 +1992,7 @@ start_all_aps(u_int boot_addr)
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
/* fill in our (BSP) APIC version */
cpu_apic_versions[0] = lapic.version;
@@ -2268,7 +2268,7 @@ ap_init(void)
smp_cpus++;
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
+ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c
index 5dce36f..62786f3 100644
--- a/sys/ia64/ia64/interrupt.c
+++ b/sys/ia64/ia64/interrupt.c
@@ -127,7 +127,7 @@ interrupt(u_int64_t vector, struct trapframe *framep)
} else if (vector == mp_ipi_vector[IPI_RENDEZVOUS]) {
smp_rendezvous_action();
} else if (vector == mp_ipi_vector[IPI_STOP]) {
- u_int32_t mybit = 1 << PCPU_GET(cpuid);
+ u_int32_t mybit = PCPU_GET(cpumask);
savectx(PCPU_GET(pcb));
stopped_cpus |= mybit;
diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c
index 18f5b7b..3bbf999 100644
--- a/sys/ia64/ia64/mp_machdep.c
+++ b/sys/ia64/ia64/mp_machdep.c
@@ -171,7 +171,7 @@ cpu_mp_start()
#if 0
pc->pc_current_pmap = PCPU_GET(current_pmap);
#endif
- pc->pc_other_cpus = all_cpus & ~(1UL << pc->pc_cpuid);
+ pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask;
if (pc->pc_cpuid > 0) {
ap_stack = kmem_alloc(kernel_map,
KSTACK_PAGES * PAGE_SIZE);
@@ -237,7 +237,7 @@ ipi_selected(u_int64_t cpus, int ipi)
struct pcpu *pc;
SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
- if (cpus & (1UL << pc->pc_cpuid))
+ if (cpus & pc->pc_cpumask)
ipi_send(pc->pc_lid, ipi);
}
}
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 2e6e189..290b67c 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -1626,7 +1626,7 @@ pmap_activate(struct thread *td)
KASSERT(context != -1, ("pmap_activate: steal context"));
KASSERT(pm->pm_active == 0, ("pmap_activate: pmap already active?"));
- pm->pm_active |= 1 << PCPU_GET(cpuid);
+ pm->pm_active |= PCPU_GET(cpumask);
wrpr(pstate, 0, PSTATE_MMU);
__asm __volatile("mov %0, %%g7" : : "r" (tsb));
OpenPOWER on IntegriCloud