From a2feab1cc47e5e388c217f2b9a9032b04db215e8 Mon Sep 17 00:00:00 2001 From: eeb Date: Sat, 15 Oct 2005 18:33:25 +0000 Subject: [PATCH] * Changed linking of userspace ptllnd to depend on HAVE_CRAY_XT3 rather than !HAVE_LIBPTHREAD. --- lnet/include/lnet/lib-lnet.h | 11 ++++++++++- lnet/lnet/api-ni.c | 19 ++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 02c562e..124999a 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -459,7 +459,16 @@ lnet_nid2peerhash (lnet_nid_t nid) extern lnd_t the_lolnd; #ifndef __KERNEL__ -#define LNET_REGISTER_LND_IF_PRESENT(lnd) \ +/* unconditional registration */ +#define LNET_REGISTER_ULND(lnd) \ +do { \ + extern lnd_t lnd; \ + \ + lnet_register_lnd(&(lnd)); \ +} while (0) + +/* conditional registration */ +#define LNET_REGISTER_ULND_IF_PRESENT(lnd) \ do { \ extern lnd_t lnd __attribute__ ((weak, alias("the_lolnd"))); \ \ diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 7b4d613..4a7fbe9 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -1095,14 +1095,6 @@ lnet_startup_lndnis (void) return -ENETDOWN; } -#ifndef __KERNEL__ -# if !HAVE_LIBPTHREAD -extern lnd_t the_ptllnd; -# else -extern lnd_t the_tcplnd; -# endif -#endif - int LNetInit(void) { @@ -1126,12 +1118,13 @@ LNetInit(void) * register themselves when their module loads, and unregister * themselves when their module is unloaded. */ #else - /* Register all LNDs that have been loaded + /* Register LNDs * NB the order here determines default 'networks=' order */ -# if !HAVE_LIBPTHREAD - lnet_register_lnd(&the_ptllnd); -# else - lnet_register_lnd(&the_tcplnd); +# if HAVE_CRAY_XT3 + LNET_REGISTER_ULND(the_ptllnd); +# endif +# if HAVE_LIBPTHREAD + LNET_REGISTER_ULND(the_tcplnd); # endif #endif lnet_register_lnd(&the_lolnd); -- 1.8.3.1