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 Cover all pic_maxsources li...



details:   https://anonhg.NetBSD.org/src/rev/178e6dafe74d
branches:  trunk
changeset: 318544:178e6dafe74d
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sat Apr 28 18:26:53 2018 +0000
description:
Cover all pic_maxsources lines for armgic_cpu_init_priorities() and
armgic_cpu_update_priorities().

Previously only the first 32 lines were covered, which is significantly
less than the 1000-some interrupt lines possible.

Only relevant to MULTIPROCESSOR configurations.

diffstat:

 sys/arch/arm/cortex/gic.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 68856dead5f2 -r 178e6dafe74d sys/arch/arm/cortex/gic.c
--- a/sys/arch/arm/cortex/gic.c Sat Apr 28 18:25:52 2018 +0000
+++ b/sys/arch/arm/cortex/gic.c Sat Apr 28 18:26:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gic.c,v 1.33 2018/04/01 04:35:04 ryo Exp $     */
+/*     $NetBSD: gic.c,v 1.34 2018/04/28 18:26:53 jakllsch Exp $        */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 #define _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.33 2018/04/01 04:35:04 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.34 2018/04/28 18:26:53 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -402,7 +402,7 @@
 armgic_cpu_init_priorities(struct armgic_softc *sc)
 {
        /* Set lowest priority, i.e. disable interrupts */
-       for (size_t i = 0; i < 32; i += 4) {
+       for (size_t i = 0; i < sc->sc_pic.pic_maxsources; i += 4) {
                const bus_size_t priority_reg = GICD_IPRIORITYRn(i / 4);
                gicd_write(sc, priority_reg, ~0);
        }
@@ -412,7 +412,7 @@
 armgic_cpu_update_priorities(struct armgic_softc *sc)
 {
        uint32_t enabled = sc->sc_enabled_local;
-       for (size_t i = 0; i < 32; i += 4, enabled >>= 4) {
+       for (size_t i = 0; i < sc->sc_pic.pic_maxsources; i += 4, enabled >>= 4) {
                const bus_size_t priority_reg = GICD_IPRIORITYRn(i / 4);
                uint32_t priority = gicd_read(sc, priority_reg);
                uint32_t byte_mask = 0xff;



Home | Main Index | Thread Index | Old Index