From owner-p4-projects@FreeBSD.ORG Wed Aug 11 18:26:14 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1449210662CE; Wed, 11 Aug 2010 18:26:14 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4398B1065E53 for ; Wed, 11 Aug 2010 18:26:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id D38448FC0C for ; Wed, 11 Aug 2010 18:26:06 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id o7BIQ6mJ084324 for ; Wed, 11 Aug 2010 18:26:06 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o7BIQ6es084320 for perforce@freebsd.org; Wed, 11 Aug 2010 18:26:06 GMT (envelope-from jhb@freebsd.org) Date: Wed, 11 Aug 2010 18:26:06 GMT Message-Id: <201008111826.o7BIQ6es084320@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 182190 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 18:26:14 -0000 http://p4web.freebsd.org/@@182190?ac=10 Change 182190 by jhb@jhb_fiver on 2010/08/10 15:29:22 Convert various places over to using cpumask_t instead of int or u_int. Cosmetic. Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#67 edit .. //depot/projects/smpng/sys/amd64/amd64/pmap.c#109 edit .. //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#49 edit .. //depot/projects/smpng/sys/arm/include/pmap.h#30 edit .. //depot/projects/smpng/sys/i386/i386/mp_machdep.c#128 edit .. //depot/projects/smpng/sys/i386/i386/pmap.c#148 edit .. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#98 edit .. //depot/projects/smpng/sys/i386/xen/pmap.c#17 edit .. //depot/projects/smpng/sys/mips/include/pmap.h#13 edit .. //depot/projects/smpng/sys/powerpc/include/pmap.h#28 edit .. //depot/projects/smpng/sys/sparc64/include/pmap.h#37 edit .. //depot/projects/smpng/sys/sparc64/include/smp.h#28 edit .. //depot/projects/smpng/sys/sparc64/sparc64/mp_machdep.c#42 edit .. //depot/projects/smpng/sys/sun4v/include/smp.h#11 edit .. //depot/projects/smpng/sys/sun4v/sun4v/mp_machdep.c#13 edit .. //depot/projects/smpng/sys/sun4v/sun4v/pmap.c#22 edit Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#67 (text+ko) ==== @@ -1053,7 +1053,7 @@ int ncpu, othercpus; othercpus = mp_ncpus - 1; - if (mask == (u_int)-1) { + if (mask == (cpumask_t)-1) { ncpu = othercpus; if (ncpu < 1) return; @@ -1078,7 +1078,7 @@ 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); @@ -1338,7 +1338,7 @@ cpustop_handler(void) { int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask = PCPU_GET(cpumask); savectx(&stoppcbs[cpu]); @@ -1367,7 +1367,7 @@ { register_t cr3, rf; int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask = PCPU_GET(cpumask); rf = intr_disable(); cr3 = rcr3(); @@ -1539,7 +1539,7 @@ int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG u_int cpuid = PCPU_GET(cpuid); #endif @@ -1549,9 +1549,11 @@ 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); } ==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#109 (text+ko) ==== @@ -926,8 +926,8 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask; + cpumask_t other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -947,8 +947,8 @@ 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; + cpumask_t other_cpus; vm_offset_t addr; sched_pin(); @@ -972,8 +972,8 @@ void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask; + cpumask_t other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { ==== //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#49 (text+ko) ==== @@ -528,7 +528,8 @@ cpu_reset() { #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; disable_intr(); if (smp_active) { ==== //depot/projects/smpng/sys/arm/include/pmap.h#30 (text+ko) ==== @@ -136,7 +136,7 @@ pd_entry_t *pm_pdir; /* KVA of page directory */ uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; - 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 */ }; ==== //depot/projects/smpng/sys/i386/i386/mp_machdep.c#128 (text+ko) ==== @@ -1593,7 +1593,7 @@ int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG u_int cpuid = PCPU_GET(cpuid); #endif @@ -1603,9 +1603,11 @@ 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); } ==== //depot/projects/smpng/sys/i386/i386/pmap.c#148 (text+ko) ==== @@ -949,8 +949,8 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask; + cpumask_t other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -970,8 +970,8 @@ 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; + cpumask_t other_cpus; vm_offset_t addr; sched_pin(); @@ -995,8 +995,8 @@ void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask; + cpumask_t other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { ==== //depot/projects/smpng/sys/i386/i386/vm_machdep.c#98 (text+ko) ==== @@ -597,7 +597,8 @@ #endif #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int map; disable_intr(); if (smp_active) { ==== //depot/projects/smpng/sys/i386/xen/pmap.c#17 (text+ko) ==== @@ -863,8 +863,8 @@ void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask; + cpumask_t other_cpus; CTR2(KTR_PMAP, "pmap_invalidate_page: pmap=%p va=0x%x", pmap, va); @@ -888,8 +888,8 @@ 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; + cpumask_t other_cpus; vm_offset_t addr; CTR3(KTR_PMAP, "pmap_invalidate_page: pmap=%p eva=0x%x sva=0x%x", @@ -917,8 +917,8 @@ void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask; + cpumask_t other_cpus; CTR1(KTR_PMAP, "pmap_invalidate_page: pmap=%p", pmap); ==== //depot/projects/smpng/sys/mips/include/pmap.h#13 (text+ko) ==== @@ -81,7 +81,7 @@ * pmap */ uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; - 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 */ ==== //depot/projects/smpng/sys/powerpc/include/pmap.h#28 (text+ko) ==== @@ -99,7 +99,7 @@ #else register_t pm_sr[16]; #endif - u_int pm_active; + cpumask_t pm_active; uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; @@ -153,7 +153,7 @@ 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 */ ==== //depot/projects/smpng/sys/sparc64/include/pmap.h#37 (text+ko) ==== @@ -61,7 +61,7 @@ struct mtx pm_mtx; struct tte *pm_tsb; vm_object_t pm_tsb_obj; - u_int pm_active; + cpumask_t pm_active; uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; u_int pm_context[MAXCPU]; ==== //depot/projects/smpng/sys/sparc64/include/smp.h#28 (text+ko) ==== @@ -77,12 +77,12 @@ }; 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; @@ -184,7 +184,7 @@ ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -206,7 +206,7 @@ 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); @@ -228,7 +228,7 @@ 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); @@ -250,7 +250,7 @@ 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)); ==== //depot/projects/smpng/sys/sparc64/sparc64/mp_machdep.c#42 (text+ko) ==== @@ -119,7 +119,7 @@ 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); ==== //depot/projects/smpng/sys/sun4v/include/smp.h#11 (text+ko) ==== @@ -59,12 +59,12 @@ }; 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; ==== //depot/projects/smpng/sys/sun4v/sun4v/mp_machdep.c#13 (text+ko) ==== @@ -115,7 +115,7 @@ 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); ==== //depot/projects/smpng/sys/sun4v/sun4v/pmap.c#22 (text+ko) ==== @@ -1451,7 +1451,7 @@ { int i, cpu_count, retried; - u_int cpus; + cpumask_t cpus; cpumask_t cpumask, active, curactive; cpumask_t active_total, ackmask; uint16_t *cpulist;