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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri May 16 14:37:19 2014 +0200

cobalt/posix: guard for unimplemented syscalls in table

---

 include/cobalt/uapi/syscall.h                       |    2 ++
 kernel/cobalt/include/asm-generic/xenomai/syscall.h |    3 +++
 kernel/cobalt/posix/syscall.c                       |    6 ++++++
 3 files changed, 11 insertions(+)

diff --git a/include/cobalt/uapi/syscall.h b/include/cobalt/uapi/syscall.h
index 57a6b65..a47d520 100644
--- a/include/cobalt/uapi/syscall.h
+++ b/include/cobalt/uapi/syscall.h
@@ -119,4 +119,6 @@
 #define sc_cobalt_timerfd_settime      96
 #define sc_cobalt_timerfd_gettime      97
 
+#define __NR_COBALT_SYSCALLS           98
+
 #endif /* !_COBALT_UAPI_SYSCALL_H */
diff --git a/kernel/cobalt/include/asm-generic/xenomai/syscall.h 
b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
index eac54fc..dcf6df7 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/syscall.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
@@ -80,6 +80,9 @@ struct xnsyscall {
 #define SKINCALL_DEF(nr, fn, fl)       \
        [nr] = { .svc = __syscast__(fn), .flags = __xn_exec_##fl }
 
+#define SKINCALL_NI    \
+       { .svc = __syscast__(cobalt_syscall_ni), .flags = 0 }
+
 #define access_rok(addr, size) access_ok(VERIFY_READ, (addr), (size))
 #define access_wok(addr, size) access_ok(VERIFY_WRITE, (addr), (size))
 
diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index e41d3dc..7e9b93a 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -80,7 +80,13 @@ static void cobalt_process_detach(void *arg)
        kfree(cc);
 }
 
+static int cobalt_syscall_ni(void)
+{
+       return -ENOSYS;
+}
+
 static struct xnsyscall cobalt_syscalls[] = {
+       [0 ... __NR_COBALT_SYSCALLS-1] = SKINCALL_NI,
        SKINCALL_DEF(sc_cobalt_thread_create, cobalt_thread_create, init),
        SKINCALL_DEF(sc_cobalt_thread_setschedparam_ex, 
cobalt_thread_setschedparam_ex, conforming),
        SKINCALL_DEF(sc_cobalt_thread_getschedparam_ex, 
cobalt_thread_getschedparam_ex, any),


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

Reply via email to