Module: xenomai-3 Branch: next Commit: f9227f35eea45418c30333f2c11e5fcd7f5b98c8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f9227f35eea45418c30333f2c11e5fcd7f5b98c8
Author: Philippe Gerum <r...@xenomai.org> Date: Sat Jul 25 17:32:20 2015 +0200 lib/cobalt: drop "no shadow" binding mode This mode was meant to allow application programs to dlopen() the legacy Xenomai core library (aka libxenomai.so), in which the services used to be bootstrapped from an embedded library constructor, binding to the real-time core, before the current thread got shadowed automatically. The no-shadow mechanism was meant at preventing the latter action from taking place at the end of the init sequence. In the current implementation, the services are bootstrapped by an explicit call to xenomai_init(), usually done from a wrapper interposing on the main() routine, not from a library constructor anymore. Therefore, dlopen()'ing libcobalt.so per se will not cause the calling context to be shadowed. Calling xenomai_init() will be required to activate the Xenomai services for the calling process at some point, however the program is free to choose the context from which this should be done. In parallel, running over a shadowed context is required for traversing the init code of the various libraries bootstapped on behalf of xenomai_init(). So, basically we don't support "no shadow" binding anymore, but this is a non-issue since it became useless. --- include/cobalt/sys/cobalt.h | 2 -- lib/cobalt/init.c | 15 ++------------- utils/corectl/corectl.c | 2 -- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h index 9f9d03a..22322c1 100644 --- a/include/cobalt/sys/cobalt.h +++ b/include/cobalt/sys/cobalt.h @@ -130,8 +130,6 @@ int cobalt_sched_weighted_prio(int policy, void cobalt_register_tsd_hook(struct cobalt_tsd_hook *th); -extern int __cobalt_no_shadow; - extern int __cobalt_control_bind; extern int __cobalt_main_prio; diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c index c67de7b..3399329 100644 --- a/lib/cobalt/init.c +++ b/lib/cobalt/init.c @@ -44,8 +44,6 @@ * Single Unix specification</a> over the Cobalt core. */ -__weak int __cobalt_no_shadow = 0; - __weak int __cobalt_control_bind = 0; __weak int __cobalt_main_prio = -1; @@ -54,13 +52,7 @@ struct sigaction __cobalt_orig_sigdebug; static const struct option cobalt_options[] = { { -#define no_shadow_opt 0 - .name = "no-shadow", - .flag = &__cobalt_no_shadow, - .val = 1 - }, - { -#define main_prio_opt 1 +#define main_prio_opt 0 .name = "main-prio", .has_arg = 1, }, @@ -184,7 +176,7 @@ int cobalt_init(void) cobalt_default_condattr_init(); __cobalt_init(); - if (__cobalt_no_shadow) + if (__cobalt_control_bind) return 0; ret = __STD(pthread_getschedparam(ptid, &policy, &parm)); @@ -226,8 +218,6 @@ static int cobalt_parse_option(int optnum, const char *optarg) case main_prio_opt: __cobalt_main_prio = atoi(optarg); break; - case no_shadow_opt: - break; default: /* Paranoid, can't happen. */ return -EINVAL; @@ -238,7 +228,6 @@ static int cobalt_parse_option(int optnum, const char *optarg) static void cobalt_help(void) { - fprintf(stderr, "--no-shadow do not shadow main thread\n"); fprintf(stderr, "--main-prio=<prio> set main thread priority\n"); } diff --git a/utils/corectl/corectl.c b/utils/corectl/corectl.c index 7104086..e1d1f17 100644 --- a/utils/corectl/corectl.c +++ b/utils/corectl/corectl.c @@ -25,8 +25,6 @@ #include <sys/cobalt.h> #include <xenomai/init.h> -int __cobalt_no_shadow = 1; - int __cobalt_control_bind = 1; static int action; _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git