[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint

2009-12-05 Thread GIT version control
Module: xenomai-head
Branch: master
Commit: 264b76b939fb2625b091a18133871e874479f97c
URL:
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=264b76b939fb2625b091a18133871e874479f97c

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Fri Dec  4 23:27:17 2009 +0100

signals: reduce signals handling memory footprint

---

 include/asm-arm/syscall.h  |9 +---
 include/asm-blackfin/syscall.h |8 +---
 include/asm-generic/syscall.h  |   18 
 include/asm-nios2/syscall.h|8 +---
 include/asm-powerpc/syscall.h  |9 +---
 include/asm-x86/syscall.h  |   93 ++-
 src/skins/common/bind.c|   38 
 7 files changed, 98 insertions(+), 85 deletions(-)

diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
index be16e9c..0b51492 100644
--- a/include/asm-arm/syscall.h
+++ b/include/asm-arm/syscall.h
@@ -201,13 +201,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
err = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id,  \
   op, sigs, args); \
res = xnsig_dispatch(sigs, res, err);  \
-   \
-   while (sigs.nsigs  sigs.remaining) {  \
-   sigs.nsigs = 0; \
-   err = XENOMAI_DO_SYSCALL_INNER  \
-   (0, 0, __xn_sys_get_next_sigs, sigs); \
-   res = xnsig_dispatch_next(sigs, res, err); \
-   }   \
} while (res == -ERESTART); \
res;\
})
@@ -226,6 +219,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)   \
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
+#define XENOMAI_SYSSIGS(sigs)  \
+   XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)   \
XENOMAI_DO_SYSCALL(0,id,op)
diff --git a/include/asm-blackfin/syscall.h b/include/asm-blackfin/syscall.h
index 02cc143..9f90611 100644
--- a/include/asm-blackfin/syscall.h
+++ b/include/asm-blackfin/syscall.h
@@ -221,12 +221,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
__err__ = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, \
   op, __sigs__, 
##args); \
__res__ = xnsig_dispatch(__sigs__, __res__, __err__); \
-   while (__sigs__.nsigs  __sigs__.remaining) {  \
-   __sigs__.nsigs = 0; \
-   __err__ = XENOMAI_DO_SYSCALL_INNER  \
-   (0, 0, __xn_sys_get_next_sigs, 
__sigs__); \
-   __res__ = xnsig_dispatch_next(__sigs__, 
__res__, __err__); \
-   }   \
} while (__res__ == -ERESTART); \
__res__;\
})
@@ -238,6 +232,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #define XENOMAI_SYSCALL4(op,a1,a2,a3,a4)
XENOMAI_DO_SYSCALL(4,0,op,a1,a2,a3,a4)
 #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
+#define XENOMAI_SYSSIGS(sigs)  \
+   XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)XENOMAI_DO_SYSCALL(0,id,op)
 #define XENOMAI_SKINCALL1(id,op,a1) XENOMAI_DO_SYSCALL(1,id,op,a1)
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 926498b..483b99f 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -158,10 +158,15 @@ static inline int __xn_safe_strncpy_from_user(char *dst,
 #else /* !__KERNEL__ */
 
 #ifdef __cplusplus
-extern C
+extern C {
 #endif /* __cplusplus */
 int __xnsig_dispatch(struct xnsig *sigs, int cumulated_error, int last_error);
 
+int __xnsig_dispatch_safe(struct xnsig *sigs, int cumulated_error, int 
last_error);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 /* Called to dispatch signals which interrupted a system call. */
 static inline int xnsig_dispatch(struct xnsig *sigs, int cumul, int last)
 {
@@ -170,16 +175,11 @@ static inline int xnsig_dispatch(struct xnsig *sigs, int 
cumul, int last)

[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint

2009-12-04 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: e7e1d7638ee8d3de1099c68311766bfd4e534f31
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=e7e1d7638ee8d3de1099c68311766bfd4e534f31

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Dec  2 17:12:21 2009 +0100

signals: reduce signals handling memory footprint

---

 Makefile.in|  193 +-
 aclocal.m4 |  323 +-
 config/Makefile.in |   43 +-
 configure  | 5860 
 doc/Makefile.in|  131 +-
 doc/docbook/Makefile.in|  131 +-
 doc/docbook/custom-stylesheets/Makefile.in |  131 +-
 doc/docbook/custom-stylesheets/xsl/Makefile.in |  131 +-
 .../custom-stylesheets/xsl/common/Makefile.in  |   43 +-
 doc/docbook/custom-stylesheets/xsl/fo/Makefile.in  |   43 +-
 .../custom-stylesheets/xsl/html/Makefile.in|   43 +-
 doc/docbook/xenomai/Makefile.in|   43 +-
 doc/doxygen/Makefile.in|   43 +-
 doc/man/Makefile.in|  215 +-
 doc/txt/Makefile.in|   82 +-
 include/Makefile.in|  192 +-
 include/analogy/Makefile.in|  105 +-
 include/asm-arm/Makefile.in|  170 +-
 include/asm-arm/bits/Makefile.in   |  105 +-
 include/asm-arm/syscall.h  |9 +-
 include/asm-blackfin/Makefile.in   |  170 +-
 include/asm-blackfin/bits/Makefile.in  |  105 +-
 include/asm-blackfin/syscall.h |8 +-
 include/asm-generic/Makefile.in|  170 +-
 include/asm-generic/bits/Makefile.in   |  105 +-
 include/asm-generic/syscall.h  |   18 +-
 include/asm-nios2/Makefile.in  |  170 +-
 include/asm-nios2/bits/Makefile.in |  105 +-
 include/asm-nios2/syscall.h|8 +-
 include/asm-powerpc/Makefile.in|  170 +-
 include/asm-powerpc/bits/Makefile.in   |  105 +-
 include/asm-powerpc/syscall.h  |9 +-
 include/asm-sim/Makefile.in|  170 +-
 include/asm-sim/bits/Makefile.in   |  105 +-
 include/asm-x86/Makefile.in|  170 +-
 include/asm-x86/bits/Makefile.in   |  105 +-
 include/asm-x86/syscall.h  |   93 +-
 include/native/Makefile.in |  105 +-
 include/nucleus/Makefile.in|  105 +-
 include/posix/Makefile.in  |  170 +-
 include/posix/sys/Makefile.in  |  105 +-
 include/psos+/Makefile.in  |  105 +-
 include/rtai/Makefile.in   |  105 +-
 include/rtdm/Makefile.in   |  105 +-
 include/uitron/Makefile.in |  105 +-
 include/vrtx/Makefile.in   |  105 +-
 include/vxworks/Makefile.in|  105 +-
 scripts/Makefile.in|  104 +-
 src/Makefile.in|  131 +-
 src/drvlib/Makefile.in |  131 +-
 src/drvlib/analogy/Makefile.in |  149 +-
 src/include/Makefile.in|   47 +-
 src/include/xeno_config.h.in   |3 -
 src/rtdk/Makefile.in   |  137 +-
 src/skins/Makefile.in  |  131 +-
 src/skins/common/Makefile.in   |   97 +-
 src/skins/common/bind.c|   38 +
 src/skins/native/Makefile.in   |  203 +-
 src/skins/posix/Makefile.in|  191 +-
 src/skins/psos+/Makefile.in|  155 +-
 src/skins/rtai/Makefile.in |  125 +-
 src/skins/rtdm/Makefile.in |  125 +-
 src/skins/uitron/Makefile.in   |  143 +-
 src/skins/vrtx/Makefile.in |  179 +-
 src/skins/vxworks/Makefile.in  |  185 +-
 src/testsuite/Makefile.in  |  131 +-
 src/testsuite/clocktest/Makefile.in|  133 +-
 src/testsuite/cyclic/Makefile.in   |  133 +-
 src/testsuite/irqbench/Makefile.in |  137 +-
 src/testsuite/klatency/Makefile.in |  133 +-
 src/testsuite/latency/Makefile.in  |  133 +-
 src/testsuite/sigtest/Makefile.in  |  133 +-
 src/testsuite/switchtest/Makefile.in   |  133 +-
 src/testsuite/unit/Makefile.in |  149 +-
 src/utils/Makefile.in 

[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint

2009-12-04 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 264b76b939fb2625b091a18133871e874479f97c
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=264b76b939fb2625b091a18133871e874479f97c

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Fri Dec  4 23:27:17 2009 +0100

signals: reduce signals handling memory footprint

---

 include/asm-arm/syscall.h  |9 +---
 include/asm-blackfin/syscall.h |8 +---
 include/asm-generic/syscall.h  |   18 
 include/asm-nios2/syscall.h|8 +---
 include/asm-powerpc/syscall.h  |9 +---
 include/asm-x86/syscall.h  |   93 ++-
 src/skins/common/bind.c|   38 
 7 files changed, 98 insertions(+), 85 deletions(-)

diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
index be16e9c..0b51492 100644
--- a/include/asm-arm/syscall.h
+++ b/include/asm-arm/syscall.h
@@ -201,13 +201,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
err = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id,  \
   op, sigs, args); \
res = xnsig_dispatch(sigs, res, err);  \
-   \
-   while (sigs.nsigs  sigs.remaining) {  \
-   sigs.nsigs = 0; \
-   err = XENOMAI_DO_SYSCALL_INNER  \
-   (0, 0, __xn_sys_get_next_sigs, sigs); \
-   res = xnsig_dispatch_next(sigs, res, err); \
-   }   \
} while (res == -ERESTART); \
res;\
})
@@ -226,6 +219,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)   \
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
+#define XENOMAI_SYSSIGS(sigs)  \
+   XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)   \
XENOMAI_DO_SYSCALL(0,id,op)
diff --git a/include/asm-blackfin/syscall.h b/include/asm-blackfin/syscall.h
index 02cc143..9f90611 100644
--- a/include/asm-blackfin/syscall.h
+++ b/include/asm-blackfin/syscall.h
@@ -221,12 +221,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
__err__ = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, \
   op, __sigs__, 
##args); \
__res__ = xnsig_dispatch(__sigs__, __res__, __err__); \
-   while (__sigs__.nsigs  __sigs__.remaining) {  \
-   __sigs__.nsigs = 0; \
-   __err__ = XENOMAI_DO_SYSCALL_INNER  \
-   (0, 0, __xn_sys_get_next_sigs, 
__sigs__); \
-   __res__ = xnsig_dispatch_next(__sigs__, 
__res__, __err__); \
-   }   \
} while (__res__ == -ERESTART); \
__res__;\
})
@@ -238,6 +232,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #define XENOMAI_SYSCALL4(op,a1,a2,a3,a4)
XENOMAI_DO_SYSCALL(4,0,op,a1,a2,a3,a4)
 #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
+#define XENOMAI_SYSSIGS(sigs)  \
+   XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)XENOMAI_DO_SYSCALL(0,id,op)
 #define XENOMAI_SKINCALL1(id,op,a1) XENOMAI_DO_SYSCALL(1,id,op,a1)
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 926498b..483b99f 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -158,10 +158,15 @@ static inline int __xn_safe_strncpy_from_user(char *dst,
 #else /* !__KERNEL__ */
 
 #ifdef __cplusplus
-extern C
+extern C {
 #endif /* __cplusplus */
 int __xnsig_dispatch(struct xnsig *sigs, int cumulated_error, int last_error);
 
+int __xnsig_dispatch_safe(struct xnsig *sigs, int cumulated_error, int 
last_error);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 /* Called to dispatch signals which interrupted a system call. */
 static inline int xnsig_dispatch(struct xnsig *sigs, int cumul, int last)
 {
@@ -170,16 +175,11 @@ static inline int xnsig_dispatch(struct xnsig *sigs, int 
cumul, int last)

[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint

2009-12-02 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: dd97d5ef89be95bb26fa86ad19b014eff3444fc1
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=dd97d5ef89be95bb26fa86ad19b014eff3444fc1

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Dec  2 17:12:21 2009 +0100

signals: reduce signals handling memory footprint

---

 include/asm-generic/syscall.h |   18 +-
 include/asm-x86/syscall.h |   35 ++-
 src/skins/common/bind.c   |   40 
 3 files changed, 59 insertions(+), 34 deletions(-)

diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 926498b..483b99f 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -158,10 +158,15 @@ static inline int __xn_safe_strncpy_from_user(char *dst,
 #else /* !__KERNEL__ */
 
 #ifdef __cplusplus
-extern C
+extern C {
 #endif /* __cplusplus */
 int __xnsig_dispatch(struct xnsig *sigs, int cumulated_error, int last_error);
 
+int __xnsig_dispatch_safe(struct xnsig *sigs, int cumulated_error, int 
last_error);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 /* Called to dispatch signals which interrupted a system call. */
 static inline int xnsig_dispatch(struct xnsig *sigs, int cumul, int last)
 {
@@ -170,16 +175,11 @@ static inline int xnsig_dispatch(struct xnsig *sigs, int 
cumul, int last)
return last;
 }
 
-/* Called to dispatch additional signals (received with the special
-   system call __xn_sys_get_next_sigs), it may happen that this
-   syscall was in fact called whereas no additional signal was
-   pending, in this case, ignore the syscall return value (last) and
-   preserve the cumulated error. */
-static inline int xnsig_dispatch_next(struct xnsig *sigs, int cumul, int last)
+static inline int xnsig_dispatch_safe(struct xnsig *sigs, int cumul, int last)
 {
if (sigs-nsigs)
-   return __xnsig_dispatch(sigs, cumul, last);
-   return cumul;
+   return __xnsig_dispatch_safe(sigs, cumul, last);
+   return last;
 }
 
 #endif /* !__KERNEL__ */
diff --git a/include/asm-x86/syscall.h b/include/asm-x86/syscall.h
index 7b6aa20..26ea33f 100644
--- a/include/asm-x86/syscall.h
+++ b/include/asm-x86/syscall.h
@@ -166,15 +166,19 @@ static inline void __xn_get_ebp(void **dest)
 asm volatile(movl %%ebp, %0: =m(*dest));
 }
 
+#define XENOMAI_SIGS_TO_SYSARG(sigs) \
+   (((struct frame *)sigs)-last_fp)
+
 #define XENOMAI_SYS_MUX_INNER(nr, op, args...) \
 ({ \
unsigned __resultvar;   \
asm volatile (  \
LOADARGS_##nr   \
movl %1, %%eax\n\t\
+   pushl %%ebp\n\t   \
movl %2, %%ebp\n\t\
DOSYSCALL   \
-   movl (%%ebp), %%ebp\n\t   \
+   popl %%ebp\n\t\
RESTOREARGS_##nr\
: =a (__resultvar)\
: i (__xn_mux_code(0, op)) ASMFMT_##nr(args)  \
@@ -195,13 +199,6 @@ static inline void __xn_get_ebp(void **dest)
f.sigs.nsigs = 0;   \
err = XENOMAI_SYS_MUX_INNER(nr, op, fp, args);  \
res = xnsig_dispatch(f.sigs, res, err);\
-   \
-   while (f.sigs.nsigs  f.sigs.remaining) {  \
-   f.sigs.nsigs = 0;   \
-   err = XENOMAI_SYS_MUX_INNER \
-   (0, __xn_sys_get_next_sigs, fp);\
-   res = xnsig_dispatch_next(f.sigs, res, err);   \
-   }   \
} while (res == -ERESTART); \
res;\
 })
@@ -212,9 +209,10 @@ static inline void __xn_get_ebp(void **dest)
asm volatile (  \
LOADARGS_##nr   \
movl %1, %%eax\n\t\
+   pushl %%ebp\n\t   \
movl %2, %%ebp\n\t\
DOSYSCALLSAFE   \
-   movl (%%ebp), %%ebp\n\t   \
+   popl %%ebp\n\t\
RESTOREARGS_##nr 

[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint

2009-12-02 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 578708c5ccc5fe19ca8f5c8b0fed92f9125c1487
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=578708c5ccc5fe19ca8f5c8b0fed92f9125c1487

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Dec  2 17:12:21 2009 +0100

signals: reduce signals handling memory footprint

---

 include/asm-arm/syscall.h  |9 +---
 include/asm-blackfin/syscall.h |8 +---
 include/asm-generic/syscall.h  |   18 
 include/asm-nios2/syscall.h|8 +---
 include/asm-powerpc/syscall.h  |9 +---
 include/asm-x86/syscall.h  |   93 ++-
 src/skins/common/bind.c|   38 
 7 files changed, 98 insertions(+), 85 deletions(-)

diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
index be16e9c..0b51492 100644
--- a/include/asm-arm/syscall.h
+++ b/include/asm-arm/syscall.h
@@ -201,13 +201,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
err = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id,  \
   op, sigs, args); \
res = xnsig_dispatch(sigs, res, err);  \
-   \
-   while (sigs.nsigs  sigs.remaining) {  \
-   sigs.nsigs = 0; \
-   err = XENOMAI_DO_SYSCALL_INNER  \
-   (0, 0, __xn_sys_get_next_sigs, sigs); \
-   res = xnsig_dispatch_next(sigs, res, err); \
-   }   \
} while (res == -ERESTART); \
res;\
})
@@ -226,6 +219,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)   \
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
+#define XENOMAI_SYSSIGS(sigs)  \
+   XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)   \
XENOMAI_DO_SYSCALL(0,id,op)
diff --git a/include/asm-blackfin/syscall.h b/include/asm-blackfin/syscall.h
index 02cc143..9f90611 100644
--- a/include/asm-blackfin/syscall.h
+++ b/include/asm-blackfin/syscall.h
@@ -221,12 +221,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
__err__ = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, \
   op, __sigs__, 
##args); \
__res__ = xnsig_dispatch(__sigs__, __res__, __err__); \
-   while (__sigs__.nsigs  __sigs__.remaining) {  \
-   __sigs__.nsigs = 0; \
-   __err__ = XENOMAI_DO_SYSCALL_INNER  \
-   (0, 0, __xn_sys_get_next_sigs, 
__sigs__); \
-   __res__ = xnsig_dispatch_next(__sigs__, 
__res__, __err__); \
-   }   \
} while (__res__ == -ERESTART); \
__res__;\
})
@@ -238,6 +232,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #define XENOMAI_SYSCALL4(op,a1,a2,a3,a4)
XENOMAI_DO_SYSCALL(4,0,op,a1,a2,a3,a4)
 #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
+#define XENOMAI_SYSSIGS(sigs)  \
+   XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)XENOMAI_DO_SYSCALL(0,id,op)
 #define XENOMAI_SKINCALL1(id,op,a1) XENOMAI_DO_SYSCALL(1,id,op,a1)
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 926498b..483b99f 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -158,10 +158,15 @@ static inline int __xn_safe_strncpy_from_user(char *dst,
 #else /* !__KERNEL__ */
 
 #ifdef __cplusplus
-extern C
+extern C {
 #endif /* __cplusplus */
 int __xnsig_dispatch(struct xnsig *sigs, int cumulated_error, int last_error);
 
+int __xnsig_dispatch_safe(struct xnsig *sigs, int cumulated_error, int 
last_error);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 /* Called to dispatch signals which interrupted a system call. */
 static inline int xnsig_dispatch(struct xnsig *sigs, int cumul, int last)
 {
@@ -170,16 +175,11 @@ static inline int xnsig_dispatch(struct xnsig *sigs, int 
cumul, int last)