Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/pic Switch arm pic allocation and initializatio...



details:   https://anonhg.NetBSD.org/src/rev/1e58ad81b1ae
branches:  trunk
changeset: 744431:1e58ad81b1ae
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Feb 01 12:55:02 2020 +0000

description:
Switch arm pic allocation and initialization to percpu_create.

diffstat:

 sys/arch/arm/pic/pic.c |  20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

diffs (48 lines):

diff -r fc6a7d6d5146 -r 1e58ad81b1ae sys/arch/arm/pic/pic.c
--- a/sys/arch/arm/pic/pic.c    Sat Feb 01 12:54:50 2020 +0000
+++ b/sys/arch/arm/pic/pic.c    Sat Feb 01 12:55:02 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic.c,v 1.52 2019/12/24 20:40:09 skrll Exp $   */
+/*     $NetBSD: pic.c,v 1.53 2020/02/01 12:55:02 riastradh Exp $       */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.52 2019/12/24 20:40:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.53 2020/02/01 12:55:02 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -647,12 +647,8 @@
 
 #if defined(__HAVE_PIC_PENDING_INTRS) && defined(MULTIPROCESSOR)
        if (__predict_false(pic_pending_percpu == NULL)) {
-               pic_pending_percpu = percpu_alloc(sizeof(struct pic_pending));
-
-               /*
-                * Now zero the per-cpu pending data.
-                */
-               percpu_foreach(pic_pending_percpu, pic_pending_zero, NULL);
+               pic_pending_percpu = percpu_create(sizeof(struct pic_pending),
+                   pic_pending_zero, NULL, NULL);
        }
 #endif /* __HAVE_PIC_PENDING_INTRS && MULTIPROCESSOR */
 
@@ -702,12 +698,8 @@
         * corrupt the pointers in the evcnts themselves.  Remember, any
         * problem can be solved with sufficient indirection.
         */
-       pic->pic_percpu = percpu_alloc(sizeof(struct pic_percpu));
-
-       /*
-        * Now allocate the per-cpu evcnts.
-        */
-       percpu_foreach(pic->pic_percpu, pic_percpu_allocate, pic);
+       pic->pic_percpu = percpu_create(sizeof(struct pic_percpu),
+           pic_percpu_allocate, NULL, pic);
 
        pic->pic_sources = &pic_sources[sourcebase];
        pic->pic_irqbase = irqbase;



Home | Main Index | Thread Index | Old Index