M. Koehrer wrote: > Hi all, > > I am just trying out the interrupt mechanism of Xenomai. > For that, I have create a kernel module that uses rt_intr_create (from the > native skin) to > create an IRQ handler. So far that looks fine. > However, I noticed, that I have to pass a non-NULL argument name to > rt_intr_create(). > Otherwise, cat /proc/xenomai/irq crashes with a kernel oops. > I think this is a bug as the API documentation allows the usage of a NULL > name in rt_intr_create. > Probably, the zero pointer will not be checked in the proc reading function. > I am using 2.6.19.1 on a Pentium 4 (UP) with Xenomai 2.3. > > I have enclosed a minimum kernel module that leads to a kernel oops to see > the effect. >
Untested, but this patch should fix the issue - also for RTDM drivers passing a NULL name to rtdm_irq_request (which was not forbidden so far too). Nevertheless, passing a name is recommended to ease the system diagnosis. Maybe the native doc should be changed in this regard too (I already did so for RTDM in 2.3 and trunk). Jan
Index: ChangeLog
===================================================================
--- ChangeLog (revision 2056)
+++ ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2007-01-10 Jan Kiszka <[EMAIL PROTECTED]>
+
+ * ksrc/nucleus/intr.c (xnintr_init): Always set xnintr::name to
+ non-NULL content.
+
2007-01-04 Philippe Gerum <[EMAIL PROTECTED]>
* include/nucleus/timebase.h (xntbase_convert): Add time base
Index: ksrc/nucleus/intr.c
===================================================================
--- ksrc/nucleus/intr.c (revision 2056)
+++ ksrc/nucleus/intr.c (working copy)
@@ -490,7 +490,7 @@ int xnintr_mount(void) { return 0; }
* therefore it must be allocated in permanent memory.
*
* @param name An ASCII string standing for the symbolic name of the
- * interrupt object.
+ * interrupt object or NULL ("<unknown>" will be applied then).
*
* @param irq The hardware interrupt channel associated with the
* interrupt object. This value is architecture-dependent. An
@@ -541,7 +541,7 @@ int xnintr_init(xnintr_t *intr,
intr->isr = isr;
intr->iack = iack;
intr->cookie = NULL;
- intr->name = name;
+ intr->name = name ? : "<unknown>";
intr->flags = flags;
intr->unhandled = 0;
memset(&intr->stat, 0, sizeof(intr->stat));
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
