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 Implement intr_string(9)
details: https://anonhg.NetBSD.org/src/rev/9e782ea6b16a
branches: trunk
changeset: 993955:9e782ea6b16a
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Oct 12 21:46:32 2018 +0000
description:
Implement intr_string(9)
diffstat:
sys/arch/arm/pic/pic.c | 22 ++++++++++++++++++++--
sys/arch/arm/pic/picvar.h | 5 ++++-
2 files changed, 24 insertions(+), 3 deletions(-)
diffs (69 lines):
diff -r 7a212ceda26a -r 9e782ea6b16a sys/arch/arm/pic/pic.c
--- a/sys/arch/arm/pic/pic.c Fri Oct 12 21:44:32 2018 +0000
+++ b/sys/arch/arm/pic/pic.c Fri Oct 12 21:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pic.c,v 1.44 2018/07/15 16:03:24 jmcneill Exp $ */
+/* $NetBSD: pic.c,v 1.45 2018/10/12 21:46:32 jmcneill 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.44 2018/07/15 16:03:24 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.45 2018/10/12 21:46:32 jmcneill Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -883,6 +883,24 @@
pic_disestablish_source(is);
}
+const char *
+intr_string(intr_handle_t irq, char *buf, size_t len)
+{
+ for (size_t slot = 0; slot < PIC_MAXPICS; slot++) {
+ struct pic_softc * const pic = pic_list[slot];
+ if (pic == NULL || pic->pic_irqbase < 0)
+ continue;
+ if (pic->pic_irqbase <= irq
+ && irq < pic->pic_irqbase + pic->pic_maxsources) {
+ struct intrsource * const is = pic->pic_sources[irq - pic->pic_irqbase];
+ snprintf(buf, len, "%s %s", pic->pic_name, is->is_source);
+ return buf;
+ }
+ }
+
+ return NULL;
+}
+
#ifdef MULTIPROCESSOR
int
interrupt_distribute(void *ih, const kcpuset_t *newset, kcpuset_t *oldset)
diff -r 7a212ceda26a -r 9e782ea6b16a sys/arch/arm/pic/picvar.h
--- a/sys/arch/arm/pic/picvar.h Fri Oct 12 21:44:32 2018 +0000
+++ b/sys/arch/arm/pic/picvar.h Fri Oct 12 21:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: picvar.h,v 1.19 2018/09/08 11:54:26 jmcneill Exp $ */
+/* $NetBSD: picvar.h,v 1.20 2018/10/12 21:46:32 jmcneill Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -38,6 +38,8 @@
#include <sys/kcpuset.h>
#endif
+typedef uint32_t intr_handle_t; /* for ACPI */
+
int _splraise(int);
int _spllower(int);
void splx(int);
@@ -86,6 +88,7 @@
void *intr_establish(int irq, int ipl, int type, int (*func)(void *),
void *arg);
void intr_disestablish(void *);
+const char *intr_string(intr_handle_t, char *, size_t);
#ifdef MULTIPROCESSOR
void intr_cpu_init(struct cpu_info *);
void intr_ipi_send(const kcpuset_t *, u_long ipi);
Home |
Main Index |
Thread Index |
Old Index