From 71ff3d7f1d30d20062764ffa3b63e7e69b7a637a Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 21 Jan 2019 09:42:37 +0100 Subject: [PATCH] Try to make a symbol easier to find for MC on exotic platforms --- src/kernel/context/ContextUnix.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index e9dafbfb5d..09711d033c 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -23,9 +23,10 @@ constexpr int CTX_ADDR_LEN = 2; static_assert(sizeof(simgrid::kernel::context::UContext*) <= CTX_ADDR_LEN * sizeof(int), "Ucontexts are not supported on this arch yet. Please increase CTX_ADDR_LEN."); -namespace simgrid { -namespace kernel { -namespace context { +/* Make sure that this symbol is easy to recognize by name, even on exotic platforms */ +extern "C" { +static void smx_ctx_wrapper(int i1, int i2); +} // The name of this function is currently hardcoded in MC (as string). // Do not change it without fixing those references as well. @@ -50,6 +51,10 @@ static void smx_ctx_wrapper(int i1, int i2) context->suspend(); } +namespace simgrid { +namespace kernel { +namespace context { + // UContextFactory Context* UContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t actor) { -- 2.20.1