Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm26 Add a "name" argument to irq_establish and fr...
details: https://anonhg.NetBSD.org/src/rev/5b844cf2679a
branches: trunk
changeset: 501792:5b844cf2679a
user: bjh21 <bjh21%NetBSD.org@localhost>
date: Sun Jan 07 15:56:01 2001 +0000
description:
Add a "name" argument to irq_establish and friends, in imitation of arm32.
diffstat:
sys/arch/arm26/arm26/irq.c | 9 ++++++---
sys/arch/arm26/include/irq.h | 5 +++--
sys/arch/arm26/iobus/ioc.c | 8 ++++----
sys/arch/arm26/ioc/arckbd.c | 19 +++++++++++++++----
sys/arch/arm26/podulebus/asc.c | 4 ++--
sys/arch/arm26/podulebus/if_ea.c | 6 +++---
sys/arch/arm26/podulebus/if_eh.c | 12 +++++++-----
sys/arch/arm26/podulebus/if_ei.c | 6 +++---
sys/arch/arm26/podulebus/podulebus.c | 11 ++++++-----
sys/arch/arm26/podulebus/podulebus.h | 4 ++--
sys/arch/arm26/vidc/arcvideo.c | 8 ++++----
11 files changed, 55 insertions(+), 37 deletions(-)
diffs (truncated from 346 to 300 lines):
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/arm26/irq.c
--- a/sys/arch/arm26/arm26/irq.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/arm26/irq.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: irq.c,v 1.7 2000/12/09 17:52:45 bjh21 Exp $ */
+/* $NetBSD: irq.c,v 1.8 2001/01/07 15:56:01 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@@ -33,7 +33,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: irq.c,v 1.7 2000/12/09 17:52:45 bjh21 Exp $");
+__RCSID("$NetBSD: irq.c,v 1.8 2001/01/07 15:56:01 bjh21 Exp $");
#include <sys/device.h>
#include <sys/kernel.h> /* for cold */
@@ -91,6 +91,7 @@
int irqnum;
int ipl;
int enabled;
+ char const *name;
};
volatile static int current_spl = IPL_HIGH;
@@ -179,7 +180,8 @@
}
struct irq_handler *
-irq_establish(int irqnum, int ipl, int (*func)(void *), void *arg)
+irq_establish(int irqnum, int ipl, int (*func)(void *), void *arg,
+ char const *name)
{
struct irq_handler *h, *new;
@@ -198,6 +200,7 @@
new->ipl = ipl;
new->func = func;
new->arg = arg;
+ new->name = name;
new->enabled = 1;
if (irq_list_head.lh_first == NULL ||
irq_list_head.lh_first->ipl <= ipl)
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/include/irq.h
--- a/sys/arch/arm26/include/irq.h Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/include/irq.h Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: irq.h,v 1.5 2001/01/07 13:38:42 bjh21 Exp $ */
+/* $NetBSD: irq.h,v 1.6 2001/01/07 15:56:02 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
* All rights reserved.
@@ -68,7 +68,8 @@
extern void irq_init(void);
/* irq_handler is declared in machdep.h */
/* splx, raisespl and lowerspl are declared in intr.h */
-extern struct irq_handler *irq_establish(int, int, int(*)(void *), void *);
+extern struct irq_handler *irq_establish(int, int, int(*)(void *), void *,
+ char const *);
extern char const *irq_string(struct irq_handler *);
extern void irq_enable(struct irq_handler *);
extern void irq_disable(struct irq_handler *);
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/iobus/ioc.c
--- a/sys/arch/arm26/iobus/ioc.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/iobus/ioc.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ioc.c,v 1.6 2001/01/07 15:36:34 bjh21 Exp $ */
+/* $NetBSD: ioc.c,v 1.7 2001/01/07 15:56:02 bjh21 Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 Ben Harris
@@ -33,7 +33,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: ioc.c,v 1.6 2001/01/07 15:36:34 bjh21 Exp $");
+__RCSID("$NetBSD: ioc.c,v 1.7 2001/01/07 15:56:02 bjh21 Exp $");
#include <sys/device.h>
#include <sys/kernel.h>
@@ -362,7 +362,7 @@
panic("ioc_initclocks: Impossible clock rate: %d Hz", hz);
ioc_counter_start(self, 0, t0_count);
sc->sc_clkirq = irq_establish(IOC_IRQ_TM0, IPL_CLOCK, ioc_irq_clock,
- NULL);
+ NULL, "hardclock");
if (bootverbose)
printf("%s: %d Hz clock interrupting at %s\n",
self->dv_xname, hz, irq_string(sc->sc_clkirq));
@@ -370,7 +370,7 @@
if (stathz) {
setstatclockrate(stathz);
sc->sc_sclkirq = irq_establish(IOC_IRQ_TM1, IPL_STATCLOCK,
- ioc_irq_statclock, NULL);
+ ioc_irq_statclock, NULL, "statclock");
if (bootverbose)
printf("%s: %d Hz statclock interrupting at %s\n",
self->dv_xname, stathz, irq_string(sc->sc_sclkirq));
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/ioc/arckbd.c
--- a/sys/arch/arm26/ioc/arckbd.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/ioc/arckbd.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arckbd.c,v 1.7 2001/01/07 15:36:35 bjh21 Exp $ */
+/* $NetBSD: arckbd.c,v 1.8 2001/01/07 15:56:02 bjh21 Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 Ben Harris
* All rights reserved.
@@ -43,11 +43,12 @@
#include <sys/param.h>
-__RCSID("$NetBSD: arckbd.c,v 1.7 2001/01/07 15:36:35 bjh21 Exp $");
+__RCSID("$NetBSD: arckbd.c,v 1.8 2001/01/07 15:56:02 bjh21 Exp $");
#include <sys/device.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
+#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/reboot.h> /* For bootverbose */
#include <sys/syslog.h>
@@ -199,15 +200,25 @@
bus_space_tag_t bst;
bus_space_handle_t bsh;
struct arckbd_attach_args aka;
+ size_t intnamelen;
+ char *rintname, *xintname;
bst = sc->sc_bst = ioc->ioc_fast_t;
bsh = sc->sc_bsh = ioc->ioc_fast_h;
- sc->sc_rirq = irq_establish(IOC_IRQ_SRX, IPL_TTY, arckbd_rint, self);
+ intnamelen = strlen(self->dv_xname) + 4 + 1;
+ rintname = malloc(intnamelen, M_DEVBUF, M_WAITOK);
+ snprintf(rintname, intnamelen, "%s(rx)", self->dv_xname);
+ sc->sc_rirq = irq_establish(IOC_IRQ_SRX, IPL_TTY, arckbd_rint, self,
+ rintname);
if (bootverbose)
printf("\n%s: interrupting at %s (rx)", self->dv_xname,
irq_string(sc->sc_rirq));
- sc->sc_xirq = irq_establish(IOC_IRQ_STX, IPL_TTY, arckbd_xint, self);
+
+ xintname = malloc(intnamelen, M_DEVBUF, M_WAITOK);
+ snprintf(xintname, intnamelen, "%s(tx)", self->dv_xname);
+ sc->sc_xirq = irq_establish(IOC_IRQ_STX, IPL_TTY, arckbd_xint, self,
+ xintname);
irq_disable(sc->sc_xirq);
if (bootverbose)
printf(" and %s (tx)", irq_string(sc->sc_xirq));
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/podulebus/asc.c
--- a/sys/arch/arm26/podulebus/asc.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/podulebus/asc.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: asc.c,v 1.1 2000/05/09 21:56:03 bjh21 Exp $ */
+/* $NetBSD: asc.c,v 1.2 2001/01/07 15:56:02 bjh21 Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
@@ -189,7 +189,7 @@
if (!asc_poll) {
sc->sc_ih =
podulebus_irq_establish(sc->sc_softc.sc_dev.dv_parent,
- pa->pa_slotnum, IPL_BIO, asc_intr, sc);
+ pa->pa_slotnum, IPL_BIO, asc_intr, sc, dp->dv_xname);
irq_enable(sc->sc_ih);
}
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/podulebus/if_ea.c
--- a/sys/arch/arm26/podulebus/if_ea.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/podulebus/if_ea.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ea.c,v 1.21 2000/10/14 23:41:05 bjh21 Exp $ */
+/* $NetBSD: if_ea.c,v 1.22 2001/01/07 15:56:02 bjh21 Exp $ */
/*
* Copyright (c) 2000 Ben Harris
@@ -38,7 +38,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: if_ea.c,v 1.21 2000/10/14 23:41:05 bjh21 Exp $");
+__RCSID("$NetBSD: if_ea.c,v 1.22 2001/01/07 15:56:02 bjh21 Exp $");
#include <sys/device.h>
#include <sys/socket.h>
@@ -148,7 +148,7 @@
/* Claim a podule interrupt */
sc->sc_ih = podulebus_irq_establish(sc->sc_8005.sc_dev.dv_parent,
- pa->pa_slotnum, IPL_NET, seeq8005intr, sc);
+ pa->pa_slotnum, IPL_NET, seeq8005intr, sc, self->dv_xname);
}
/* End of if_ea.c */
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/podulebus/if_eh.c
--- a/sys/arch/arm26/podulebus/if_eh.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/podulebus/if_eh.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eh.c,v 1.9 2000/12/22 22:21:37 bjh21 Exp $ */
+/* $NetBSD: if_eh.c,v 1.10 2001/01/07 15:56:02 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@@ -53,7 +53,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.9 2000/12/22 22:21:37 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.10 2001/01/07 15:56:02 bjh21 Exp $");
#include <sys/systm.h>
#include <sys/device.h>
@@ -315,7 +315,7 @@
dp8390_stop(dsc);
sc->sc_ih = podulebus_irq_establish(self->dv_parent, pa->pa_slotnum,
- IPL_NET, dp8390_intr, self);
+ IPL_NET, dp8390_intr, self, self->dv_xname);
if (bootverbose)
printf("%s: interrupting at %s\n",
self->dv_xname, irq_string(sc->sc_ih));
@@ -749,9 +749,11 @@
ctlt = sc->sc_ctlt;
ctlh = sc->sc_ctlh;
- /* Reset: Output 1 for 100us. */
+ /* Reset: Output 1 for a nominal 100us. */
+ /* XXX For some reason, a read is necessary between writes. */
+ bus_space_read_1(ctlt, ctlh, 0);
bus_space_write_1(ctlt, ctlh, 0, EH200_CTRL_MAU);
- DELAY(100);
+ DELAY(200000);
for (id = 0; id < 128; id++) {
/* Output 0 for 10us. */
/* XXX For some reason, a read is necessary between writes. */
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/podulebus/if_ei.c
--- a/sys/arch/arm26/podulebus/if_ei.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/podulebus/if_ei.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ei.c,v 1.3 2000/12/23 21:49:14 bjh21 Exp $ */
+/* $NetBSD: if_ei.c,v 1.4 2001/01/07 15:56:02 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@@ -38,7 +38,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: if_ei.c,v 1.3 2000/12/23 21:49:14 bjh21 Exp $");
+__RCSID("$NetBSD: if_ei.c,v 1.4 2001/01/07 15:56:02 bjh21 Exp $");
#include <sys/device.h>
#include <sys/malloc.h>
@@ -192,7 +192,7 @@
NULL, 0, 0);
sc->sc_ih = podulebus_irq_establish(self->dv_parent, pa->pa_slotnum,
- IPL_NET, i82586_intr, self);
+ IPL_NET, i82586_intr, self, self->dv_xname);
if (bootverbose)
printf("%s: interrupting at %s\n", self->dv_xname,
irq_string(sc->sc_ih));
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/podulebus/podulebus.c
--- a/sys/arch/arm26/podulebus/podulebus.c Sun Jan 07 15:36:34 2001 +0000
+++ b/sys/arch/arm26/podulebus/podulebus.c Sun Jan 07 15:56:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: podulebus.c,v 1.5 2000/12/20 10:57:38 bjh21 Exp $ */
+/* $NetBSD: podulebus.c,v 1.6 2001/01/07 15:56:03 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@@ -30,7 +30,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: podulebus.c,v 1.5 2000/12/20 10:57:38 bjh21 Exp $");
+__RCSID("$NetBSD: podulebus.c,v 1.6 2001/01/07 15:56:03 bjh21 Exp $");
#include <sys/device.h>
#include <sys/malloc.h>
@@ -336,13 +336,14 @@
struct irq_handler *
podulebus_irq_establish(struct device *self, int slot, int ipl,
- int (*func)(void *), void *arg)
+ int (*func)(void *), void *arg, char const *name)
{
/* XXX: support for checking IRQ bit on podule? */
#if NUNIXBP > 0
if (unixbp_cd.cd_ndevs > 0 && unixbp_cd.cd_devs[0] != NULL)
- return irq_establish(IRQ_UNIXBP_BASE + slot, ipl, func, arg);
+ return irq_establish(IRQ_UNIXBP_BASE + slot, ipl, func, arg,
+ name);
#endif
- return irq_establish(IRQ_PIRQ, ipl, func, arg);
+ return irq_establish(IRQ_PIRQ, ipl, func, arg, name);
}
diff -r d19055595c1a -r 5b844cf2679a sys/arch/arm26/podulebus/podulebus.h
Home |
Main Index |
Thread Index |
Old Index