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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Feb  4 11:18:17 2014 +0100

cobalt/posix/timer: do not force secondary mode on creation/deletion calls

Some use cases may expect the timer creation and deletion calls not to
require any mode change. Make the implementation callable from either
primary or secondary modes, and switch the syscall mode bits to "any".

---

 kernel/cobalt/posix/syscall.c |    4 ++--
 kernel/cobalt/posix/timer.c   |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index 37c8083..c70922a 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -136,8 +136,8 @@ static struct xnsyscall cobalt_syscalls[] = {
        SKINCALL_DEF(sc_cobalt_sigtimedwait, cobalt_sigtimedwait, primary),
        SKINCALL_DEF(sc_cobalt_sigpending, cobalt_sigpending, primary),
        SKINCALL_DEF(sc_cobalt_kill, cobalt_kill, conforming),
-       SKINCALL_DEF(sc_cobalt_timer_create, cobalt_timer_create, lostage),
-       SKINCALL_DEF(sc_cobalt_timer_delete, cobalt_timer_delete, lostage),
+       SKINCALL_DEF(sc_cobalt_timer_create, cobalt_timer_create, any),
+       SKINCALL_DEF(sc_cobalt_timer_delete, cobalt_timer_delete, any),
        SKINCALL_DEF(sc_cobalt_timer_settime, cobalt_timer_settime, primary),
        SKINCALL_DEF(sc_cobalt_timer_gettime, cobalt_timer_gettime, any),
        SKINCALL_DEF(sc_cobalt_timer_getoverrun, cobalt_timer_getoverrun, any),
diff --git a/kernel/cobalt/posix/timer.c b/kernel/cobalt/posix/timer.c
index f32deb8..d04ddac 100644
--- a/kernel/cobalt/posix/timer.c
+++ b/kernel/cobalt/posix/timer.c
@@ -183,7 +183,7 @@ static inline int timer_create(clockid_t clockid,
        if (cc == NULL)
                return -EPERM;
 
-       timer = kmalloc(sizeof(*timer), GFP_KERNEL);
+       timer = xnmalloc(sizeof(*timer));
        if (timer == NULL)
                return -ENOMEM;
        
@@ -242,7 +242,7 @@ fail:
 out:
        xnlock_put_irqrestore(&nklock, s);
 
-       kfree(timer);
+       xnfree(timer);
 
        return ret;
 }
@@ -296,7 +296,7 @@ timer_delete(timer_t timerid)
 
        timer_cleanup(cc, timer);
        xnlock_put_irqrestore(&nklock, s);
-       kfree(timer);
+       xnfree(timer);
 
        return ret;
 
@@ -682,7 +682,7 @@ void cobalt_timers_cleanup(struct cobalt_process *p)
                cobalt_call_extension(timer_cleanup, &timer->extref, ret);
                timer_cleanup(p, timer);
                xnlock_put_irqrestore(&nklock, s);
-               kfree(timer);
+               xnfree(timer);
 #if XENO_DEBUG(COBALT)
                printk(XENO_INFO "deleting Cobalt timer %u\n", id);
 #endif /* XENO_DEBUG(COBALT) */


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

Reply via email to