[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: rename assertion helper, fix header

2017-04-15 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: dd131f1d6d76cc3aae14c542926f6622563b2062
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dd131f1d6d76cc3aae14c542926f6622563b2062

Author: Philippe Gerum 
Date:   Mon Mar 13 15:51:31 2017 +0100

lib/cobalt: modechk: rename assertion helper, fix header

---

 include/cobalt/stdio.h  |4 
 include/cobalt/sys/cobalt.h |6 ++
 lib/cobalt/Makefile.am  |1 -
 lib/cobalt/assert_context.c |   40 
 lib/cobalt/cxaguard.c   |9 -
 lib/cobalt/internal.c   |   19 ++-
 lib/cobalt/malloc.c |7 +++
 lib/cobalt/printf.c |6 +++---
 8 files changed, 34 insertions(+), 58 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 81486d5..c915e6d 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -112,10 +112,6 @@ const char *rt_print_buffer_name(void);
 
 void rt_print_flush_buffers(void);
 
-void assert_nrt(void);
-
-__deprecated void assert_nrt_fast(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h
index e7c58d7..1da8a46 100644
--- a/include/cobalt/sys/cobalt.h
+++ b/include/cobalt/sys/cobalt.h
@@ -132,6 +132,12 @@ int cobalt_sched_weighted_prio(int policy,
 
 void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th);
 
+void cobalt_assert_nrt(void);
+
+/* Use cobalt_assert_nrt() instead of: */
+__deprecated void assert_nrt(void);
+__deprecated void assert_nrt_fast(void);
+
 extern int __cobalt_control_bind;
 
 #ifdef __cplusplus
diff --git a/lib/cobalt/Makefile.am b/lib/cobalt/Makefile.am
index 6275eb4..c2d5956 100644
--- a/lib/cobalt/Makefile.am
+++ b/lib/cobalt/Makefile.am
@@ -14,7 +14,6 @@ libcobalt_la_LIBADD = \
../boilerplate/libboilerplate.la
 
 libcobalt_la_SOURCES = \
-   assert_context.c\
attr.c  \
clock.c \
cond.c  \
diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c
deleted file mode 100644
index 11739db..000
--- a/lib/cobalt/assert_context.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Jan Kiszka .
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "current.h"
-#include "internal.h"
-
-void assert_nrt(void)
-{
-   if (cobalt_should_warn())
-   pthread_kill(pthread_self(), SIGDEBUG);
-}
-
-void assert_nrt_fast(void) /* OBSOLETE */
-{
-   assert_nrt();
-}
diff --git a/lib/cobalt/cxaguard.c b/lib/cobalt/cxaguard.c
index 13432af..6df471a 100644
--- a/lib/cobalt/cxaguard.c
+++ b/lib/cobalt/cxaguard.c
@@ -16,10 +16,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 #include 
+#include 
 #include 
 
-void assert_nrt(void);
-
 #ifdef __ARM_EABI__
 typedef uint32_t __cxa_guard_type;
 #else
@@ -32,7 +31,7 @@ int __real_cxa_guard_acquire(__cxa_guard_type *g);
 /* CXXABI 3.3.2 One-time Construction API */
 COBALT_IMPL(int, __cxa_guard_acquire, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
return __STD(__cxa_guard_acquire(g));
 }
 
@@ -41,7 +40,7 @@ void __real_cxa_guard_release(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_release, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_release(g));
 }
 
@@ -50,6 +49,6 @@ void __real_cxa_guard_abort(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_abort, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_abort(g));
 }
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index 5b89db5..49744c4 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Philippe Gerum .
+ * Copyright (C) 2008, 2009 Jan Kiszka .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,7 +31,7 @@
 #include 
 #include 
 #include 
-#include "current.h"
+#include 
 #include "internal.h"
 
 int cobalt_extend(unsigned int 

[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: rename assertion helper, fix header

2017-03-13 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: dd131f1d6d76cc3aae14c542926f6622563b2062
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dd131f1d6d76cc3aae14c542926f6622563b2062

Author: Philippe Gerum 
Date:   Mon Mar 13 15:51:31 2017 +0100

lib/cobalt: modechk: rename assertion helper, fix header

---

 include/cobalt/stdio.h  |4 
 include/cobalt/sys/cobalt.h |6 ++
 lib/cobalt/Makefile.am  |1 -
 lib/cobalt/assert_context.c |   40 
 lib/cobalt/cxaguard.c   |9 -
 lib/cobalt/internal.c   |   19 ++-
 lib/cobalt/malloc.c |7 +++
 lib/cobalt/printf.c |6 +++---
 8 files changed, 34 insertions(+), 58 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 81486d5..c915e6d 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -112,10 +112,6 @@ const char *rt_print_buffer_name(void);
 
 void rt_print_flush_buffers(void);
 
-void assert_nrt(void);
-
-__deprecated void assert_nrt_fast(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h
index e7c58d7..1da8a46 100644
--- a/include/cobalt/sys/cobalt.h
+++ b/include/cobalt/sys/cobalt.h
@@ -132,6 +132,12 @@ int cobalt_sched_weighted_prio(int policy,
 
 void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th);
 
+void cobalt_assert_nrt(void);
+
+/* Use cobalt_assert_nrt() instead of: */
+__deprecated void assert_nrt(void);
+__deprecated void assert_nrt_fast(void);
+
 extern int __cobalt_control_bind;
 
 #ifdef __cplusplus
diff --git a/lib/cobalt/Makefile.am b/lib/cobalt/Makefile.am
index 6275eb4..c2d5956 100644
--- a/lib/cobalt/Makefile.am
+++ b/lib/cobalt/Makefile.am
@@ -14,7 +14,6 @@ libcobalt_la_LIBADD = \
../boilerplate/libboilerplate.la
 
 libcobalt_la_SOURCES = \
-   assert_context.c\
attr.c  \
clock.c \
cond.c  \
diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c
deleted file mode 100644
index 11739db..000
--- a/lib/cobalt/assert_context.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Jan Kiszka .
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "current.h"
-#include "internal.h"
-
-void assert_nrt(void)
-{
-   if (cobalt_should_warn())
-   pthread_kill(pthread_self(), SIGDEBUG);
-}
-
-void assert_nrt_fast(void) /* OBSOLETE */
-{
-   assert_nrt();
-}
diff --git a/lib/cobalt/cxaguard.c b/lib/cobalt/cxaguard.c
index 13432af..6df471a 100644
--- a/lib/cobalt/cxaguard.c
+++ b/lib/cobalt/cxaguard.c
@@ -16,10 +16,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 #include 
+#include 
 #include 
 
-void assert_nrt(void);
-
 #ifdef __ARM_EABI__
 typedef uint32_t __cxa_guard_type;
 #else
@@ -32,7 +31,7 @@ int __real_cxa_guard_acquire(__cxa_guard_type *g);
 /* CXXABI 3.3.2 One-time Construction API */
 COBALT_IMPL(int, __cxa_guard_acquire, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
return __STD(__cxa_guard_acquire(g));
 }
 
@@ -41,7 +40,7 @@ void __real_cxa_guard_release(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_release, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_release(g));
 }
 
@@ -50,6 +49,6 @@ void __real_cxa_guard_abort(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_abort, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_abort(g));
 }
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index 5b89db5..49744c4 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Philippe Gerum .
+ * Copyright (C) 2008, 2009 Jan Kiszka .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,7 +31,7 @@
 #include 
 #include 
 #include 
-#include "current.h"
+#include 
 #include "internal.h"
 
 int cobalt_extend(unsigned int ma

[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: rename assertion helper, fix header

2017-03-13 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: dd131f1d6d76cc3aae14c542926f6622563b2062
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dd131f1d6d76cc3aae14c542926f6622563b2062

Author: Philippe Gerum 
Date:   Mon Mar 13 15:51:31 2017 +0100

lib/cobalt: modechk: rename assertion helper, fix header

---

 include/cobalt/stdio.h  |4 
 include/cobalt/sys/cobalt.h |6 ++
 lib/cobalt/Makefile.am  |1 -
 lib/cobalt/assert_context.c |   40 
 lib/cobalt/cxaguard.c   |9 -
 lib/cobalt/internal.c   |   19 ++-
 lib/cobalt/malloc.c |7 +++
 lib/cobalt/printf.c |6 +++---
 8 files changed, 34 insertions(+), 58 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 81486d5..c915e6d 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -112,10 +112,6 @@ const char *rt_print_buffer_name(void);
 
 void rt_print_flush_buffers(void);
 
-void assert_nrt(void);
-
-__deprecated void assert_nrt_fast(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h
index e7c58d7..1da8a46 100644
--- a/include/cobalt/sys/cobalt.h
+++ b/include/cobalt/sys/cobalt.h
@@ -132,6 +132,12 @@ int cobalt_sched_weighted_prio(int policy,
 
 void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th);
 
+void cobalt_assert_nrt(void);
+
+/* Use cobalt_assert_nrt() instead of: */
+__deprecated void assert_nrt(void);
+__deprecated void assert_nrt_fast(void);
+
 extern int __cobalt_control_bind;
 
 #ifdef __cplusplus
diff --git a/lib/cobalt/Makefile.am b/lib/cobalt/Makefile.am
index 6275eb4..c2d5956 100644
--- a/lib/cobalt/Makefile.am
+++ b/lib/cobalt/Makefile.am
@@ -14,7 +14,6 @@ libcobalt_la_LIBADD = \
../boilerplate/libboilerplate.la
 
 libcobalt_la_SOURCES = \
-   assert_context.c\
attr.c  \
clock.c \
cond.c  \
diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c
deleted file mode 100644
index 11739db..000
--- a/lib/cobalt/assert_context.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Jan Kiszka .
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "current.h"
-#include "internal.h"
-
-void assert_nrt(void)
-{
-   if (cobalt_should_warn())
-   pthread_kill(pthread_self(), SIGDEBUG);
-}
-
-void assert_nrt_fast(void) /* OBSOLETE */
-{
-   assert_nrt();
-}
diff --git a/lib/cobalt/cxaguard.c b/lib/cobalt/cxaguard.c
index 13432af..6df471a 100644
--- a/lib/cobalt/cxaguard.c
+++ b/lib/cobalt/cxaguard.c
@@ -16,10 +16,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 #include 
+#include 
 #include 
 
-void assert_nrt(void);
-
 #ifdef __ARM_EABI__
 typedef uint32_t __cxa_guard_type;
 #else
@@ -32,7 +31,7 @@ int __real_cxa_guard_acquire(__cxa_guard_type *g);
 /* CXXABI 3.3.2 One-time Construction API */
 COBALT_IMPL(int, __cxa_guard_acquire, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
return __STD(__cxa_guard_acquire(g));
 }
 
@@ -41,7 +40,7 @@ void __real_cxa_guard_release(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_release, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_release(g));
 }
 
@@ -50,6 +49,6 @@ void __real_cxa_guard_abort(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_abort, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_abort(g));
 }
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index 5b89db5..49744c4 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Philippe Gerum .
+ * Copyright (C) 2008, 2009 Jan Kiszka .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,7 +31,7 @@
 #include 
 #include 
 #include 
-#include "current.h"
+#include 
 #include "internal.h"
 
 int cobalt_extend(unsigne

[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: rename assertion helper, fix header

2017-03-13 Thread git repository hosting
Module: xenomai-3
Branch: wip/modechk
Commit: dd131f1d6d76cc3aae14c542926f6622563b2062
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dd131f1d6d76cc3aae14c542926f6622563b2062

Author: Philippe Gerum 
Date:   Mon Mar 13 15:51:31 2017 +0100

lib/cobalt: modechk: rename assertion helper, fix header

---

 include/cobalt/stdio.h  |4 
 include/cobalt/sys/cobalt.h |6 ++
 lib/cobalt/Makefile.am  |1 -
 lib/cobalt/assert_context.c |   40 
 lib/cobalt/cxaguard.c   |9 -
 lib/cobalt/internal.c   |   19 ++-
 lib/cobalt/malloc.c |7 +++
 lib/cobalt/printf.c |6 +++---
 8 files changed, 34 insertions(+), 58 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 81486d5..c915e6d 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -112,10 +112,6 @@ const char *rt_print_buffer_name(void);
 
 void rt_print_flush_buffers(void);
 
-void assert_nrt(void);
-
-__deprecated void assert_nrt_fast(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h
index e7c58d7..1da8a46 100644
--- a/include/cobalt/sys/cobalt.h
+++ b/include/cobalt/sys/cobalt.h
@@ -132,6 +132,12 @@ int cobalt_sched_weighted_prio(int policy,
 
 void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th);
 
+void cobalt_assert_nrt(void);
+
+/* Use cobalt_assert_nrt() instead of: */
+__deprecated void assert_nrt(void);
+__deprecated void assert_nrt_fast(void);
+
 extern int __cobalt_control_bind;
 
 #ifdef __cplusplus
diff --git a/lib/cobalt/Makefile.am b/lib/cobalt/Makefile.am
index 6275eb4..c2d5956 100644
--- a/lib/cobalt/Makefile.am
+++ b/lib/cobalt/Makefile.am
@@ -14,7 +14,6 @@ libcobalt_la_LIBADD = \
../boilerplate/libboilerplate.la
 
 libcobalt_la_SOURCES = \
-   assert_context.c\
attr.c  \
clock.c \
cond.c  \
diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c
deleted file mode 100644
index 11739db..000
--- a/lib/cobalt/assert_context.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Jan Kiszka .
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "current.h"
-#include "internal.h"
-
-void assert_nrt(void)
-{
-   if (cobalt_should_warn())
-   pthread_kill(pthread_self(), SIGDEBUG);
-}
-
-void assert_nrt_fast(void) /* OBSOLETE */
-{
-   assert_nrt();
-}
diff --git a/lib/cobalt/cxaguard.c b/lib/cobalt/cxaguard.c
index 13432af..6df471a 100644
--- a/lib/cobalt/cxaguard.c
+++ b/lib/cobalt/cxaguard.c
@@ -16,10 +16,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 #include 
+#include 
 #include 
 
-void assert_nrt(void);
-
 #ifdef __ARM_EABI__
 typedef uint32_t __cxa_guard_type;
 #else
@@ -32,7 +31,7 @@ int __real_cxa_guard_acquire(__cxa_guard_type *g);
 /* CXXABI 3.3.2 One-time Construction API */
 COBALT_IMPL(int, __cxa_guard_acquire, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
return __STD(__cxa_guard_acquire(g));
 }
 
@@ -41,7 +40,7 @@ void __real_cxa_guard_release(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_release, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_release(g));
 }
 
@@ -50,6 +49,6 @@ void __real_cxa_guard_abort(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_abort, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_abort(g));
 }
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index 5b89db5..49744c4 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Philippe Gerum .
+ * Copyright (C) 2008, 2009 Jan Kiszka .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,7 +31,7 @@
 #include 
 #include 
 #include 
-#include "current.h"
+#include 
 #include "internal.h"
 
 int cobalt_extend(unsigned

[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: rename assertion helper, fix header

2017-03-13 Thread git repository hosting
Module: xenomai-3
Branch: wip/modechk
Commit: 8535143c109b453d9021dd9626867388ad488801
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8535143c109b453d9021dd9626867388ad488801

Author: Philippe Gerum 
Date:   Mon Mar 13 15:51:31 2017 +0100

lib/cobalt: modechk: rename assertion helper, fix header

---

 include/cobalt/stdio.h  |4 
 include/cobalt/sys/cobalt.h |6 ++
 lib/cobalt/Makefile.am  |1 -
 lib/cobalt/assert_context.c |   40 
 lib/cobalt/cxaguard.c   |9 -
 lib/cobalt/internal.c   |   19 ++-
 lib/cobalt/malloc.c |7 +++
 lib/cobalt/printf.c |6 +++---
 8 files changed, 34 insertions(+), 58 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 81486d5..c915e6d 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -112,10 +112,6 @@ const char *rt_print_buffer_name(void);
 
 void rt_print_flush_buffers(void);
 
-void assert_nrt(void);
-
-__deprecated void assert_nrt_fast(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h
index e7c58d7..1da8a46 100644
--- a/include/cobalt/sys/cobalt.h
+++ b/include/cobalt/sys/cobalt.h
@@ -132,6 +132,12 @@ int cobalt_sched_weighted_prio(int policy,
 
 void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th);
 
+void cobalt_assert_nrt(void);
+
+/* Use cobalt_assert_nrt() instead of: */
+__deprecated void assert_nrt(void);
+__deprecated void assert_nrt_fast(void);
+
 extern int __cobalt_control_bind;
 
 #ifdef __cplusplus
diff --git a/lib/cobalt/Makefile.am b/lib/cobalt/Makefile.am
index 6275eb4..c2d5956 100644
--- a/lib/cobalt/Makefile.am
+++ b/lib/cobalt/Makefile.am
@@ -14,7 +14,6 @@ libcobalt_la_LIBADD = \
../boilerplate/libboilerplate.la
 
 libcobalt_la_SOURCES = \
-   assert_context.c\
attr.c  \
clock.c \
cond.c  \
diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c
deleted file mode 100644
index 11739db..000
--- a/lib/cobalt/assert_context.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Jan Kiszka .
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "current.h"
-#include "internal.h"
-
-void assert_nrt(void)
-{
-   if (cobalt_should_warn())
-   pthread_kill(pthread_self(), SIGDEBUG);
-}
-
-void assert_nrt_fast(void) /* OBSOLETE */
-{
-   assert_nrt();
-}
diff --git a/lib/cobalt/cxaguard.c b/lib/cobalt/cxaguard.c
index 13432af..6df471a 100644
--- a/lib/cobalt/cxaguard.c
+++ b/lib/cobalt/cxaguard.c
@@ -16,10 +16,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 #include 
+#include 
 #include 
 
-void assert_nrt(void);
-
 #ifdef __ARM_EABI__
 typedef uint32_t __cxa_guard_type;
 #else
@@ -32,7 +31,7 @@ int __real_cxa_guard_acquire(__cxa_guard_type *g);
 /* CXXABI 3.3.2 One-time Construction API */
 COBALT_IMPL(int, __cxa_guard_acquire, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
return __STD(__cxa_guard_acquire(g));
 }
 
@@ -41,7 +40,7 @@ void __real_cxa_guard_release(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_release, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_release(g));
 }
 
@@ -50,6 +49,6 @@ void __real_cxa_guard_abort(__cxa_guard_type *g);
 
 COBALT_IMPL(void, __cxa_guard_abort, (__cxa_guard_type *g))
 {
-   assert_nrt();
+   cobalt_assert_nrt();
__STD(__cxa_guard_abort(g));
 }
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index 5b89db5..49744c4 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Philippe Gerum .
+ * Copyright (C) 2008, 2009 Jan Kiszka .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,7 +31,7 @@
 #include 
 #include 
 #include 
-#include "current.h"
+#include 
 #include "internal.h"
 
 int cobalt_extend(unsigned