Module: xenomai-forge
Branch: next
Commit: 18da10f9853a97eda9b7356caf159a5607ff8c76
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=18da10f9853a97eda9b7356caf159a5607ff8c76

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Feb 19 15:08:35 2014 +0100

cobalt/registry: introduce anonymous registration helper

---

 include/cobalt/kernel/registry.h |    6 ++++++
 kernel/cobalt/posix/cond.c       |    2 +-
 kernel/cobalt/posix/mutex.c      |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/cobalt/kernel/registry.h b/include/cobalt/kernel/registry.h
index 5bcac4a..a5e814e 100644
--- a/include/cobalt/kernel/registry.h
+++ b/include/cobalt/kernel/registry.h
@@ -168,6 +168,12 @@ int xnregistry_enter(const char *key,
                     xnhandle_t *phandle,
                     struct xnpnode *pnode);
 
+static inline int
+xnregistry_enter_anon(void *objaddr, xnhandle_t *phandle)
+{
+       return xnregistry_enter(NULL, objaddr, phandle, NULL);
+}
+
 int xnregistry_bind(const char *key,
                    xnticks_t timeout,
                    int timeout_mode,
diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c
index 87dd09d..957a3ae 100644
--- a/kernel/cobalt/posix/cond.c
+++ b/kernel/cobalt/posix/cond.c
@@ -159,7 +159,7 @@ pthread_cond_init(struct __shadow_cond *cnd, const 
pthread_condattr_t *attr)
        cond_destroy_internal(cnd->handle, cobalt_kqueues(1));
        xnlock_get_irqsave(&nklock, s);
 do_init:
-       err = xnregistry_enter("", cond, &cond->handle, NULL);
+       err = xnregistry_enter_anon(cond, &cond->handle);
        if (err < 0)
                goto err_free_pending_signals;
 
diff --git a/kernel/cobalt/posix/mutex.c b/kernel/cobalt/posix/mutex.c
index c94ed79..baab802 100644
--- a/kernel/cobalt/posix/mutex.c
+++ b/kernel/cobalt/posix/mutex.c
@@ -72,7 +72,7 @@ static int cobalt_mutex_init_inner(struct __shadow_mutex 
*shadow,
 
        kq = cobalt_kqueues(attr->pshared);
        sys_ppd = xnsys_ppd_get(attr->pshared);
-       err = xnregistry_enter("", mutex, &shadow->handle, NULL);
+       err = xnregistry_enter_anon(mutex, &shadow->handle);
        if (err < 0)
                return err;
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to