[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: fetch WARNSW flag from u_window
Module: xenomai-3 Branch: master Commit: bad288b6bab74cc230d1fc6e2d80f9e388be7d3e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bad288b6bab74cc230d1fc6e2d80f9e388be7d3e Author: Philippe GerumDate: Mon Mar 13 12:33:37 2017 +0100 lib/cobalt: modechk: fetch WARNSW flag from u_window --- lib/cobalt/assert_context.c | 19 ++- lib/cobalt/internal.h |5 + 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c index 625cb76..11739db 100644 --- a/lib/cobalt/assert_context.c +++ b/lib/cobalt/assert_context.c @@ -28,25 +28,10 @@ #include "current.h" #include "internal.h" -static void assert_nrt_inner(void) -{ - struct cobalt_threadstat stat; - int ret; - - ret = cobalt_thread_stat(0, ); - if (ret) { - warning("cobalt_thread_stat() failed: %s", strerror(-ret)); - return; - } - - if (stat.status & XNWARN) - pthread_kill(pthread_self(), SIGDEBUG); -} - void assert_nrt(void) { - if (!cobalt_is_relaxed()) - assert_nrt_inner(); + if (cobalt_should_warn()) + pthread_kill(pthread_self(), SIGDEBUG); } void assert_nrt_fast(void) /* OBSOLETE */ diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index fee3fe1..df1f7c0 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,11 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +static inline int cobalt_should_warn(void) +{ + return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; +} + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: fetch WARNSW flag from u_window
Module: xenomai-3 Branch: next Commit: bad288b6bab74cc230d1fc6e2d80f9e388be7d3e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bad288b6bab74cc230d1fc6e2d80f9e388be7d3e Author: Philippe GerumDate: Mon Mar 13 12:33:37 2017 +0100 lib/cobalt: modechk: fetch WARNSW flag from u_window --- lib/cobalt/assert_context.c | 19 ++- lib/cobalt/internal.h |5 + 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c index 625cb76..11739db 100644 --- a/lib/cobalt/assert_context.c +++ b/lib/cobalt/assert_context.c @@ -28,25 +28,10 @@ #include "current.h" #include "internal.h" -static void assert_nrt_inner(void) -{ - struct cobalt_threadstat stat; - int ret; - - ret = cobalt_thread_stat(0, ); - if (ret) { - warning("cobalt_thread_stat() failed: %s", strerror(-ret)); - return; - } - - if (stat.status & XNWARN) - pthread_kill(pthread_self(), SIGDEBUG); -} - void assert_nrt(void) { - if (!cobalt_is_relaxed()) - assert_nrt_inner(); + if (cobalt_should_warn()) + pthread_kill(pthread_self(), SIGDEBUG); } void assert_nrt_fast(void) /* OBSOLETE */ diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index fee3fe1..df1f7c0 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,11 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +static inline int cobalt_should_warn(void) +{ + return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; +} + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: fetch WARNSW flag from u_window
Module: xenomai-3 Branch: wip/modechk Commit: bad288b6bab74cc230d1fc6e2d80f9e388be7d3e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bad288b6bab74cc230d1fc6e2d80f9e388be7d3e Author: Philippe GerumDate: Mon Mar 13 12:33:37 2017 +0100 lib/cobalt: modechk: fetch WARNSW flag from u_window --- lib/cobalt/assert_context.c | 19 ++- lib/cobalt/internal.h |5 + 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c index 625cb76..11739db 100644 --- a/lib/cobalt/assert_context.c +++ b/lib/cobalt/assert_context.c @@ -28,25 +28,10 @@ #include "current.h" #include "internal.h" -static void assert_nrt_inner(void) -{ - struct cobalt_threadstat stat; - int ret; - - ret = cobalt_thread_stat(0, ); - if (ret) { - warning("cobalt_thread_stat() failed: %s", strerror(-ret)); - return; - } - - if (stat.status & XNWARN) - pthread_kill(pthread_self(), SIGDEBUG); -} - void assert_nrt(void) { - if (!cobalt_is_relaxed()) - assert_nrt_inner(); + if (cobalt_should_warn()) + pthread_kill(pthread_self(), SIGDEBUG); } void assert_nrt_fast(void) /* OBSOLETE */ diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index fee3fe1..df1f7c0 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,11 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +static inline int cobalt_should_warn(void) +{ + return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; +} + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: fetch WARNSW flag from u_window
Module: xenomai-3 Branch: stable-3.0.x Commit: bad288b6bab74cc230d1fc6e2d80f9e388be7d3e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bad288b6bab74cc230d1fc6e2d80f9e388be7d3e Author: Philippe GerumDate: Mon Mar 13 12:33:37 2017 +0100 lib/cobalt: modechk: fetch WARNSW flag from u_window --- lib/cobalt/assert_context.c | 19 ++- lib/cobalt/internal.h |5 + 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c index 625cb76..11739db 100644 --- a/lib/cobalt/assert_context.c +++ b/lib/cobalt/assert_context.c @@ -28,25 +28,10 @@ #include "current.h" #include "internal.h" -static void assert_nrt_inner(void) -{ - struct cobalt_threadstat stat; - int ret; - - ret = cobalt_thread_stat(0, ); - if (ret) { - warning("cobalt_thread_stat() failed: %s", strerror(-ret)); - return; - } - - if (stat.status & XNWARN) - pthread_kill(pthread_self(), SIGDEBUG); -} - void assert_nrt(void) { - if (!cobalt_is_relaxed()) - assert_nrt_inner(); + if (cobalt_should_warn()) + pthread_kill(pthread_self(), SIGDEBUG); } void assert_nrt_fast(void) /* OBSOLETE */ diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index fee3fe1..df1f7c0 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,11 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +static inline int cobalt_should_warn(void) +{ + return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; +} + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: modechk: fetch WARNSW flag from u_window
Module: xenomai-3 Branch: wip/modechk Commit: 080322b04a0ab5f76ee3d1a185fc456e585a2ae1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=080322b04a0ab5f76ee3d1a185fc456e585a2ae1 Author: Philippe GerumDate: Mon Mar 13 12:33:37 2017 +0100 lib/cobalt: modechk: fetch WARNSW flag from u_window --- lib/cobalt/assert_context.c | 19 ++- lib/cobalt/internal.h |5 + 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/cobalt/assert_context.c b/lib/cobalt/assert_context.c index 625cb76..11739db 100644 --- a/lib/cobalt/assert_context.c +++ b/lib/cobalt/assert_context.c @@ -28,25 +28,10 @@ #include "current.h" #include "internal.h" -static void assert_nrt_inner(void) -{ - struct cobalt_threadstat stat; - int ret; - - ret = cobalt_thread_stat(0, ); - if (ret) { - warning("cobalt_thread_stat() failed: %s", strerror(-ret)); - return; - } - - if (stat.status & XNWARN) - pthread_kill(pthread_self(), SIGDEBUG); -} - void assert_nrt(void) { - if (!cobalt_is_relaxed()) - assert_nrt_inner(); + if (cobalt_should_warn()) + pthread_kill(pthread_self(), SIGDEBUG); } void assert_nrt_fast(void) /* OBSOLETE */ diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h index fee3fe1..df1f7c0 100644 --- a/lib/cobalt/internal.h +++ b/lib/cobalt/internal.h @@ -32,6 +32,11 @@ static inline int cobalt_is_relaxed(void) return cobalt_get_current_mode() & XNRELAX; } +static inline int cobalt_should_warn(void) +{ + return (cobalt_get_current_mode() & (XNRELAX|XNWARN)) == XNWARN; +} + static inline struct cobalt_mutex_state *mutex_get_state(struct cobalt_mutex_shadow *shadow) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git