CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: skrll Date: Tue Mar 23 08:07:23 UTC 2021 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.32 src/sys/arch/powerpc/pic/intr.c:1.33 --- src/sys/arch/powerpc/pic/intr.c:1.32 Mon Mar 22 01:36:10 2021 +++ src/sys/arch/powerpc/pic/intr.c Tue Mar 23 08:07:23 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $ */ +/* $NetBSD: intr.c,v 1.33 2021/03/23 08:07:23 skrll Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -29,7 +29,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.33 2021/03/23 08:07:23 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_interrupt.h" @@ -619,7 +619,8 @@ splraise(int ncpl) struct cpu_info *ci = curcpu(); int ocpl; - if (ncpl == ci->ci_cpl) return ncpl; + if (ncpl == ci->ci_cpl) + return ncpl; REORDER_PROTECT(); ocpl = ci->ci_cpl; KASSERT(ncpl < NIPL);
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Mon Mar 22 01:36:10 UTC 2021 Modified Files: src/sys/arch/powerpc/pic: intr.c picvar.h Log Message: Brush up previous, or make things more similar to x86: - Prevent pic_name from appearing vmstat(1) twice. - Restore "irq" in interrupt id fields of intrctl(8). For these purposes, - Add is_evname member to struct intr_source. - Bump size of is_source to INTRIDBUF, and rename it to is_intrid for clarity. Now, outputs from vmstat(1) and intrctl(8) are like: $ vmstat -ev ... openpic irq 39 3967 26 intr ... $ intrctl list interrupt id CPU0 device name(s) ... openpic irq 39 3967* wdc1 ... To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/pic/intr.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/pic/picvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.31 src/sys/arch/powerpc/pic/intr.c:1.32 --- src/sys/arch/powerpc/pic/intr.c:1.31 Sat Mar 6 07:24:24 2021 +++ src/sys/arch/powerpc/pic/intr.c Mon Mar 22 01:36:10 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.31 2021/03/06 07:24:24 rin Exp $ */ +/* $NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -29,7 +29,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.31 2021/03/06 07:24:24 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_interrupt.h" @@ -200,10 +200,12 @@ intr_establish_xname(int hwirq, int type break; } if (is->is_hand == NULL) { - snprintf(is->is_source, sizeof(is->is_source), "%s %d", + snprintf(is->is_intrid, sizeof(is->is_intrid), "%s irq %d", pic->pic_name, is->is_hwirq); + snprintf(is->is_evname, sizeof(is->is_evname), "irq %d", + is->is_hwirq); evcnt_attach_dynamic(>is_ev, EVCNT_TYPE_INTR, NULL, - pic->pic_name, is->is_source); + pic->pic_name, is->is_evname); } /* @@ -744,7 +746,7 @@ intr_get_source(const char *intrid) int irq; for (irq = 0, is = intrsources; irq < NVIRQ; irq++, is++) { - if (strcmp(intrid, is->is_source) == 0) + if (strcmp(intrid, is->is_intrid) == 0) return is; } return NULL; @@ -858,7 +860,7 @@ interrupt_construct_intrids(const kcpuse if (is->is_hand == NULL) continue; - strncpy(ids[i], is->is_source, sizeof(intrid_t)); + strncpy(ids[i], is->is_intrid, sizeof(intrid_t)); i++; } Index: src/sys/arch/powerpc/pic/picvar.h diff -u src/sys/arch/powerpc/pic/picvar.h:1.12 src/sys/arch/powerpc/pic/picvar.h:1.13 --- src/sys/arch/powerpc/pic/picvar.h:1.12 Thu Apr 16 23:29:52 2020 +++ src/sys/arch/powerpc/pic/picvar.h Mon Mar 22 01:36:10 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: picvar.h,v 1.12 2020/04/16 23:29:52 rin Exp $ */ +/* $NetBSD: picvar.h,v 1.13 2021/03/22 01:36:10 rin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: picvar.h,v 1.12 2020/04/16 23:29:52 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: picvar.h,v 1.13 2021/03/22 01:36:10 rin Exp $"); #ifndef PIC_VAR_H #define PIC_VAR_H @@ -62,7 +62,8 @@ struct intr_source { struct intrhand *is_hand; struct pic_ops *is_pic; struct evcnt is_ev; - char is_source[16]; + char is_evname[16]; + char is_intrid[INTRIDBUF]; }; #define OPENPIC_MAX_ISUS 4
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Sat Mar 6 07:24:25 UTC 2021 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: Include PIC name to interrupt source, instead of just "irq", so that it appears in "interrupt id" field of intrctl(8). Should be useful when multiple PICs are simultaneously available as in 405EX (where uic[12] are cascaded to uic0). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.30 src/sys/arch/powerpc/pic/intr.c:1.31 --- src/sys/arch/powerpc/pic/intr.c:1.30 Tue Mar 2 07:37:27 2021 +++ src/sys/arch/powerpc/pic/intr.c Sat Mar 6 07:24:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.30 2021/03/02 07:37:27 rin Exp $ */ +/* $NetBSD: intr.c,v 1.31 2021/03/06 07:24:24 rin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -29,7 +29,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.30 2021/03/02 07:37:27 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.31 2021/03/06 07:24:24 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_interrupt.h" @@ -200,8 +200,8 @@ intr_establish_xname(int hwirq, int type break; } if (is->is_hand == NULL) { - snprintf(is->is_source, sizeof(is->is_source), "irq %d", - is->is_hwirq); + snprintf(is->is_source, sizeof(is->is_source), "%s %d", + pic->pic_name, is->is_hwirq); evcnt_attach_dynamic(>is_ev, EVCNT_TYPE_INTR, NULL, pic->pic_name, is->is_source); }
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Fri Mar 5 07:16:33 UTC 2021 Modified Files: src/sys/arch/powerpc/pic: ipi_openpic.c Log Message: Convert to intr_establish_xname(). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/pic/ipi_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/ipi_openpic.c diff -u src/sys/arch/powerpc/pic/ipi_openpic.c:1.9 src/sys/arch/powerpc/pic/ipi_openpic.c:1.10 --- src/sys/arch/powerpc/pic/ipi_openpic.c:1.9 Mon Jul 6 09:34:18 2020 +++ src/sys/arch/powerpc/pic/ipi_openpic.c Fri Mar 5 07:16:33 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ipi_openpic.c,v 1.9 2020/07/06 09:34:18 rin Exp $ */ +/* $NetBSD: ipi_openpic.c,v 1.10 2021/03/05 07:16:33 rin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipi_openpic.c,v 1.9 2020/07/06 09:34:18 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipi_openpic.c,v 1.10 2021/03/05 07:16:33 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_multiprocessor.h" @@ -106,7 +106,8 @@ openpic_send_ipi(cpuid_t target, uint32_ static void openpic_establish_ipi(int type, int level, void *ih_args) { - intr_establish(ipiops.ppc_ipi_vector, type, level, ipi_intr, ih_args); + intr_establish_xname(ipiops.ppc_ipi_vector, type, level, ipi_intr, + ih_args, "openpic ipi"); } #endif /*MULTIPROCESSOR*/
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Mon Jul 13 00:04:04 UTC 2020 Modified Files: src/sys/arch/powerpc/pic: pic_openpic.c Log Message: Drop unused opt_interrupt.h include. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/pic/pic_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/pic_openpic.c diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.18 src/sys/arch/powerpc/pic/pic_openpic.c:1.19 --- src/sys/arch/powerpc/pic/pic_openpic.c:1.18 Sun Jul 12 23:54:38 2020 +++ src/sys/arch/powerpc/pic/pic_openpic.c Mon Jul 13 00:04:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.18 2020/07/12 23:54:38 rin Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.19 2020/07/13 00:04:03 rin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,10 +27,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.18 2020/07/12 23:54:38 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.19 2020/07/13 00:04:03 rin Exp $"); #ifdef _KERNEL_OPT -#include "opt_interrupt.h" #include "opt_multiprocessor.h" #endif
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Sun Jul 12 23:54:39 UTC 2020 Modified Files: src/sys/arch/powerpc/pic: pic_openpic.c Log Message: No need to test _KERNEL_OPT twice. No binary changes. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/pic/pic_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/pic_openpic.c diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.17 src/sys/arch/powerpc/pic/pic_openpic.c:1.18 --- src/sys/arch/powerpc/pic/pic_openpic.c:1.17 Mon Jul 6 10:54:56 2020 +++ src/sys/arch/powerpc/pic/pic_openpic.c Sun Jul 12 23:54:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.17 2020/07/06 10:54:56 rin Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.18 2020/07/12 23:54:38 rin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,13 +27,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.17 2020/07/06 10:54:56 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.18 2020/07/12 23:54:38 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_interrupt.h" -#endif - -#ifdef _KERNEL_OPT #include "opt_multiprocessor.h" #endif
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Mon Jul 6 11:02:44 UTC 2020 Modified Files: src/sys/arch/powerpc/pic: openpic_common.c pic_distopenpic.c Log Message: Drop unused opt_interrupt.h. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/pic/openpic_common.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/pic/pic_distopenpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/openpic_common.c diff -u src/sys/arch/powerpc/pic/openpic_common.c:1.8 src/sys/arch/powerpc/pic/openpic_common.c:1.9 --- src/sys/arch/powerpc/pic/openpic_common.c:1.8 Mon Jul 6 09:34:18 2020 +++ src/sys/arch/powerpc/pic/openpic_common.c Mon Jul 6 11:02:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: openpic_common.c,v 1.8 2020/07/06 09:34:18 rin Exp $ */ +/* $NetBSD: openpic_common.c,v 1.9 2020/07/06 11:02:44 rin Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,10 +27,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: openpic_common.c,v 1.8 2020/07/06 09:34:18 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: openpic_common.c,v 1.9 2020/07/06 11:02:44 rin Exp $"); #ifdef _KERNEL_OPT -#include "opt_interrupt.h" #include "opt_openpic.h" #endif Index: src/sys/arch/powerpc/pic/pic_distopenpic.c diff -u src/sys/arch/powerpc/pic/pic_distopenpic.c:1.12 src/sys/arch/powerpc/pic/pic_distopenpic.c:1.13 --- src/sys/arch/powerpc/pic/pic_distopenpic.c:1.12 Mon Jul 6 09:34:18 2020 +++ src/sys/arch/powerpc/pic/pic_distopenpic.c Mon Jul 6 11:02:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_distopenpic.c,v 1.12 2020/07/06 09:34:18 rin Exp $ */ +/* $NetBSD: pic_distopenpic.c,v 1.13 2020/07/06 11:02:44 rin Exp $ */ /*- * Copyright (c) 2008 Tim Rightnour @@ -30,10 +30,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_distopenpic.c,v 1.12 2020/07/06 09:34:18 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_distopenpic.c,v 1.13 2020/07/06 11:02:44 rin Exp $"); #ifdef _KERNEL_OPT -#include "opt_interrupt.h" #include "opt_openpic.h" #endif
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rin Date: Mon Jul 6 11:01:24 UTC 2020 Modified Files: src/sys/arch/powerpc/pic: ipi.c Log Message: Drop unused opt_altivec.h, opt_interrupt.h, opt_ipi.h, and opt_pic.h. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/pic/ipi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/ipi.c diff -u src/sys/arch/powerpc/pic/ipi.c:1.15 src/sys/arch/powerpc/pic/ipi.c:1.16 --- src/sys/arch/powerpc/pic/ipi.c:1.15 Mon Jul 6 09:34:18 2020 +++ src/sys/arch/powerpc/pic/ipi.c Mon Jul 6 11:01:24 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ipi.c,v 1.15 2020/07/06 09:34:18 rin Exp $ */ +/* $NetBSD: ipi.c,v 1.16 2020/07/06 11:01:24 rin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,14 +29,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.15 2020/07/06 09:34:18 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.16 2020/07/06 11:01:24 rin Exp $"); #ifdef _KERNEL_OPT -#include "opt_altivec.h" -#include "opt_interrupt.h" -#include "opt_ipi.h" #include "opt_multiprocessor.h" -#include "opt_pic.h" #endif #include
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Wed May 16 21:54:38 UTC 2018 Modified Files: src/sys/arch/powerpc/pic: pic_openpic.c Log Message: special case IPIs so we don't mess with hardware IRQ sources now SMP works on my PCI-X G5 To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/pic/pic_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/pic_openpic.c diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.13 src/sys/arch/powerpc/pic/pic_openpic.c:1.14 --- src/sys/arch/powerpc/pic/pic_openpic.c:1.13 Thu Mar 22 21:27:36 2018 +++ src/sys/arch/powerpc/pic/pic_openpic.c Wed May 16 21:54:38 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.13 2018/03/22 21:27:36 macallan Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.14 2018/05/16 21:54:38 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.13 2018/03/22 21:27:36 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.14 2018/05/16 21:54:38 macallan Exp $"); #include #include @@ -66,7 +66,7 @@ setup_openpic(void *addr, int passthroug "Supports %d CPUs and %d interrupt sources.\n", x & 0xff, ((x & 0x1f00) >> 8) + 1, ((x & 0x07ff) >> 16) + 1); - pic->pic_numintrs = ((x & 0x07ff) >> 16) + 2; /* one more slot for IPI */ + pic->pic_numintrs = IPI_VECTOR + 1; pic->pic_cookie = addr; pic->pic_enable_irq = opic_enable_irq; pic->pic_reenable_irq = opic_enable_irq; @@ -92,7 +92,7 @@ setup_openpic(void *addr, int passthroug #if 1 openpic_set_priority(0, 15); - for (irq = 0; irq < pic->pic_numintrs; irq++) { + for (irq = 0; irq < (pic->pic_numintrs - 1); irq++) { /* make sure to keep disabled */ openpic_write(OPENPIC_SRC_VECTOR(irq), OPENPIC_IMASK); /* send all interrupts to CPU 0 */ @@ -155,7 +155,10 @@ opic_establish_irq(struct pic_ops *pic, x |= OPENPIC_SENSE_LEVEL; x |= realpri << OPENPIC_PRIORITY_SHIFT; - openpic_write(OPENPIC_SRC_VECTOR(irq), x); +#ifdef MULTIPROCESSOR + if (irq < IPI_VECTOR) +#endif + openpic_write(OPENPIC_SRC_VECTOR(irq), x); aprint_debug("%s: setting IRQ %d to priority %d\n", __func__, irq, realpri); @@ -165,7 +168,9 @@ static void opic_enable_irq(struct pic_ops *pic, int irq, int type) { u_int x; - +#ifdef MULTIPROCESSOR + if (irq == IPI_VECTOR) return; +#endif x = openpic_read(OPENPIC_SRC_VECTOR(irq)); x &= ~OPENPIC_IMASK; openpic_write(OPENPIC_SRC_VECTOR(irq), x); @@ -176,6 +181,9 @@ opic_disable_irq(struct pic_ops *pic, in { u_int x; +#ifdef MULTIPROCESSOR + if (irq == IPI_VECTOR) return; +#endif x = openpic_read(OPENPIC_SRC_VECTOR(irq)); x |= OPENPIC_IMASK; openpic_write(OPENPIC_SRC_VECTOR(irq), x);
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Fri May 11 22:39:59 UTC 2018 Modified Files: src/sys/arch/powerpc/pic: picvar.h Log Message: use 128 as IPI_VECTOR to avoid overlap wth hardware interrupts To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/pic/picvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/picvar.h diff -u src/sys/arch/powerpc/pic/picvar.h:1.9 src/sys/arch/powerpc/pic/picvar.h:1.10 --- src/sys/arch/powerpc/pic/picvar.h:1.9 Sat Jun 18 06:41:44 2011 +++ src/sys/arch/powerpc/pic/picvar.h Fri May 11 22:39:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: picvar.h,v 1.9 2011/06/18 06:41:44 matt Exp $ */ +/* $NetBSD: picvar.h,v 1.10 2018/05/11 22:39:59 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: picvar.h,v 1.9 2011/06/18 06:41:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: picvar.h,v 1.10 2018/05/11 22:39:59 macallan Exp $"); #ifndef PIC_VAR_H #define PIC_VAR_H @@ -132,6 +132,6 @@ void opic_ack_irq(struct pic_ops *pic, i /* IPI handler */ int cpuintr(void *); /* XXX - may need to be PIC specific */ -#define IPI_VECTOR 64 +#define IPI_VECTOR 128 #endif /* PIC_VAR_H */
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Thu Mar 22 21:27:36 UTC 2018 Modified Files: src/sys/arch/powerpc/pic: pic_openpic.c Log Message: don't call mapiodev() - the caller should hand us a usable address To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/pic/pic_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/pic_openpic.c diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.12 src/sys/arch/powerpc/pic/pic_openpic.c:1.13 --- src/sys/arch/powerpc/pic/pic_openpic.c:1.12 Fri Mar 2 19:36:19 2018 +++ src/sys/arch/powerpc/pic/pic_openpic.c Thu Mar 22 21:27:36 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.12 2018/03/02 19:36:19 macallan Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.13 2018/03/22 21:27:36 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.12 2018/03/02 19:36:19 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.13 2018/03/22 21:27:36 macallan Exp $"); #include #include @@ -54,7 +54,7 @@ setup_openpic(void *addr, int passthroug int irq; u_int x; - openpic_base = mapiodev((paddr_t)addr, 0x4, false); + openpic_base = addr; opicops = kmem_alloc(sizeof(*opicops), KM_SLEEP); pic = >pic;
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Thu Mar 1 16:03:02 UTC 2018 Modified Files: src/sys/arch/powerpc/pic: pic_openpic.c Log Message: use mapiodev() so this can work on G5s To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/powerpc/pic/pic_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/pic_openpic.c diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.10 src/sys/arch/powerpc/pic/pic_openpic.c:1.11 --- src/sys/arch/powerpc/pic/pic_openpic.c:1.10 Thu Jun 1 02:45:07 2017 +++ src/sys/arch/powerpc/pic/pic_openpic.c Thu Mar 1 16:03:02 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.10 2017/06/01 02:45:07 chs Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.11 2018/03/01 16:03:02 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.10 2017/06/01 02:45:07 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.11 2018/03/01 16:03:02 macallan Exp $"); #include #include @@ -54,7 +54,7 @@ setup_openpic(void *addr, int passthroug int irq; u_int x; - openpic_base = (void *)addr; + openpic_base = mapiodev((paddr_t)addr, 0x4, false); opicops = kmem_alloc(sizeof(*opicops), KM_SLEEP); pic = >pic;
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Thu May 26 17:38:06 UTC 2016 Modified Files: src/sys/arch/powerpc/pic: intr.c ipi_openpic.c pic_openpic.c Log Message: treat IPIs like regular interrupts at IPL_HIGH should fix port-powerpc/44387 tested by chuq To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/pic/intr.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/pic/ipi_openpic.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/pic/pic_openpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.23 src/sys/arch/powerpc/pic/intr.c:1.24 --- src/sys/arch/powerpc/pic/intr.c:1.23 Fri Aug 31 13:12:52 2012 +++ src/sys/arch/powerpc/pic/intr.c Thu May 26 17:38:05 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.23 2012/08/31 13:12:52 macallan Exp $ */ +/* $NetBSD: intr.c,v 1.24 2016/05/26 17:38:05 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.23 2012/08/31 13:12:52 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.24 2016/05/26 17:38:05 macallan Exp $"); #include "opt_interrupt.h" #include "opt_multiprocessor.h" @@ -548,18 +548,8 @@ pic_handle_intr(void *cookie) const int pcpl = ci->ci_cpl; do { -#ifdef MULTIPROCESSOR - /* THIS IS WRONG XXX */ - if (picirq == ipiops.ppc_ipi_vector) { - ci->ci_cpl = IPL_HIGH; - ipi_intr(NULL); - ci->ci_cpl = pcpl; - pic->pic_ack_irq(pic, picirq); - continue; - } -#endif - const int virq = virq_map[picirq + pic->pic_intrbase]; + KASSERT(virq != 0); KASSERT(picirq < pic->pic_numintrs); imask_t v_imen = PIC_VIRQ_TO_MASK(virq); Index: src/sys/arch/powerpc/pic/ipi_openpic.c diff -u src/sys/arch/powerpc/pic/ipi_openpic.c:1.7 src/sys/arch/powerpc/pic/ipi_openpic.c:1.8 --- src/sys/arch/powerpc/pic/ipi_openpic.c:1.7 Wed Feb 1 09:54:03 2012 +++ src/sys/arch/powerpc/pic/ipi_openpic.c Thu May 26 17:38:05 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ipi_openpic.c,v 1.7 2012/02/01 09:54:03 matt Exp $ */ +/* $NetBSD: ipi_openpic.c,v 1.8 2016/05/26 17:38:05 macallan Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipi_openpic.c,v 1.7 2012/02/01 09:54:03 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipi_openpic.c,v 1.8 2016/05/26 17:38:05 macallan Exp $"); #include "opt_multiprocessor.h" #include @@ -103,15 +103,7 @@ openpic_send_ipi(cpuid_t target, uint32_ static void openpic_establish_ipi(int type, int level, void *ih_args) { -/* - * XXX - * for now we catch IPIs early in pic_handle_intr() so no need to do anything - * here - */ -#if 0 - intr_establish(ipiops.ppc_ipi_vector, type, level, ppcipi_intr, - ih_args); -#endif + intr_establish(ipiops.ppc_ipi_vector, type, level, ipi_intr, ih_args); } #endif /*MULTIPROCESSOR*/ Index: src/sys/arch/powerpc/pic/pic_openpic.c diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.8 src/sys/arch/powerpc/pic/pic_openpic.c:1.9 --- src/sys/arch/powerpc/pic/pic_openpic.c:1.8 Wed Feb 1 09:54:03 2012 +++ src/sys/arch/powerpc/pic/pic_openpic.c Thu May 26 17:38:05 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.8 2012/02/01 09:54:03 matt Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.9 2016/05/26 17:38:05 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.8 2012/02/01 09:54:03 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.9 2016/05/26 17:38:05 macallan Exp $"); #include #include @@ -67,7 +67,7 @@ setup_openpic(void *addr, int passthroug "Supports %d CPUs and %d interrupt sources.\n", x & 0xff, ((x & 0x1f00) >> 8) + 1, ((x & 0x07ff) >> 16) + 1); - pic->pic_numintrs = ((x & 0x07ff) >> 16) + 1; + pic->pic_numintrs = ((x & 0x07ff) >> 16) + 2; /* one more slot for IPI */ pic->pic_cookie = addr; pic->pic_enable_irq = opic_enable_irq; pic->pic_reenable_irq = opic_enable_irq;
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: christos Date: Thu Sep 19 23:28:52 UTC 2013 Modified Files: src/sys/arch/powerpc/pic: openpic_common.c Log Message: use ci_index. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/pic/openpic_common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/openpic_common.c diff -u src/sys/arch/powerpc/pic/openpic_common.c:1.6 src/sys/arch/powerpc/pic/openpic_common.c:1.7 --- src/sys/arch/powerpc/pic/openpic_common.c:1.6 Wed Feb 1 04:54:03 2012 +++ src/sys/arch/powerpc/pic/openpic_common.c Thu Sep 19 19:28:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: openpic_common.c,v 1.6 2012/02/01 09:54:03 matt Exp $ */ +/* $NetBSD: openpic_common.c,v 1.7 2013/09/19 23:28:52 christos Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: openpic_common.c,v 1.6 2012/02/01 09:54:03 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: openpic_common.c,v 1.7 2013/09/19 23:28:52 christos Exp $); #include opt_openpic.h #include opt_interrupt.h @@ -52,7 +52,7 @@ opic_finish_setup(struct pic_ops *pic) #ifdef OPENPIC_DISTRIBUTE for (i = 0; i ncpu; i++) - cpumask |= (1 cpu_info[i].ci_cpuid); + cpumask |= (1 cpu_info[i].ci_index); #else cpumask = 1; #endif
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Fri Aug 31 13:12:52 UTC 2012 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: when calculating per-IPL virq masks, take into account that shared IRQs may request different IPLs fixes vr(4)-related problems seen on ofppc To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.22 src/sys/arch/powerpc/pic/intr.c:1.23 --- src/sys/arch/powerpc/pic/intr.c:1.22 Thu Jun 7 04:37:09 2012 +++ src/sys/arch/powerpc/pic/intr.c Fri Aug 31 13:12:52 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.22 2012/06/07 04:37:09 macallan Exp $ */ +/* $NetBSD: intr.c,v 1.23 2012/08/31 13:12:52 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.22 2012/06/07 04:37:09 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.23 2012/08/31 13:12:52 macallan Exp $); #include opt_interrupt.h #include opt_multiprocessor.h @@ -352,8 +352,9 @@ intr_typename(int type) static void intr_calculatemasks(void) { - imask_t newmask[NIPL] = { [IPL_NONE...IPL_HIGH] = 0 }; + imask_t newmask[NIPL]; struct intr_source *is; + struct intrhand *ih; int irq; for (u_int ipl = IPL_NONE; ipl NIPL; ipl++) { @@ -362,7 +363,9 @@ intr_calculatemasks(void) /* First, figure out which ipl each IRQ uses. */ for (irq = 0, is = intrsources; irq NVIRQ; irq++, is++) { - newmask[is-is_ipl] |= PIC_VIRQ_TO_MASK(irq); + for (ih = is-is_hand; ih != NULL; ih = ih-ih_next) { + newmask[ih-ih_ipl] |= PIC_VIRQ_TO_MASK(irq); + } } /* @@ -379,7 +382,7 @@ intr_calculatemasks(void) newmask[ipl] |= newmask[ipl - 1]; } -#ifdef DEBUG_IPL +#ifdef PIC_DEBUG for (u_int ipl = 0; ipl NIPL; ipl++) { printf(%u: %08x - %08x\n, ipl, imask[ipl], newmask[ipl]); } @@ -661,10 +664,10 @@ spllower(int ncpl) void genppc_cpu_configure(void) { - aprint_normal(biomask %x netmask %x ttymask %x\n, - (u_int)imask[IPL_BIO] 0x1fff, - (u_int)imask[IPL_NET] 0x1fff, - (u_int)imask[IPL_TTY] 0x1fff); + aprint_normal(vmmask %x schedmask %x highmask %x\n, + (u_int)imask[IPL_VM] 0x7fff, + (u_int)imask[IPL_SCHED] 0x7fff, + (u_int)imask[IPL_HIGH] 0x7fff); spl0(); }
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Thu Jun 7 02:39:22 UTC 2012 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: look at the right cpu_softints bits in pic_do_pending_int() so we call the right softint handlers To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.20 src/sys/arch/powerpc/pic/intr.c:1.21 --- src/sys/arch/powerpc/pic/intr.c:1.20 Wed Feb 1 09:54:03 2012 +++ src/sys/arch/powerpc/pic/intr.c Thu Jun 7 02:39:22 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.20 2012/02/01 09:54:03 matt Exp $ */ +/* $NetBSD: intr.c,v 1.21 2012/06/07 02:39:22 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.20 2012/02/01 09:54:03 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.21 2012/06/07 02:39:22 macallan Exp $); #include opt_interrupt.h #include opt_multiprocessor.h @@ -508,7 +508,11 @@ again: } #ifdef __HAVE_FAST_SOFTINTS - const u_int softints = (ci-ci_data.cpu_softints pcpl) IPL_SOFTMASK; + const u_int softints = ci-ci_data.cpu_softints + (IPL_SOFTMASK pcpl); + + /* make sure there are no bits to screw with the line above */ + KASSERT((ci-ci_data.cpu_softints ~IPL_SOFTMASK) == 0); if (__predict_false(softints != 0)) { ci-ci_cpl = IPL_HIGH;
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Thu Jun 7 04:37:09 UTC 2012 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: fix same thinko as in previous commit, in have_pending_intr_p() To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.21 src/sys/arch/powerpc/pic/intr.c:1.22 --- src/sys/arch/powerpc/pic/intr.c:1.21 Thu Jun 7 02:39:22 2012 +++ src/sys/arch/powerpc/pic/intr.c Thu Jun 7 04:37:09 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.21 2012/06/07 02:39:22 macallan Exp $ */ +/* $NetBSD: intr.c,v 1.22 2012/06/07 04:37:09 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.21 2012/06/07 02:39:22 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.22 2012/06/07 04:37:09 macallan Exp $); #include opt_interrupt.h #include opt_multiprocessor.h @@ -622,7 +622,7 @@ have_pending_intr_p(struct cpu_info *ci, if (ci-ci_ipending ~imask[ncpl]) return true; #ifdef __HAVE_FAST_SOFTINTS - if ((ci-ci_data.cpu_softints ncpl) IPL_SOFTMASK) + if (ci-ci_data.cpu_softints (IPL_SOFTMASK ncpl)) return true; #endif return false;
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: matt Date: Thu Oct 13 19:49:50 UTC 2011 Modified Files: src/sys/arch/powerpc/pic: ipivar.h Log Message: Don't declare cpu_send_ipi if BOOKE To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/pic/ipivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/ipivar.h diff -u src/sys/arch/powerpc/pic/ipivar.h:1.5 src/sys/arch/powerpc/pic/ipivar.h:1.6 --- src/sys/arch/powerpc/pic/ipivar.h:1.5 Sun Jun 5 16:52:26 2011 +++ src/sys/arch/powerpc/pic/ipivar.h Thu Oct 13 19:49:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ipivar.h,v 1.5 2011/06/05 16:52:26 matt Exp $ */ +/* $NetBSD: ipivar.h,v 1.6 2011/10/13 19:49:50 matt Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,11 +29,16 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ipivar.h,v 1.5 2011/06/05 16:52:26 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: ipivar.h,v 1.6 2011/10/13 19:49:50 matt Exp $); #ifndef _IPI_VAR_H_ #define _IPI_VAR_H_ +#ifdef _KERNEL_OPT +#include opt_ppcarch.h +#endif + +#if defined(_KERNEL) !defined(PPC_BOOKE) struct ipi_ops { void (*ppc_send_ipi)(cpuid_t, uint32_t); /* type, level, arg */ @@ -64,5 +69,6 @@ cpu_send_ipi(cpuid_t cpuid, uint32_t msg { (*ipiops.ppc_send_ipi)(cpuid, msg); } +#endif #endif /*_IPI_VAR_H_*/
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: mrg Date: Sat Jul 2 13:08:25 UTC 2011 Modified Files: src/sys/arch/powerpc/pic: pic_distopenpic.c Log Message: avoid some uninitialised variable warnings from GCC 4.5. i'm pretty sure they can't happen in practise, but i can see why GCC isn't sure. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/pic/pic_distopenpic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/pic_distopenpic.c diff -u src/sys/arch/powerpc/pic/pic_distopenpic.c:1.6 src/sys/arch/powerpc/pic/pic_distopenpic.c:1.7 --- src/sys/arch/powerpc/pic/pic_distopenpic.c:1.6 Mon Jun 20 06:21:45 2011 +++ src/sys/arch/powerpc/pic/pic_distopenpic.c Sat Jul 2 13:08:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pic_distopenpic.c,v 1.6 2011/06/20 06:21:45 matt Exp $ */ +/* $NetBSD: pic_distopenpic.c,v 1.7 2011/07/02 13:08:25 mrg Exp $ */ /*- * Copyright (c) 2008 Tim Rightnour @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pic_distopenpic.c,v 1.6 2011/06/20 06:21:45 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: pic_distopenpic.c,v 1.7 2011/07/02 13:08:25 mrg Exp $); #include opt_openpic.h #include opt_interrupt.h @@ -174,7 +174,7 @@ distopic_establish_irq(struct pic_ops *pic, int irq, int type, int pri) { struct openpic_ops *opic = (struct openpic_ops *)pic; - int isu, realirq, realpri = max(1, min(15, pri)); + int isu, realirq = -1, realpri = max(1, min(15, pri)); uint32_t x; isu = opic_isu_from_irq(opic, irq, realirq); @@ -196,7 +196,7 @@ distopic_enable_irq(struct pic_ops *pic, int irq, int type) { struct openpic_ops *opic = (struct openpic_ops *)pic; - int isu, realirq; + int isu, realirq = -1; u_int x; isu = opic_isu_from_irq(opic, irq, realirq); @@ -210,7 +210,7 @@ distopic_disable_irq(struct pic_ops *pic, int irq) { struct openpic_ops *opic = (struct openpic_ops *)pic; - int isu, realirq; + int isu, realirq = -1; u_int x; isu = opic_isu_from_irq(opic, irq, realirq);
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rjs Date: Tue Jun 21 18:02:43 UTC 2011 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: Make it compile when PIC_DEBUG is defined. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.16 src/sys/arch/powerpc/pic/intr.c:1.17 --- src/sys/arch/powerpc/pic/intr.c:1.16 Mon Jun 20 06:23:52 2011 +++ src/sys/arch/powerpc/pic/intr.c Tue Jun 21 18:02:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.16 2011/06/20 06:23:52 matt Exp $ */ +/* $NetBSD: intr.c,v 1.17 2011/06/21 18:02:43 rjs Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.16 2011/06/20 06:23:52 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.17 2011/06/21 18:02:43 rjs Exp $); #include opt_interrupt.h #include opt_multiprocessor.h @@ -319,7 +319,7 @@ is-is_pic = pic; virq_map[hwirq] = virq; #ifdef PIC_DEBUG - printf(mapping hwirq %d to virq %d\n, irq, virq); + printf(mapping hwirq %d to virq %d\n, hwirq, virq); #endif return virq; }
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: matt Date: Mon Jun 20 06:23:52 UTC 2011 Modified Files: src/sys/arch/powerpc/pic: intr.c ipi.c Log Message: Cleanup includes. Explicitly include powerpc/psl.h To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/pic/intr.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/pic/ipi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.15 src/sys/arch/powerpc/pic/intr.c:1.16 --- src/sys/arch/powerpc/pic/intr.c:1.15 Fri Jun 17 23:36:18 2011 +++ src/sys/arch/powerpc/pic/intr.c Mon Jun 20 06:23:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.15 2011/06/17 23:36:18 matt Exp $ */ +/* $NetBSD: intr.c,v 1.16 2011/06/20 06:23:52 matt Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,26 +27,28 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.15 2011/06/17 23:36:18 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.16 2011/06/20 06:23:52 matt Exp $); +#include opt_interrupt.h #include opt_multiprocessor.h +#include opt_pic.h #define __INTR_PRIVATE #include sys/param.h -#include sys/malloc.h -#include sys/kernel.h #include sys/cpu.h +#include sys/kernel.h +#include sys/malloc.h + +#include powerpc/psl.h +#include powerpc/pic/picvar.h -#include arch/powerpc/pic/picvar.h -#include opt_pic.h -#include opt_interrupt.h #if defined(PIC_I8259) || defined (PIC_PREPIVR) #include machine/isa_machdep.h #endif #ifdef MULTIPROCESSOR -#include arch/powerpc/pic/ipivar.h +#include powerpc/pic/ipivar.h #endif #ifdef __HAVE_FAST_SOFTINTS Index: src/sys/arch/powerpc/pic/ipi.c diff -u src/sys/arch/powerpc/pic/ipi.c:1.9 src/sys/arch/powerpc/pic/ipi.c:1.10 --- src/sys/arch/powerpc/pic/ipi.c:1.9 Sun Jun 5 16:52:26 2011 +++ src/sys/arch/powerpc/pic/ipi.c Mon Jun 20 06:23:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ipi.c,v 1.9 2011/06/05 16:52:26 matt Exp $ */ +/* $NetBSD: ipi.c,v 1.10 2011/06/20 06:23:52 matt Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ipi.c,v 1.9 2011/06/05 16:52:26 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: ipi.c,v 1.10 2011/06/20 06:23:52 matt Exp $); #include opt_multiprocessor.h #include opt_pic.h @@ -42,8 +42,10 @@ #include sys/atomic.h #include sys/cpu.h -#include arch/powerpc/pic/picvar.h -#include arch/powerpc/pic/ipivar.h +#include powerpc/psl.h + +#include powerpc/pic/picvar.h +#include powerpc/pic/ipivar.h #include opt_ipi.h #ifdef MULTIPROCESSOR
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: matt Date: Thu Jun 16 04:37:48 UTC 2011 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: Make sure OEA ports without __HAVE_FAST_SOFTINTS still compile. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.12 src/sys/arch/powerpc/pic/intr.c:1.13 --- src/sys/arch/powerpc/pic/intr.c:1.12 Thu Jun 16 02:43:43 2011 +++ src/sys/arch/powerpc/pic/intr.c Thu Jun 16 04:37:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.12 2011/06/16 02:43:43 macallan Exp $ */ +/* $NetBSD: intr.c,v 1.13 2011/06/16 04:37:48 matt Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.12 2011/06/16 02:43:43 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.13 2011/06/16 04:37:48 matt Exp $); #include opt_multiprocessor.h @@ -693,6 +693,18 @@ return ocpl; } +static inline bool +have_pending_intr_p(struct cpu_info *ci, int ncpl) +{ + if (ci-ci_ipending ~imask[ncpl]) + return true; +#ifdef __HAVE_FAST_SOFTINTS + if ((ci-ci_data.cpu_softints ncpl) IPL_SOFTMASK) + return true; +#endif + return false; +} + void splx(int ncpl) { @@ -701,9 +713,9 @@ __insn_barrier(); __asm volatile(sync; eieio); /* reorder protect */ ci-ci_cpl = ncpl; - if ((ci-ci_ipending ~imask[ncpl]) || - ((ci-ci_data.cpu_softints ncpl) IPL_SOFTMASK)) + if (have_pending_intr_p(ci, ncpl)) pic_do_pending_int(); + __asm volatile(sync; eieio); /* reorder protect */ } @@ -717,8 +729,7 @@ __asm volatile(sync; eieio); /* reorder protect */ ocpl = ci-ci_cpl; ci-ci_cpl = ncpl; - if ((ci-ci_ipending ~imask[ncpl]) || - ((ci-ci_data.cpu_softints ncpl) IPL_SOFTMASK)) + if (have_pending_intr_p(ci, ncpl)) pic_do_pending_int(); __asm volatile(sync; eieio); /* reorder protect */ return ocpl;
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: rmind Date: Fri Jun 25 19:00:06 UTC 2010 Modified Files: src/sys/arch/powerpc/pic: ipi.c Log Message: Add missing sys/xcall.h inclusion, remove sys/malloc.h one. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/pic/ipi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/ipi.c diff -u src/sys/arch/powerpc/pic/ipi.c:1.5 src/sys/arch/powerpc/pic/ipi.c:1.6 --- src/sys/arch/powerpc/pic/ipi.c:1.5 Tue Jun 22 18:29:02 2010 +++ src/sys/arch/powerpc/pic/ipi.c Fri Jun 25 19:00:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ipi.c,v 1.5 2010/06/22 18:29:02 rmind Exp $ */ +/* $NetBSD: ipi.c,v 1.6 2010/06/25 19:00:05 rmind Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ipi.c,v 1.5 2010/06/22 18:29:02 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: ipi.c,v 1.6 2010/06/25 19:00:05 rmind Exp $); #include opt_multiprocessor.h #include opt_pic.h @@ -37,8 +37,8 @@ #include opt_altivec.h #include sys/param.h -#include sys/malloc.h #include sys/kernel.h +#include sys/xcall.h #include powerpc/atomic.h #include powerpc/fpu.h
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: macallan Date: Wed May 12 06:11:31 UTC 2010 Modified Files: src/sys/arch/powerpc/pic: intr.c Log Message: make this work again To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/pic/intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/intr.c diff -u src/sys/arch/powerpc/pic/intr.c:1.8 src/sys/arch/powerpc/pic/intr.c:1.9 --- src/sys/arch/powerpc/pic/intr.c:1.8 Sat Apr 24 09:39:57 2010 +++ src/sys/arch/powerpc/pic/intr.c Wed May 12 06:11:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.8 2010/04/24 09:39:57 kiyohara Exp $ */ +/* $NetBSD: intr.c,v 1.9 2010/05/12 06:11:31 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.8 2010/04/24 09:39:57 kiyohara Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.9 2010/05/12 06:11:31 macallan Exp $); #include opt_multiprocessor.h @@ -682,7 +682,7 @@ __asm volatile(sync; eieio); /* don't reorder */ ocpl = ci-ci_cpl; - ci-ci_cpl = ncpl; + ci-ci_cpl = ocpl | ncpl; __asm volatile(sync; eieio); /* reorder protect */ return ocpl; }
CVS commit: src/sys/arch/powerpc/pic
Module Name:src Committed By: nisimura Date: Wed Aug 19 06:22:54 UTC 2009 Modified Files: src/sys/arch/powerpc/pic: files.pic picvar.h Added Files: src/sys/arch/powerpc/pic: pic_mpcsoc.c Log Message: - Have pic_mpcsoc.c to adapt variations of Moto/Freescale OpenPIC compliant interrupt controllers. Mostly the refrain of pic_openpic.c and shall be useful for 85xx/86xx/QorIQ and Tundra product lines. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/pic/files.pic cvs rdiff -u -r0 -r1.1 src/sys/arch/powerpc/pic/pic_mpcsoc.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/pic/picvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/pic/files.pic diff -u src/sys/arch/powerpc/pic/files.pic:1.3 src/sys/arch/powerpc/pic/files.pic:1.4 --- src/sys/arch/powerpc/pic/files.pic:1.3 Thu Jan 17 23:42:59 2008 +++ src/sys/arch/powerpc/pic/files.pic Wed Aug 19 06:22:54 2009 @@ -1,5 +1,5 @@ # -# $NetBSD: files.pic,v 1.3 2008/01/17 23:42:59 garbled Exp $ +# $NetBSD: files.pic,v 1.4 2009/08/19 06:22:54 nisimura Exp $ # # generic PIC abstraction @@ -10,16 +10,19 @@ define pic_distopenpic define pic_prepivr define pic_i8259 +define pic_mpcsoc defflag opt_interrupt.h PIC_OPENPIC: pic_openpic defflag opt_interrupt.h PIC_DISTOPENPIC: pic_distopenpic defflag opt_interrupt.h PIC_PREPIVR: pic_prepivr defflag opt_interrupt.h PIC_I8259: pic_i8259 +defflag opt_interrupt.h PIC_MPCSOC: pic_mpcsoc defflag opt_interrupt.h OPENPIC_DISTRIBUTE file arch/powerpc/pic/pic_openpic.c pic_openpic needs-flag file arch/powerpc/pic/pic_distopenpic.c pic_distopenpic needs-flag file arch/powerpc/pic/pic_prepivr.c pic_prepivr needs-flag file arch/powerpc/pic/pic_i8259.c pic_i8259 needs-flag +file arch/powerpc/pic/pic_mpcsoc.c pic_mpcsoc file arch/powerpc/pic/i8259_common.c pic_prepivr | pic_i8259 -file arch/powerpc/pic/openpic_common.c pic_openpic | pic_distopenpic +file arch/powerpc/pic/openpic_common.c pic_openpic | pic_distopenpic | pic_mpcsoc Index: src/sys/arch/powerpc/pic/picvar.h diff -u src/sys/arch/powerpc/pic/picvar.h:1.5 src/sys/arch/powerpc/pic/picvar.h:1.6 --- src/sys/arch/powerpc/pic/picvar.h:1.5 Tue Apr 29 06:53:02 2008 +++ src/sys/arch/powerpc/pic/picvar.h Wed Aug 19 06:22:54 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: picvar.h,v 1.5 2008/04/29 06:53:02 martin Exp $ */ +/* $NetBSD: picvar.h,v 1.6 2009/08/19 06:22:54 nisimura Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: picvar.h,v 1.5 2008/04/29 06:53:02 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: picvar.h,v 1.6 2009/08/19 06:22:54 nisimura Exp $); #ifndef PIC_VAR_H #define PIC_VAR_H @@ -113,6 +113,8 @@ struct pic_ops *setup_distributed_openpic(void *, int, void **, int *); struct pic_ops *setup_prepivr(int); struct pic_ops *setup_i8259(void); +struct pic_ops *setup_mpcpic(void *); +void mpcpic_reserv16(void); /* i8259 common decls */ void i8259_initialize(void); Added files: Index: src/sys/arch/powerpc/pic/pic_mpcsoc.c diff -u /dev/null src/sys/arch/powerpc/pic/pic_mpcsoc.c:1.1 --- /dev/null Wed Aug 19 06:22:54 2009 +++ src/sys/arch/powerpc/pic/pic_mpcsoc.c Wed Aug 19 06:22:54 2009 @@ -0,0 +1,204 @@ +/* $NetBSD: pic_mpcsoc.c,v 1.1 2009/08/19 06:22:54 nisimura Exp $ */ + +/*- + * Copyright (c) 2007 Michael Lorenz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include sys/cdefs.h +__KERNEL_RCSID(0, $NetBSD: pic_mpcsoc.c,v 1.1 2009/08/19 06:22:54 nisimura Exp $); + +#include sys/param.h +#include sys/malloc.h +#include