diff options
author | John Baldwin <jhb@FreeBSD.org> | 2010-11-11 19:39:38 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2010-11-11 19:39:38 +0000 |
commit | 5af5e9479e59c61b48a6d1119f32079e74f566a7 (patch) | |
tree | 9d6a1f4196ebaa9c1619f03b423746911fc79181 | |
parent | db08aa24d4732eef9cb8fa2ae77a979828a129fd (diff) | |
download | src-5af5e9479e59c61b48a6d1119f32079e74f566a7.tar.gz src-5af5e9479e59c61b48a6d1119f32079e74f566a7.zip |
MFC 211149,211151,211197,211518,215128:
Update various places that store or manipulate CPU masks to use cpumask_t
instead of int or u_int. Since cpumask_t is currently u_int on all
platforms this should just be a cosmetic change.
Notes
Notes:
svn path=/stable/8/; revision=215141
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 30 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 9 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 3 | ||||
-rw-r--r-- | sys/arm/include/pmap.h | 2 | ||||
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 19 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 9 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 3 | ||||
-rw-r--r-- | sys/i386/xen/pmap.c | 9 | ||||
-rw-r--r-- | sys/mips/include/pmap.h | 2 | ||||
-rw-r--r-- | sys/powerpc/include/pmap.h | 4 | ||||
-rw-r--r-- | sys/sparc64/include/pmap.h | 2 | ||||
-rw-r--r-- | sys/sparc64/include/smp.h | 14 | ||||
-rw-r--r-- | sys/sparc64/sparc64/mp_machdep.c | 2 | ||||
-rw-r--r-- | sys/sun4v/include/pmap.h | 5 | ||||
-rw-r--r-- | sys/sun4v/include/smp.h | 16 | ||||
-rw-r--r-- | sys/sun4v/sun4v/mp_machdep.c | 4 | ||||
-rw-r--r-- | sys/sun4v/sun4v/pmap.c | 2 |
17 files changed, 72 insertions, 63 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 1ef395317313..4386404d66de 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1047,7 +1047,7 @@ smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_o int ncpu, othercpus; othercpus = mp_ncpus - 1; - if (mask == (u_int)-1) { + if (mask == (cpumask_t)-1) { ncpu = othercpus; if (ncpu < 1) return; @@ -1072,7 +1072,7 @@ smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_o smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); - if (mask == (u_int)-1) + if (mask == (cpumask_t)-1) ipi_all_but_self(vector); else ipi_selected(mask, vector); @@ -1283,8 +1283,11 @@ ipi_nmi_handler() void cpustop_handler(void) { - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; + u_int cpu; + + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); savectx(&stoppcbs[cpu]); @@ -1312,9 +1315,12 @@ void cpususpend_handler(void) { struct savefpu *stopfpu; + cpumask_t cpumask; register_t cr3, rf; - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + u_int cpu; + + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); rf = intr_disable(); cr3 = rcr3(); @@ -1488,18 +1494,22 @@ SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_ANY, cpu_hlt_setup, NULL); int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask; #ifdef MP_WATCHDOG - u_int cpuid = PCPU_GET(cpuid); + u_int cpuid; #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG + cpuid = PCPU_GET(cpuid); ap_watchdog(cpuid); #endif - retval = mask & hlt_cpus_mask; - while (mask & hlt_cpus_mask) + retval = 0; + while (mask & hlt_cpus_mask) { + retval = 1; __asm __volatile("sti; hlt" : : : "memory"); + } return (retval); } diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b9715543762e..60f36fac1817 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -860,8 +860,7 @@ pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde) void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -881,8 +880,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; sched_pin(); @@ -906,8 +904,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index d6906ac69484..05a2652626eb 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -520,7 +520,8 @@ void cpu_reset() { #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) & ~stopped_cpus; diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h index 8ee7bac27e23..25971b154433 100644 --- a/sys/arm/include/pmap.h +++ b/sys/arm/include/pmap.h @@ -134,7 +134,7 @@ struct pmap { struct l1_ttable *pm_l1; struct l2_dtable *pm_l2[L2_SIZE]; pd_entry_t *pm_pdir; /* KVA of page directory */ - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statictics */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ }; diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index e4b917228003..feb1d4b77e93 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -1443,8 +1443,11 @@ ipi_nmi_handler() void cpustop_handler(void) { - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; + u_int cpu; + + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); savectx(&stoppcbs[cpu]); @@ -1612,19 +1615,23 @@ SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_ANY, cpu_hlt_setup, NULL); int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask; #ifdef MP_WATCHDOG - u_int cpuid = PCPU_GET(cpuid); + u_int cpuid; #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG + cpuid = PCPU_GET(cpuid); ap_watchdog(cpuid); #endif - retval = mask & hlt_cpus_mask; - while (mask & hlt_cpus_mask) + retval = 0; + while (mask & hlt_cpus_mask) { + retval = 1; __asm __volatile("sti; hlt" : : : "memory"); + } return (retval); } diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 5d24525a775a..502cfcbafc22 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -935,8 +935,7 @@ pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde) void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -956,8 +955,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; sched_pin(); @@ -981,8 +979,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 2948eb7e0003..3eb2d08bab6c 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -592,7 +592,8 @@ cpu_reset() #endif #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) & ~stopped_cpus; diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c index 1b4345f07e93..21e2f98fba51 100644 --- a/sys/i386/xen/pmap.c +++ b/sys/i386/xen/pmap.c @@ -851,8 +851,7 @@ pmap_cache_bits(int mode, boolean_t is_pde) void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR2(KTR_PMAP, "pmap_invalidate_page: pmap=%p va=0x%x", pmap, va); @@ -876,8 +875,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; CTR3(KTR_PMAP, "pmap_invalidate_page: pmap=%p eva=0x%x sva=0x%x", @@ -905,8 +903,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR1(KTR_PMAP, "pmap_invalidate_page: pmap=%p", pmap); diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h index 4546cffd0a79..31547434c274 100644 --- a/sys/mips/include/pmap.h +++ b/sys/mips/include/pmap.h @@ -88,7 +88,7 @@ struct pmap { pd_entry_t *pm_segtab; /* KVA of segment table */ TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in * pmap */ - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct { u_int32_t asid:ASID_BITS; /* TLB address space tag */ u_int32_t gen:ASIDGEN_BITS; /* its generation number */ diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index 0cc0dc72f7c8..f9287575f2b2 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -87,7 +87,7 @@ struct pmap_md { struct pmap { struct mtx pm_mtx; u_int pm_sr[16]; - u_int pm_active; + cpumask_t pm_active; u_int pm_context; struct pmap *pmap_phys; @@ -122,7 +122,7 @@ struct md_page { struct pmap { struct mtx pm_mtx; /* pmap mutex */ tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ int pm_refs; /* ref count */ struct pmap_statistics pm_stats; /* pmap statistics */ diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h index 83c81904b50b..e25b776932f7 100644 --- a/sys/sparc64/include/pmap.h +++ b/sys/sparc64/include/pmap.h @@ -61,7 +61,7 @@ struct pmap { struct mtx pm_mtx; struct tte *pm_tsb; vm_object_t pm_tsb_obj; - u_int pm_active; + cpumask_t pm_active; u_int pm_context[MAXCPU]; struct pmap_statistics pm_stats; }; diff --git a/sys/sparc64/include/smp.h b/sys/sparc64/include/smp.h index c6c579f636d0..5db870d3ab31 100644 --- a/sys/sparc64/include/smp.h +++ b/sys/sparc64/include/smp.h @@ -75,17 +75,17 @@ struct cpu_start_args { }; struct ipi_cache_args { - u_int ica_mask; + cpumask_t ica_mask; vm_paddr_t ica_pa; }; struct ipi_rd_args { - u_int ira_mask; + cpumask_t ira_mask; register_t *ira_val; }; struct ipi_tlb_args { - u_int ita_mask; + cpumask_t ita_mask; struct pmap *ita_pmap; u_long ita_start; u_long ita_end; @@ -206,7 +206,7 @@ static __inline void * ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -228,7 +228,7 @@ static __inline void * ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -250,7 +250,7 @@ static __inline void * ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -273,7 +273,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); diff --git a/sys/sparc64/sparc64/mp_machdep.c b/sys/sparc64/sparc64/mp_machdep.c index 8299e2b7536f..7c3b4c9a58fd 100644 --- a/sys/sparc64/sparc64/mp_machdep.c +++ b/sys/sparc64/sparc64/mp_machdep.c @@ -119,7 +119,7 @@ cpu_ipi_single_t *cpu_ipi_single; static vm_offset_t mp_tramp; static u_int cpuid_to_mid[MAXCPU]; static int isjbus; -static volatile u_int shutdown_cpus; +static volatile cpumask_t shutdown_cpus; static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); static void ap_start(phandle_t node, u_int mid, u_int cpu_impl); diff --git a/sys/sun4v/include/pmap.h b/sys/sun4v/include/pmap.h index 90ae4c455604..9c2c486b823a 100644 --- a/sys/sun4v/include/pmap.h +++ b/sys/sun4v/include/pmap.h @@ -54,7 +54,6 @@ #define TSB_MAX_RESIZE (20 - TSB_INIT_SHIFT - PAGE_SHIFT) typedef struct pmap *pmap_t; -typedef uint32_t pmap_cpumask_t; struct pv_entry; struct tte_hash; @@ -75,8 +74,8 @@ struct pmap { struct tte_hash *pm_hash; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ struct hv_tsb_info pm_tsb; - pmap_cpumask_t pm_active; /* mask of cpus currently using pmap */ - pmap_cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ + cpumask_t pm_active; /* mask of cpus currently using pmap */ + cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ struct pmap_statistics pm_stats; uint32_t pm_tsb_miss_count; uint32_t pm_tsb_cap_miss_count; diff --git a/sys/sun4v/include/smp.h b/sys/sun4v/include/smp.h index 0358c92cfca3..f4bbcd5367f3 100644 --- a/sys/sun4v/include/smp.h +++ b/sys/sun4v/include/smp.h @@ -58,12 +58,12 @@ struct cpu_start_args { }; struct ipi_cache_args { - u_int ica_mask; + cpumask_t ica_mask; vm_paddr_t ica_pa; }; struct ipi_tlb_args { - u_int ita_mask; + cpumask_t ita_mask; struct pmap *ita_pmap; u_long ita_start; u_long ita_end; @@ -75,7 +75,7 @@ struct pcpu; void cpu_mp_bootstrap(struct pcpu *pc); void cpu_mp_shutdown(void); -void cpu_ipi_selected(int cpus, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); +void cpu_ipi_selected(int cpu_count, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); void cpu_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); void cpu_ipi_ast(struct trapframe *tf); @@ -84,7 +84,7 @@ void cpu_ipi_preempt(struct trapframe *tf); 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); +void ipi_selected(cpumask_t cpus, u_int ipi); vm_offset_t mp_tramp_alloc(void); void mp_set_tsb_desc_ra(vm_paddr_t); @@ -148,7 +148,7 @@ static __inline void * ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -167,7 +167,7 @@ static __inline void * ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -186,7 +186,7 @@ static __inline void * ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -205,7 +205,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); diff --git a/sys/sun4v/sun4v/mp_machdep.c b/sys/sun4v/sun4v/mp_machdep.c index 484ac128f172..57cd77799c0c 100644 --- a/sys/sun4v/sun4v/mp_machdep.c +++ b/sys/sun4v/sun4v/mp_machdep.c @@ -115,7 +115,7 @@ vm_offset_t mp_tramp; u_int mp_boot_mid; -static volatile u_int shutdown_cpus; +static volatile cpumask_t shutdown_cpus; void cpu_mp_unleash(void *); SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); @@ -519,7 +519,7 @@ retry: } void -ipi_selected(u_int icpus, u_int ipi) +ipi_selected(cpumask_t icpus, u_int ipi) { int i, cpu_count; uint16_t *cpulist; diff --git a/sys/sun4v/sun4v/pmap.c b/sys/sun4v/sun4v/pmap.c index d3b8c79467e8..815ac38d5297 100644 --- a/sys/sun4v/sun4v/pmap.c +++ b/sys/sun4v/sun4v/pmap.c @@ -1402,7 +1402,7 @@ pmap_ipi(pmap_t pmap, char *func, uint64_t arg1, uint64_t arg2) { int i, cpu_count, retried; - u_int cpus; + cpumask_t cpus; cpumask_t cpumask, active, curactive; cpumask_t active_total, ackmask; uint16_t *cpulist; |