Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/cortex kcpuset_ffs returns the cpu number plus ...



details:   https://anonhg.NetBSD.org/src/rev/092d57522e63
branches:  trunk
changeset: 446040:092d57522e63
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Nov 21 11:44:26 2018 +0000

description:
kcpuset_ffs returns the cpu number plus one, so make sure to subtract it

diffstat:

 sys/arch/arm/cortex/gicv3.c     |  6 +++---
 sys/arch/arm/cortex/gicv3_its.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r ad111e9840c7 -r 092d57522e63 sys/arch/arm/cortex/gicv3.c
--- a/sys/arch/arm/cortex/gicv3.c       Wed Nov 21 10:34:53 2018 +0000
+++ b/sys/arch/arm/cortex/gicv3.c       Wed Nov 21 11:44:26 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3.c,v 1.11 2018/11/17 00:17:54 jmcneill Exp $ */
+/* $NetBSD: gicv3.c,v 1.12 2018/11/21 11:44:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
 #define        _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.11 2018/11/17 00:17:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.12 2018/11/21 11:44:26 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -489,7 +489,7 @@
        if (set == ncpu)
                irouter = GICD_IROUTER_Interrupt_Routing_mode;
        else if (set == 1)
-               irouter = sc->sc_irouter[kcpuset_ffs(affinity)];
+               irouter = sc->sc_irouter[kcpuset_ffs(affinity) - 1];
        else
                return EINVAL;
 
diff -r ad111e9840c7 -r 092d57522e63 sys/arch/arm/cortex/gicv3_its.c
--- a/sys/arch/arm/cortex/gicv3_its.c   Wed Nov 21 10:34:53 2018 +0000
+++ b/sys/arch/arm/cortex/gicv3_its.c   Wed Nov 21 11:44:26 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.3 2018/11/16 15:06:21 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.4 2018/11/21 11:44:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.3 2018/11/16 15:06:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.4 2018/11/21 11:44:26 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -713,7 +713,7 @@
        if (pa == NULL)
                return EINVAL;
 
-       ci = cpu_lookup(kcpuset_ffs(affinity));
+       ci = cpu_lookup(kcpuset_ffs(affinity) - 1);
 
        const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
        gits_command_movi(its, devid, devid, cpu_index(ci));



Home | Main Index | Thread Index | Old Index