From: Jan Kiszka <jan.kiszka@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: [Xenomai-core] Re: [PATCH] Shared interrupts (ready to merge)
Date: Thu, 16 Feb 2006 01:18:50 +0100 [thread overview]
Message-ID: <43F3C4EA.7050303@domain.hid> (raw)
In-Reply-To: <b647ffbd0602150939g59256b2bx@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 806 bytes --]
Dmitry Adamushko wrote:
> Hello everybody,
>
> being inspired by successful results of tests conducted recently by Jan &
> team,
> I'm presenting the final (yep, yet another final :) combo-patch.
>
> The shirq support now is optional, so that
>
> CONFIG_XENO_OPT_SHIRQ_LEVEL - enables shirq for level-triggered
> interrupts;
>
> CONFIG_XENO_OPT_SHIRQ_EDGE - -//- for edge-triggered ones.
>
> I addressed all the remarks and now, IMHO, it's (hopefully) ready for merge.
>
Hmm, I still find XN_ISR_NOINT in the patch. Shouldn't we solve this
before merging (i.e. make XN_ISR_HANDLED non-zero)?
Moreover, I attached an add-on patch to overcome the name buffer in
xnintr_t. Note that this patch is only compile-tested, I have no native
interrupt test-case at hand.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: shirq-name.patch --]
[-- Type: text/x-patch; name="shirq-name.patch", Size: 3041 bytes --]
diff -u include/nucleus/intr.h include/nucleus/intr.h
--- include/nucleus/intr.h (Arbeitskopie)
+++ include/nucleus/intr.h (Arbeitskopie)
@@ -54,7 +54,7 @@
xniack_t iack; /* !< Interrupt acknowledge routine. */
- char name[XNOBJECT_NAME_LEN]; /* !< Symbolic name. */
+ const char *name; /* !< Symbolic name. */
} xnintr_t;
diff -u ksrc/skins/native/syscall.c ksrc/skins/native/syscall.c
--- ksrc/skins/native/syscall.c (Arbeitskopie)
+++ ksrc/skins/native/syscall.c (Arbeitskopie)
@@ -2883,23 +2883,15 @@
char name[XNOBJECT_NAME_LEN];
RT_INTR_PLACEHOLDER ph;
int err, mode;
- RT_INTR *intr;
+ struct {
+ RT_INTR intr;
+ char name[XNOBJECT_NAME_LEN];
+ } *intr_buf;
unsigned irq;
if (!__xn_access_ok(curr,VERIFY_WRITE,__xn_reg_arg1(regs),sizeof(ph)))
return -EFAULT;
- if (__xn_reg_arg2(regs))
- {
- if (!__xn_access_ok(curr,VERIFY_READ,__xn_reg_arg2(regs),sizeof(name)))
- return -EFAULT;
-
- __xn_strncpy_from_user(curr,name,(const char __user *)__xn_reg_arg2(regs),sizeof(name) - 1);
- name[sizeof(name) - 1] = '\0';
- }
- else
- *name = '\0';
-
/* Interrupt line number. */
irq = (unsigned)__xn_reg_arg3(regs);
@@ -2909,23 +2901,41 @@
if (mode & ~(I_AUTOENA|I_PROPAGATE))
return -EINVAL;
- intr = (RT_INTR *)xnmalloc(sizeof(*intr));
+ intr_buf = (typeof(intr_buf))xnmalloc(sizeof(*intr_buf));
- if (!intr)
+ if (!intr_buf)
return -ENOMEM;
- err = rt_intr_create(intr,name,irq,&rt_intr_handler,NULL,0);
+ if (__xn_reg_arg2(regs))
+ {
+ if (!__xn_access_ok(curr,VERIFY_READ,__xn_reg_arg2(regs),sizeof(name)))
+ {
+ xnfree(intr_buf);
+ return -EFAULT;
+ }
+
+ __xn_strncpy_from_user(curr,
+ intr_buf->name,
+ (const char __user *)__xn_reg_arg2(regs),
+ sizeof(intr_buf->name) - 1);
+ intr_buf->name[sizeof(intr_buf->name) - 1] = '\0';
+ }
+ else
+ intr_buf->name[0] = '\0';
+
+
+ err = rt_intr_create(&intr_buf->intr,intr_buf->name,irq,&rt_intr_handler,NULL,0);
if (err == 0)
{
- intr->mode = mode;
- intr->cpid = curr->pid;
+ intr_buf->intr.mode = mode;
+ intr_buf->intr.cpid = curr->pid;
/* Copy back the registry handle to the ph struct. */
- ph.opaque = intr->handle;
+ ph.opaque = intr_buf->intr.handle;
__xn_copy_to_user(curr,(void __user *)__xn_reg_arg1(regs),&ph,sizeof(ph));
}
else
- xnfree(intr);
+ xnfree(intr_buf);
return err;
}
diff -u ksrc/nucleus/intr.c ksrc/nucleus/intr.c
--- ksrc/nucleus/intr.c (Arbeitskopie)
+++ ksrc/nucleus/intr.c (Arbeitskopie)
@@ -148,7 +148,7 @@
intr->cookie = NULL;
intr->hits = 0;
intr->flags = flags;
- xnobject_copy_name(intr->name,name);
+ intr->name = name;
#if defined(CONFIG_XENO_OPT_SHIRQ_LEVEL) || defined(CONFIG_XENO_OPT_SHIRQ_EDGE)
intr->next = NULL;
#endif /* CONFIG_XENO_OPT_SHIRQ_LEVEL || CONFIG_XENO_OPT_SHIRQ_EDGE */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2006-02-16 0:18 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-15 17:39 [Xenomai-core] [PATCH] Shared interrupts (ready to merge) Dmitry Adamushko
2006-02-16 0:18 ` Jan Kiszka [this message]
2006-02-16 10:20 ` [Xenomai-core] " Dmitry Adamushko
2006-02-16 12:58 ` Jan Kiszka
2006-02-16 13:58 ` Dmitry Adamushko
2006-02-16 14:12 ` Jan Kiszka
2006-02-16 19:28 ` Dmitry Adamushko
2006-02-16 20:38 ` Jan Kiszka
2006-02-18 20:04 ` Dmitry Adamushko
2006-02-18 21:37 ` Jan Kiszka
2006-02-20 13:53 ` Anders Blomdell
2006-02-20 16:40 ` Dmitry Adamushko
2006-02-21 8:42 ` Jan Kiszka
2006-02-21 10:45 ` Dmitry Adamushko
[not found] ` <43FAD322.4060001@domain.hid>
2006-02-21 10:54 ` Dmitry Adamushko
2006-02-21 11:28 ` Anders Blomdell
2006-02-21 11:49 ` Jan Kiszka
2006-02-21 16:48 ` Dmitry Adamushko
2006-02-21 17:04 ` Anders Blomdell
2006-02-21 17:49 ` Jan Kiszka
2006-02-21 18:50 ` Anders Blomdell
2006-02-22 12:45 ` Dmitry Adamushko
2006-02-22 13:15 ` Anders Blomdell
2006-02-22 21:59 ` Jan Kiszka
2006-02-23 12:21 ` Philippe Gerum
2006-02-25 20:14 ` Dmitry Adamushko
2006-02-26 18:51 ` Jan Kiszka
2006-02-26 19:15 ` Philippe Gerum
2006-02-26 19:21 ` Jan Kiszka
2006-02-26 20:37 ` Philippe Gerum
2006-02-27 8:14 ` Anders Blomdell
2006-02-27 8:23 ` Jan Kiszka
2006-02-27 9:20 ` Philippe Gerum
2006-02-21 11:39 ` Anders Blomdell
2006-02-21 8:39 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43F3C4EA.7050303@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=dmitry.adamushko@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.