Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips Fix a type from kcpuset transition.



details:   https://anonhg.NetBSD.org/src/rev/8f48276e1d63
branches:  trunk
changeset: 338846:8f48276e1d63
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jun 11 15:15:27 2015 +0000

description:
Fix a type from kcpuset transition.
Deal with kcpuset_ffs return value a little more cleanly.

diffstat:

 sys/arch/mips/mips/pmap_tlb.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r f1e1ec020806 -r 8f48276e1d63 sys/arch/mips/mips/pmap_tlb.c
--- a/sys/arch/mips/mips/pmap_tlb.c     Thu Jun 11 15:13:34 2015 +0000
+++ b/sys/arch/mips/mips/pmap_tlb.c     Thu Jun 11 15:15:27 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_tlb.c,v 1.9 2015/06/10 22:31:00 matt Exp $        */
+/*     $NetBSD: pmap_tlb.c,v 1.10 2015/06/11 15:15:27 matt Exp $       */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.9 2015/06/10 22:31:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.10 2015/06/11 15:15:27 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -560,13 +560,14 @@
                /*
                 * Skip this TLB if there are no active mappings for it.
                 */
-               if (!kcpuset_intersecting_p(pm_active, ti->ti_kcpuset) == 0)
+               if (!kcpuset_intersecting_p(pm_active, ti->ti_kcpuset))
                        continue;
                struct pmap_asid_info * const pai = PMAP_PAI(pm, ti);
                kcpuset_remove(pm_active, ti->ti_kcpuset);
                TLBINFO_LOCK(ti);
                cpuid_t j = kcpuset_ffs_intersecting(pm->pm_onproc, ti->ti_kcpuset);
-               if (j != 0) {
+               // post decrement since ffs returns bit + 1 or 0 if no bit
+               if (j-- > 0) {
                        if (kernel_p) {
                                ti->ti_tlbinvop =
                                    TLBINV_KERNEL_MAP(ti->ti_tlbinvop);
@@ -598,7 +599,7 @@
                         * change now that we have released the lock but we
                         * can tolerate spurious shootdowns.
                         */
-                       cpu_send_ipi(cpu_lookup(j-1), IPI_SHOOTDOWN);
+                       cpu_send_ipi(cpu_lookup(j), IPI_SHOOTDOWN);
                        ipi_sent = true;
                        continue;
                }



Home | Main Index | Thread Index | Old Index