summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2009-12-24 15:43:37 +0000
committermarius <marius@FreeBSD.org>2009-12-24 15:43:37 +0000
commit945a22734ad404f7d2ebceb8d592ae28d9ccf95a (patch)
tree9f7a468a5efbf21cc29d405a089717aa5b5c10bc /sys/sparc64
parentabc427b39dad4b81dbaf7260d7a22505332233fd (diff)
downloadFreeBSD-src-945a22734ad404f7d2ebceb8d592ae28d9ccf95a.zip
FreeBSD-src-945a22734ad404f7d2ebceb8d592ae28d9ccf95a.tar.gz
Merge from amd64/i386:
Implement support for interrupt descriptions.
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/include/intr_machdep.h1
-rw-r--r--sys/sparc64/pci/psycho.c14
-rw-r--r--sys/sparc64/pci/schizo.c14
-rw-r--r--sys/sparc64/sparc64/intr_machdep.c25
-rw-r--r--sys/sparc64/sparc64/nexus.c16
5 files changed, 67 insertions, 3 deletions
diff --git a/sys/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h
index ef24d18..46a6196 100644
--- a/sys/sparc64/include/intr_machdep.h
+++ b/sys/sparc64/include/intr_machdep.h
@@ -93,6 +93,7 @@ extern struct intr_vector intr_vectors[];
void intr_add_cpu(u_int cpu);
#endif
int intr_bind(int vec, u_char cpu);
+int intr_describe(int vec, void *ih, const char *descr);
void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
void *iva);
void intr_init1(void);
diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c
index 8034612..a6ac531 100644
--- a/sys/sparc64/pci/psycho.c
+++ b/sys/sparc64/pci/psycho.c
@@ -115,6 +115,7 @@ static bus_alloc_resource_t psycho_alloc_resource;
static bus_activate_resource_t psycho_activate_resource;
static bus_deactivate_resource_t psycho_deactivate_resource;
static bus_release_resource_t psycho_release_resource;
+static bus_describe_intr_t psycho_describe_intr;
static bus_get_dma_tag_t psycho_get_dma_tag;
static pcib_maxslots_t psycho_maxslots;
static pcib_read_config_t psycho_read_config;
@@ -139,6 +140,7 @@ static device_method_t psycho_methods[] = {
DEVMETHOD(bus_activate_resource, psycho_activate_resource),
DEVMETHOD(bus_deactivate_resource, psycho_deactivate_resource),
DEVMETHOD(bus_release_resource, psycho_release_resource),
+ DEVMETHOD(bus_describe_intr, psycho_describe_intr),
DEVMETHOD(bus_get_dma_tag, psycho_get_dma_tag),
/* pcib interface */
@@ -1246,6 +1248,18 @@ psycho_teardown_intr(device_t dev, device_t child, struct resource *vec,
return (bus_generic_teardown_intr(dev, child, vec, cookie));
}
+static int
+psycho_describe_intr(device_t dev, device_t child, struct resource *vec,
+ void *cookie, const char *descr)
+{
+ struct psycho_softc *sc;
+
+ sc = device_get_softc(dev);
+ if (sc->sc_mode == PSYCHO_MODE_SABRE)
+ cookie = ((struct psycho_dma_sync *)cookie)->pds_cookie;
+ return (bus_generic_describe_intr(dev, child, vec, cookie, descr));
+}
+
static struct resource *
psycho_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
diff --git a/sys/sparc64/pci/schizo.c b/sys/sparc64/pci/schizo.c
index 4685a61..49993d4 100644
--- a/sys/sparc64/pci/schizo.c
+++ b/sys/sparc64/pci/schizo.c
@@ -113,6 +113,7 @@ static bus_alloc_resource_t schizo_alloc_resource;
static bus_activate_resource_t schizo_activate_resource;
static bus_deactivate_resource_t schizo_deactivate_resource;
static bus_release_resource_t schizo_release_resource;
+static bus_describe_intr_t schizo_describe_intr;
static bus_get_dma_tag_t schizo_get_dma_tag;
static pcib_maxslots_t schizo_maxslots;
static pcib_read_config_t schizo_read_config;
@@ -137,6 +138,7 @@ static device_method_t schizo_methods[] = {
DEVMETHOD(bus_activate_resource, schizo_activate_resource),
DEVMETHOD(bus_deactivate_resource, schizo_deactivate_resource),
DEVMETHOD(bus_release_resource, schizo_release_resource),
+ DEVMETHOD(bus_describe_intr, schizo_describe_intr),
DEVMETHOD(bus_get_dma_tag, schizo_get_dma_tag),
/* pcib interface */
@@ -1257,6 +1259,18 @@ schizo_teardown_intr(device_t dev, device_t child, struct resource *vec,
return (bus_generic_teardown_intr(dev, child, vec, cookie));
}
+static int
+schizo_describe_intr(device_t dev, device_t child, struct resource *vec,
+ void *cookie, const char *descr)
+{
+ struct schizo_softc *sc;
+
+ sc = device_get_softc(dev);
+ if ((sc->sc_flags & SCHIZO_FLAGS_CDMA) != 0)
+ cookie = ((struct schizo_dma_sync *)cookie)->sds_cookie;
+ return (bus_generic_describe_intr(dev, child, vec, cookie, descr));
+}
+
static struct resource *
schizo_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c
index f47ad0e..7a73bbc 100644
--- a/sys/sparc64/sparc64/intr_machdep.c
+++ b/sys/sparc64/sparc64/intr_machdep.c
@@ -413,6 +413,31 @@ inthand_remove(int vec, void *cookie)
return (error);
}
+/* Add a description to an active interrupt handler. */
+int
+intr_describe(int vec, void *ih, const char *descr)
+{
+ struct intr_vector *iv;
+ int error;
+
+ if (vec < 0 || vec >= IV_MAX)
+ return (EINVAL);
+ sx_xlock(&intr_table_lock);
+ iv = &intr_vectors[vec];
+ if (iv == NULL) {
+ sx_xunlock(&intr_table_lock);
+ return (EINVAL);
+ }
+ error = intr_event_describe_handler(iv->iv_event, ih, descr);
+ if (error) {
+ sx_xunlock(&intr_table_lock);
+ return (error);
+ }
+ intrcnt_updatename(vec, iv->iv_event->ie_fullname, 0);
+ sx_xunlock(&intr_table_lock);
+ return (error);
+}
+
#ifdef SMP
/*
* Support for balancing interrupt sources across CPUs. For now we just
diff --git a/sys/sparc64/sparc64/nexus.c b/sys/sparc64/sparc64/nexus.c
index 04c2ddb..0f96a21 100644
--- a/sys/sparc64/sparc64/nexus.c
+++ b/sys/sparc64/sparc64/nexus.c
@@ -90,12 +90,13 @@ static bus_activate_resource_t nexus_activate_resource;
static bus_deactivate_resource_t nexus_deactivate_resource;
static bus_release_resource_t nexus_release_resource;
static bus_get_resource_list_t nexus_get_resource_list;
+#ifdef SMP
+static bus_bind_intr_t nexus_bind_intr;
+#endif
+static bus_describe_intr_t nexus_describe_intr;
static bus_get_dma_tag_t nexus_get_dma_tag;
static ofw_bus_get_devinfo_t nexus_get_devinfo;
-#ifdef SMP
-static int nexus_bind_intr(device_t, device_t, struct resource *, int);
-#endif
static int nexus_inlist(const char *, const char *const *);
static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t);
static void nexus_destroy_dinfo(struct nexus_devinfo *);
@@ -128,6 +129,7 @@ static device_method_t nexus_methods[] = {
#ifdef SMP
DEVMETHOD(bus_bind_intr, nexus_bind_intr),
#endif
+ DEVMETHOD(bus_describe_intr, nexus_describe_intr),
DEVMETHOD(bus_get_dma_tag, nexus_get_dma_tag),
/* ofw_bus interface */
@@ -329,6 +331,14 @@ nexus_bind_intr(device_t dev, device_t child, struct resource *r, int cpu)
}
#endif
+static int
+nexus_describe_intr(device_t dev, device_t child, struct resource *r,
+ void *cookie, const char *descr)
+{
+
+ return (intr_describe(rman_get_start(r), cookie, descr));
+}
+
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
OpenPOWER on IntegriCloud