All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Adamushko <dmitry.adamushko@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai@xenomai.org
Subject: [Xenomai-core] Re: [PATCH] Shared interrupts (ready to merge)
Date: Thu, 16 Feb 2006 12:20:23 +0200	[thread overview]
Message-ID: <b647ffbd0602160220we254aacx@domain.hid> (raw)
In-Reply-To: <43F3C4EA.7050303@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2542 bytes --]

On 16/02/06, Jan Kiszka <jan.kiszka@domain.hid> wrote:

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)?


Ok, XN_ISR_NOINT is removed in favor of XN_ISR_HANDLED which is now
non-zero.
Actually, at first I wanted to make it just the other way about.


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.



Heh.. someone once suggested the -p key with "diff" to me? :o)

I bet your patch would even work but it's, well, slightly broken indeed ;-)

Look at the native/syscall.c : __rt_intr_delete() :

RT_INTR *intr = (RT_INTR *)rt_registry_fetch(ph.opaque);
...
xnfree(intr);

"intr" actually points to intr_buf->intr and it works as expected only
because "RT_INTR intr" is the first member of the struct, so that it's
address == the address of the whole object of this struct.

To do it properly you would need to make your "unnamed" struct visible
for both __rt_intr_create() and __rt_intr_delete(). Something like :

struct RT_INTR_ENV {

#define link2intr_env(laddr) \
((RT_INTR_ENV *)(((char* )laddr) - (int)(&((RT_INTR_ENV *)0)->intr)))

    RT_INTR intr;
    char name[XNOBJECT_NAME_LEN];
};

and then make use of link2intr_env() in __rt_intr_delet().


Ok, with you approach we would avoid allocating memory
for name[XNOBJECT_NAME_LEN] when an object is created in kernel-mode
and do it via RT_INTR_ENV only when it's created in user-mode.

We could even use that approach for all objects in native skin, but we can't
because of "anonymous" objects supported in kernel-mode too and, well, I
personally would not like those RT_OBJECT_ENV structures all over the map in
syscall.c :)

So I don't want to break the whole picture only for the RT_INTR object (it
doesn't support "anonymous" objects now).

Nevertheless, if you still want to save a hundred bytes of data or so (how
many interrupt objects would a normal system have? and I guess the lenght of
name is about 10 symbols on average :)

for the users that don't use native skin, then I would suggest the following
way :

xnintr_t contains just the link "char *name" as you suggested but RT_INTR
contains the name[XNOBJECT_NAME_LEN] member (as it was before actually).

If it's ok,  then I'll send um... yet another final patch that addresses
both issues :)


Jan
>
>
>

--
Best regards,
Dmitry Adamushko

[-- Attachment #2: Type: text/html, Size: 3540 bytes --]

  reply	other threads:[~2006-02-16 10:20 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 ` [Xenomai-core] " Jan Kiszka
2006-02-16 10:20   ` Dmitry Adamushko [this message]
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=b647ffbd0602160220we254aacx@domain.hid \
    --to=dmitry.adamushko@domain.hid \
    --cc=jan.kiszka@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.