All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: rpm@xenomai.org
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] [Patch 7/7] Re-implementation of mutexes, user-space support.
Date: Tue, 20 May 2008 00:49:21 +0200	[thread overview]
Message-ID: <18482.1009.89042.272689@domain.hid> (raw)
In-Reply-To: <48307BDF.1010906@domain.hid>

Philippe Gerum wrote:
 > Gilles Chanteperdrix wrote:
 > > Jan Kiszka wrote:
 > >  > Gilles Chanteperdrix wrote:
 > >  > > Jan Kiszka wrote:
 > >  > >  > Gilles Chanteperdrix wrote:
 > >  > >  > > Philippe Gerum wrote:
 > >  > >  > >  > Gilles Chanteperdrix wrote:
 > >  > >  > >  > > Since binding of the semaphore heaps is now made by xeno_skin_bind, there is
 > >  > >  > >  > > much less modifications in src/skins/posix/init.c. However, I had to do
 > >  > >  > >  > > something really ugly: since binding the semaphore heaps by xeno_skin_bind
 > >  > >  > >  > > requires calls to open, ioctl, mmap, close and munmap, I redefined these symbols
 > >  > >  > >  > > to be the __real_ variants before including bind.h.
 > >  > >  > >  > 
 > >  > >  > >  > Is there any upside to do this instead of simply calling the __real_*
 > >  > >  > >  > placeholders, since we do already provide weak wrappers for those when the
 > >  > >  > >  > linker's wrapping magic is not invoked?
 > >  > >  > > 
 > >  > >  > > The point is that the wrappers and linker magic only take place for
 > >  > >  > > POSIX skins. Other skins have to call the genuine open, ioctl, mmap,
 > >  > >  > > close and munmap services.
 > >  > >  > 
 > >  > >  > What about controlling the desired prefix for generic functions in
 > >  > >  > bind.h via some #define that the caller has to/can set before including
 > >  > >  > the header:
 > >  > >  > 
 > >  > >  > #define POSIX_PREFIX	__real_
 > >  > >  > #include <asm-generic/bits/bind.h>
 > >  > >  > 
 > >  > >  > and there we would have:
 > >  > >  > 
 > >  > >  > POSIX_PREFIX##open(...);
 > >  > >  > 
 > >  > >  > Looks a bit cleaner to me.
 > >  > > 
 > >  > > Well, in this case we end up cluttering the code with the POSIX_PREFIX
 > >  > > macro, even in the non posix case where no prefix is needed.
 > >  > 
 > >  > Yes, but there are only few spots. The advantage of this strategy is
 > >  > that it is explicit in-place (ie. inside bind.h). That avoids potential
 > >  > collateral damage in the future when other services are added to that
 > >  > helper which shall not be wrapped.
 > > 
 > > Actually, the only important call is open. Since once the file
 > > descriptor has been created with __real_open, all syscall wrappers will
 > > automatically fall back to the __real syscall variants.
 > > 
 > 
 > Then let's just provide __real_open() as a weak symbol in all libs; that's less
 > error-prone that fiddling with the preprocessor.

For now, I kept a solution based on the preprocessor. If I remember
correctly, the __real stuff needs to be in a separate object, this
means that we cannot put __real_open definition in bind.h, we have to
generate an open_wrapper.lo object and link every library with this
object. Is this really what we want ?

-- 


					    Gilles.


  reply	other threads:[~2008-05-19 22:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02 22:27 [Xenomai-core] [Patch 0/7] Posix skin user-space mutexes, second take Gilles Chanteperdrix
2008-05-02 22:30 ` [Xenomai-core] [Patch 1/7] Support for non cached memory mappings Gilles Chanteperdrix
2008-05-02 22:32   ` [Xenomai-core] [Patch 2/7] Define XNARCH_SHARED_HEAP_FLAGS Gilles Chanteperdrix
2008-05-02 22:33     ` [Xenomai-core] [Patch 3/7] Define more atomic operations in user-space Gilles Chanteperdrix
2008-05-02 22:34       ` [Xenomai-core] [Patch 4/7] Define ARM " Gilles Chanteperdrix
2008-05-02 22:35         ` [Xenomai-core] [Patch 5/7] Define new syscalls for the system skin Gilles Chanteperdrix
2008-05-02 22:36           ` [Xenomai-core] [Patch 6/7] Re-implementation of mutexes, kernel-space support Gilles Chanteperdrix
2008-05-02 22:38             ` [Xenomai-core] [Patch 7/7] Re-implementation of mutexes, user-space support Gilles Chanteperdrix
2008-05-18 16:42               ` Philippe Gerum
2008-05-18 17:05                 ` Gilles Chanteperdrix
2008-05-18 17:29                   ` Jan Kiszka
2008-05-18 17:41                     ` Gilles Chanteperdrix
2008-05-18 17:52                       ` Jan Kiszka
2008-05-18 18:09                         ` Gilles Chanteperdrix
2008-05-18 18:56                           ` Philippe Gerum
2008-05-19 22:49                             ` Gilles Chanteperdrix [this message]
2008-05-20  6:53                               ` Philippe Gerum
2008-05-20  7:07                                 ` Jan Kiszka
2008-05-20  7:23                                   ` Gilles Chanteperdrix
2008-05-18 16:40           ` [Xenomai-core] [Patch 5/7] Define new syscalls for the system skin Philippe Gerum
2008-05-18 17:21             ` Gilles Chanteperdrix
2008-05-18 18:37             ` Gilles Chanteperdrix
2008-05-18 19:10               ` Philippe Gerum
2008-05-18 19:38                 ` Gilles Chanteperdrix
2008-05-18 21:52                   ` Philippe Gerum
2008-05-18 22:52                     ` Gilles Chanteperdrix
2008-05-19 12:56                       ` Philippe Gerum
2008-05-19 13:16                         ` Gilles Chanteperdrix
2008-05-19 22:44                           ` Gilles Chanteperdrix
2008-05-05 16:33         ` [Xenomai-core] [Patch 4/7] Define ARM atomic operations in user-space Gilles Chanteperdrix
2008-05-05 16:39           ` Philippe Gerum
2008-05-05 16:44             ` Gilles Chanteperdrix
2008-05-18 16:30   ` [Xenomai-core] [Patch 1/7] Support for non cached memory mappings Philippe Gerum
2008-05-03 19:18 ` [Xenomai-core] [Patch 0/7] Posix skin user-space mutexes, second take Gilles Chanteperdrix

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=18482.1009.89042.272689@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --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.