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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep 10 11:41:26 2014 +0200

cobalt/syscall: fix in/out value types

---

 kernel/cobalt/posix/syscall.c      |    8 +++++---
 kernel/cobalt/trace/cobalt-posix.h |   20 ++++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index 7e8db89..384c13a 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -107,10 +107,11 @@ static void prepare_for_signal(struct task_struct *p,
 static int handle_head_syscall(struct ipipe_domain *ipd, struct pt_regs *regs)
 {
        struct cobalt_process *process;
-       int nr, switched, ret, sigs;
+       int switched, ret, sigs;
        struct xnthread *thread;
        cobalt_syshand handler;
        struct task_struct *p;
+       unsigned int nr;
        int sysflags;
 
        if (!__xn_syscall_p(regs))
@@ -121,7 +122,7 @@ static int handle_head_syscall(struct ipipe_domain *ipd, 
struct pt_regs *regs)
 
        trace_cobalt_head_sysentry(thread, nr);
 
-       if (nr < 0 || nr >= __NR_COBALT_SYSCALLS)
+       if (nr >= __NR_COBALT_SYSCALLS)
                goto bad_syscall;
 
        process = cobalt_current_process();
@@ -285,10 +286,11 @@ bad_syscall:
 
 static int handle_root_syscall(struct ipipe_domain *ipd, struct pt_regs *regs)
 {
-       int nr, sysflags, switched, ret, sigs;
+       int sysflags, switched, ret, sigs;
        struct xnthread *thread;
        cobalt_syshand handler;
        struct task_struct *p;
+       unsigned int nr;
 
        /*
         * Catch cancellation requests pending for user shadows
diff --git a/kernel/cobalt/trace/cobalt-posix.h 
b/kernel/cobalt/trace/cobalt-posix.h
index f0d4e3e..a143e97 100644
--- a/kernel/cobalt/trace/cobalt-posix.h
+++ b/kernel/cobalt/trace/cobalt-posix.h
@@ -23,13 +23,13 @@
        __entry->tv_sec_##__name, __entry->tv_nsec_##__name
 
 DECLARE_EVENT_CLASS(syscall_entry,
-       TP_PROTO(struct xnthread *thread, int nr),
+       TP_PROTO(struct xnthread *thread, unsigned int nr),
        TP_ARGS(thread, nr),
 
        TP_STRUCT__entry(
                __field(struct xnthread *, thread)
                __string(name, thread ? thread->name : "(anon)")
-               __field(int, nr)
+               __field(unsigned int, nr)
        ),
 
        TP_fast_assign(
@@ -38,17 +38,17 @@ DECLARE_EVENT_CLASS(syscall_entry,
                __entry->nr = nr;
        ),
 
-       TP_printk("thread=%p(%s) syscall=%d",
+       TP_printk("thread=%p(%s) syscall=%u",
                  __entry->thread, __get_str(name), __entry->nr)
 );
 
 DECLARE_EVENT_CLASS(syscall_exit,
-       TP_PROTO(struct xnthread *thread, int result),
+       TP_PROTO(struct xnthread *thread, long result),
        TP_ARGS(thread, result),
 
        TP_STRUCT__entry(
                __field(struct xnthread *, thread)
-               __field(int, result)
+               __field(long, result)
        ),
 
        TP_fast_assign(
@@ -56,7 +56,7 @@ DECLARE_EVENT_CLASS(syscall_exit,
                __entry->result = result;
        ),
 
-       TP_printk("thread=%p result=%d",
+       TP_printk("thread=%p result=%ld",
                  __entry->thread, __entry->result)
 );
 
@@ -150,22 +150,22 @@ DECLARE_EVENT_CLASS(cobalt_void,
 );
 
 DEFINE_EVENT(syscall_entry, cobalt_head_sysentry,
-       TP_PROTO(struct xnthread *thread, int nr),
+       TP_PROTO(struct xnthread *thread, unsigned int nr),
        TP_ARGS(thread, nr)
 );
 
 DEFINE_EVENT(syscall_exit, cobalt_head_sysexit,
-       TP_PROTO(struct xnthread *thread, int result),
+       TP_PROTO(struct xnthread *thread, long result),
        TP_ARGS(thread, result)
 );
 
 DEFINE_EVENT(syscall_entry, cobalt_root_sysentry,
-       TP_PROTO(struct xnthread *thread, int nr),
+       TP_PROTO(struct xnthread *thread, unsigned int nr),
        TP_ARGS(thread, nr)
 );
 
 DEFINE_EVENT(syscall_exit, cobalt_root_sysexit,
-       TP_PROTO(struct xnthread *thread, int result),
+       TP_PROTO(struct xnthread *thread, long result),
        TP_ARGS(thread, result)
 );
 


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

Reply via email to