Fri Aug 25 20:36:16 2017 UTC ()
The assertion at the bottom of intr_ipi_send is invalid for UP configs; add
a text for arm_cpu_max == 1


(jmcneill)
diff -r1.37 -r1.38 src/sys/arch/arm/pic/pic.c

cvs diff -r1.37 -r1.38 src/sys/arch/arm/pic/pic.c (expand / switch to unified diff)

--- src/sys/arch/arm/pic/pic.c 2017/06/01 02:45:06 1.37
+++ src/sys/arch/arm/pic/pic.c 2017/08/25 20:36:16 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pic.c,v 1.37 2017/06/01 02:45:06 chs Exp $ */ 1/* $NetBSD: pic.c,v 1.38 2017/08/25 20:36:16 jmcneill Exp $ */
2/*- 2/*-
3 * Copyright (c) 2008 The NetBSD Foundation, Inc. 3 * Copyright (c) 2008 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas. 7 * by Matt Thomas.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#define _INTR_PRIVATE 31#define _INTR_PRIVATE
32#include "opt_ddb.h" 32#include "opt_ddb.h"
33#include "opt_multiprocessor.h" 33#include "opt_multiprocessor.h"
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.37 2017/06/01 02:45:06 chs Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.38 2017/08/25 20:36:16 jmcneill Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/atomic.h> 39#include <sys/atomic.h>
40#include <sys/cpu.h> 40#include <sys/cpu.h>
41#include <sys/evcnt.h> 41#include <sys/evcnt.h>
42#include <sys/intr.h> 42#include <sys/intr.h>
43#include <sys/kernel.h> 43#include <sys/kernel.h>
44#include <sys/kmem.h> 44#include <sys/kmem.h>
45#include <sys/mutex.h> 45#include <sys/mutex.h>
46#include <sys/once.h> 46#include <sys/once.h>
47#include <sys/xcall.h> 47#include <sys/xcall.h>
48#include <sys/ipi.h> 48#include <sys/ipi.h>
49 49
@@ -196,27 +196,27 @@ intr_ipi_send(const kcpuset_t *kcp, u_lo @@ -196,27 +196,27 @@ intr_ipi_send(const kcpuset_t *kcp, u_lo
196 if (kcp == NULL || kcpuset_intersecting_p(kcp, pic->pic_cpus)) { 196 if (kcp == NULL || kcpuset_intersecting_p(kcp, pic->pic_cpus)) {
197 // never send to ourself 197 // never send to ourself
198 if (pic->pic_cpus == ci->ci_kcpuset) 198 if (pic->pic_cpus == ci->ci_kcpuset)
199 continue; 199 continue;
200 200
201 (*pic->pic_ops->pic_ipi_send)(pic, kcp, ipi); 201 (*pic->pic_ops->pic_ipi_send)(pic, kcp, ipi);
202 // If we were targeting a single CPU or this pic 202 // If we were targeting a single CPU or this pic
203 // handles all cpus, we're done. 203 // handles all cpus, we're done.
204 if (kcp != NULL || pic->pic_cpus == kcpuset_running) 204 if (kcp != NULL || pic->pic_cpus == kcpuset_running)
205 return; 205 return;
206 sent_p = true; 206 sent_p = true;
207 } 207 }
208 } 208 }
209 KASSERT(cold || sent_p); 209 KASSERT(cold || sent_p || arm_cpu_max == 1);
210} 210}
211#endif /* MULTIPROCESSOR */ 211#endif /* MULTIPROCESSOR */
212 212
213#ifdef __HAVE_PIC_FAST_SOFTINTS 213#ifdef __HAVE_PIC_FAST_SOFTINTS
214int 214int
215pic_handle_softint(void *arg) 215pic_handle_softint(void *arg)
216{ 216{
217 void softint_switch(lwp_t *, int); 217 void softint_switch(lwp_t *, int);
218 struct cpu_info * const ci = curcpu();  218 struct cpu_info * const ci = curcpu();
219 const size_t softint = (size_t) arg; 219 const size_t softint = (size_t) arg;
220 int s = splhigh(); 220 int s = splhigh();
221 ci->ci_intr_depth--; // don't count these as interrupts 221 ci->ci_intr_depth--; // don't count these as interrupts
222 softint_switch(ci->ci_softlwps[softint], s); 222 softint_switch(ci->ci_softlwps[softint], s);